diff options
Diffstat (limited to 'lib/asn1/test/testSeqTypeRefSeq.erl')
-rw-r--r-- | lib/asn1/test/testSeqTypeRefSeq.erl | 166 |
1 files changed, 38 insertions, 128 deletions
diff --git a/lib/asn1/test/testSeqTypeRefSeq.erl b/lib/asn1/test/testSeqTypeRefSeq.erl index 57ec6c19b1..fc2e0a67c9 100644 --- a/lib/asn1/test/testSeqTypeRefSeq.erl +++ b/lib/asn1/test/testSeqTypeRefSeq.erl @@ -44,133 +44,43 @@ -record('SeqSeqExp',{seqInt, seqOs}). - main(_Rules) -> - - - ?line {ok,Bytes11} = - asn1_wrapper:encode('SeqTypeRefSeq','Seq1',#'Seq1'{bool1 = true, - int1 = 15, - seq1 = #'SeqIn'{boolIn = true, - intIn = 66}}), - ?line {ok,{'Seq1',true,15,{'SeqIn',true,66}}} = - asn1_wrapper:decode('SeqTypeRefSeq','Seq1',lists:flatten(Bytes11)), - - - - ?line {ok,Bytes12} = - asn1_wrapper:encode('SeqTypeRefSeq','Seq2',#'Seq2'{seq2 = #'SeqIn'{boolIn = true, - intIn = 66}, - bool2 = true, - int2 = 15}), - ?line {ok,{'Seq2',{'SeqIn',true,66},true,15}} = - asn1_wrapper:decode('SeqTypeRefSeq','Seq2',lists:flatten(Bytes12)), - - - ?line {ok,Bytes13} = - asn1_wrapper:encode('SeqTypeRefSeq','Seq3',#'Seq3'{bool3 = true, - seq3 = #'SeqIn'{boolIn = true, - intIn = 66}, - int3 = 15}), - ?line {ok,{'Seq3',true,{'SeqIn',true,66},15}} = - asn1_wrapper:decode('SeqTypeRefSeq','Seq3',lists:flatten(Bytes13)), - - - - ?line {ok,Bytes14} = - asn1_wrapper:encode('SeqTypeRefSeq','Seq4',#'Seq4'{seq41 = #'SeqIn'{boolIn = true, - intIn = 66}, - seq42 = #'SeqIn'{boolIn = true, - intIn = 66}, - seq43 = #'SeqIn'{boolIn = true, - intIn = 66}}), - ?line {ok,{'Seq4',{'SeqIn',true,66},{'SeqIn',true,66},{'SeqIn',true,66}}} = - asn1_wrapper:decode('SeqTypeRefSeq','Seq4',lists:flatten(Bytes14)), - - - - - - - - - ?line {ok,Bytes21} = - asn1_wrapper:encode('SeqTypeRefSeq','SeqS1',#'SeqS1'{boolS1 = true, - intS1 = 15, - seqS1 = #'SeqS1_seqS1'{boolIn = true, - intIn = 66}}), - ?line {ok,{'SeqS1',true,15,{'SeqS1_seqS1',true,66}}} = - asn1_wrapper:decode('SeqTypeRefSeq','SeqS1',lists:flatten(Bytes21)), - - - ?line {ok,Bytes22} = - asn1_wrapper:encode('SeqTypeRefSeq','SeqS2',#'SeqS2'{seqS2 = #'SeqS2_seqS2'{boolIn = true, - intIn = 66}, - boolS2 = true, - intS2 = 15}), - ?line {ok,{'SeqS2',{'SeqS2_seqS2',true,66},true,15}} = - asn1_wrapper:decode('SeqTypeRefSeq','SeqS2',lists:flatten(Bytes22)), - - - - ?line {ok,Bytes23} = - asn1_wrapper:encode('SeqTypeRefSeq','SeqS3',#'SeqS3'{boolS3 = true, - seqS3 = #'SeqS3_seqS3'{boolIn = true, - intIn = 66}, - intS3 = 15}), - ?line {ok,{'SeqS3',true,{'SeqS3_seqS3',true,66},15}} = - asn1_wrapper:decode('SeqTypeRefSeq','SeqS3',lists:flatten(Bytes23)), - - - - - - - ?line {ok,Bytes31} = - asn1_wrapper:encode('SeqTypeRefSeq','SeqSTag',#'SeqSTag'{seqS1 = #'SeqSTag_seqS1'{b1 = true, - i1 = 11}, - seqS2 = #'SeqSTag_seqS2'{b2 = true, - i2 = 22}, - seqS3 = #'SeqSTag_seqS3'{b3 = true, - i3 = 33}}), - ?line {ok,{'SeqSTag',{'SeqSTag_seqS1',true,11}, - {'SeqSTag_seqS2',true,22}, - {'SeqSTag_seqS3',true,33}}} = - asn1_wrapper:decode('SeqTypeRefSeq','SeqSTag',lists:flatten(Bytes31)), - - - - - - ?line {ok,Bytes41} = - asn1_wrapper:encode('SeqTypeRefSeq','SeqTRseq', - #'SeqTRseq'{'seqSeq' = #'SeqSeq'{seqOs = "A1", - seqInt = 2}, - 'seqSeqI' = #'SeqSeq'{seqOs = "A2", - seqInt = 2}, - 'seqSeqE' = #'SeqSeq'{seqOs = "A3", - seqInt = 2}, - 'seqSeq-I' = #'SeqSeqImp'{seqOs = "A4", - seqInt = 2}, - 'seqSeqI-I' = #'SeqSeqImp'{seqOs = "A5", - seqInt = 2}, - 'seqSeqE-I' = #'SeqSeqImp'{seqOs = "A6", - seqInt = 2}, - 'seqSeq-E' = #'SeqSeqExp'{seqOs = "A7", - seqInt = 2}, - 'seqSeqI-E' = #'SeqSeqExp'{seqOs = "A8", - seqInt = 2}, - 'seqSeqE-E' = #'SeqSeqExp'{seqOs = "A9", - seqInt = 2}}), - ?line {ok,{'SeqTRseq',{'SeqSeq',2,"A1"}, - {'SeqSeq',2,"A2"}, - {'SeqSeq',2,"A3"}, - {'SeqSeqImp',2,"A4"}, - {'SeqSeqImp',2,"A5"}, - {'SeqSeqImp',2,"A6"}, - {'SeqSeqExp',2,"A7"}, - {'SeqSeqExp',2,"A8"}, - {'SeqSeqExp',2,"A9"}}} = - asn1_wrapper:decode('SeqTypeRefSeq','SeqTRseq',lists:flatten(Bytes41)), - + roundtrip('Seq1', + #'Seq1'{bool1=true,int1=15, + seq1=#'SeqIn'{boolIn=true,intIn=66}}), + roundtrip('Seq2', + #'Seq2'{seq2=#'SeqIn'{boolIn=true,intIn=66}, + bool2=true,int2=15}), + roundtrip('Seq3', + #'Seq3'{bool3=true,seq3=#'SeqIn'{boolIn=true,intIn=66},int3=15}), + roundtrip('Seq4', + #'Seq4'{seq41=#'SeqIn'{boolIn=true,intIn=66}, + seq42=#'SeqIn'{boolIn=true,intIn=66}, + seq43=#'SeqIn'{boolIn=true,intIn=66}}), + roundtrip('SeqS1', + #'SeqS1'{boolS1=true,intS1=15, + seqS1=#'SeqS1_seqS1'{boolIn=true,intIn=66}}), + roundtrip('SeqS2', + #'SeqS2'{seqS2=#'SeqS2_seqS2'{boolIn=true,intIn=66}, + boolS2=true,intS2=15}), + roundtrip('SeqS3', + #'SeqS3'{boolS3=true,seqS3=#'SeqS3_seqS3'{boolIn=true,intIn=66}, + intS3=15}), + roundtrip('SeqSTag', + #'SeqSTag'{seqS1=#'SeqSTag_seqS1'{b1=true,i1=11}, + seqS2=#'SeqSTag_seqS2'{b2=true,i2=22}, + seqS3=#'SeqSTag_seqS3'{b3=true,i3=33}}), + roundtrip('SeqTRseq', + #'SeqTRseq'{seqSeq=#'SeqSeq'{seqInt=2,seqOs="A1"}, + seqSeqI=#'SeqSeq'{seqInt=2,seqOs="A2"}, + seqSeqE=#'SeqSeq'{seqInt=2,seqOs="A3"}, + 'seqSeq-I'=#'SeqSeqImp'{seqInt=2,seqOs="A4"}, + 'seqSeqI-I'=#'SeqSeqImp'{seqInt=2,seqOs="A5"}, + 'seqSeqE-I'=#'SeqSeqImp'{seqInt=2,seqOs="A6"}, + 'seqSeq-E'=#'SeqSeqExp'{seqInt=2,seqOs="A7"}, + 'seqSeqI-E'=#'SeqSeqExp'{seqInt=2,seqOs="A8"}, + 'seqSeqE-E'=#'SeqSeqExp'{seqInt=2,seqOs="A9"}}), ok. + +roundtrip(T, V) -> + asn1_test_lib:roundtrip('SeqTypeRefSeq', T, V). |