Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorng committed Oct 18, 2023
1 parent 3aad219 commit 981e0ec
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/asn1/test/asn1_SUITE_data/PartialDecSeq2.asn1config
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
{decode_D_incomplete,['D',[{a,undecoded}]]},
{decode_Bext_c_incomplete,['Bext',[{c,undecoded}]]},
{decode_Bext_c_b_incomplete,['Bext',[{c,[{b,undecoded}]}]]},
{decode_SeqChoice_d_incomplete,['SeqChoice',[{d,undecoded}]]},
{decode_SeqChoice_c_b_d_incomplete,['SeqChoice',[{c,[{b,undecoded}]},{d,undecoded}]]}
{decode_SeqChoice_c_b_d_incomplete,
['SeqChoice',[{c,[{b,undecoded}]},
{d,undecoded}]]},
{decode_SeqChoice_c_bis_incomplete,
['SeqChoice',
[{c,[{b,undecoded},{i,undecoded},{s,undecoded}]}]]}
]}}.

16 changes: 16 additions & 0 deletions lib/asn1/test/test_partial_incomplete_decode.erl
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,22 @@ test_PartialDecSeq2() ->
{c,{'S',true,{'S_b',Undec2}}} = IncBextMsg2,
{ok,false} = M:decode_part('S_b', Undec2),

test_PartialDeqSeq2_SeqChoice(),

ok.

test_PartialDeqSeq2_SeqChoice() ->
M = 'PartialDecSeq2',
T = 'SeqChoice',

SeqChoiceMsg1 = {'SeqChoice',{b,true},<<"abc">>},
Bytes1 = roundtrip(M, T, SeqChoiceMsg1),
{ok,EncMsg1_1} = M:decode_SeqChoice_c_b_d_incomplete(Bytes1),
{'SeqChoice',{b,{'SeqChoice_c_b',UndecBool}},
{'SeqChoice_d',UndecOS}} = EncMsg1_1,
{ok,true} = M:decode_part('SeqChoice_c_b', UndecBool),
{ok,<<"abc">>} = M:decode_part('SeqChoice_d', UndecOS),

ok.

test_PartialDecSeq3() ->
Expand Down

0 comments on commit 981e0ec

Please sign in to comment.