diff options
Diffstat (limited to 'lib/asn1/test/testFragmented.erl')
-rw-r--r-- | lib/asn1/test/testFragmented.erl | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/lib/asn1/test/testFragmented.erl b/lib/asn1/test/testFragmented.erl index bd63bd83fc..0efdc4c227 100644 --- a/lib/asn1/test/testFragmented.erl +++ b/lib/asn1/test/testFragmented.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2013-2021. All Rights Reserved. +%% Copyright Ericsson AB 2013-2022. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -36,7 +36,37 @@ main(_Erule) -> K8,K8,K8,K8,K8,K8]}), roundtrip('PDU', {'PDU',1,false,[K8,K8,K8,K8,K8,K8,K8,K8, K8,K8,K8,K8,K8,K8,K8,K8]}), + + K16 = 16384, + K64 = 4 * K16, + K144 = 2 * K64 + K16, + roundtrips([1, 2, 3, 17, + K16-1, K16, K16+1, + 2*K16-1, 2*K16, 2*K16+1, + 3*K16-1, 3*K16, 3*K16+1, + K64-1, K64, K64+1, + K64+K16, + K144-1, K144, K144+1]), + ok. + +roundtrips([Size|Sizes]) -> + L = make_seq(Size, []), + io:format("~p: ~P\n", [Size,L,6]), + roundtrip('IntBoolSeqsU', L), + if + Size =< 65536 -> + roundtrip('IntBoolSeqs', L); + true -> + ok + end, + roundtrips(Sizes); +roundtrips([]) -> ok. roundtrip(T, V) -> asn1_test_lib:roundtrip('Fragmented', T, V). + +make_seq(0, Acc) -> + Acc; +make_seq(N, Acc) -> + make_seq(N - 1, [{'IntBoolSeq',N,N rem 7 =:= 0}|Acc]). |