aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/test/testSeqOfCho.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/asn1/test/testSeqOfCho.erl')
-rw-r--r--lib/asn1/test/testSeqOfCho.erl150
1 files changed, 39 insertions, 111 deletions
diff --git a/lib/asn1/test/testSeqOfCho.erl b/lib/asn1/test/testSeqOfCho.erl
index 5b83c8bf21..f749845bb9 100644
--- a/lib/asn1/test/testSeqOfCho.erl
+++ b/lib/asn1/test/testSeqOfCho.erl
@@ -31,117 +31,45 @@
-record('SeqOfChoEmbOpt_SEQOF',{bool1, int1, seq1 = asn1_NOVALUE}).
main(_Rules) ->
-
- ?line {ok,Bytes11} =
- asn1_wrapper:encode('SeqOfCho','SeqChoDef',#'SeqChoDef'{bool1 = true,
- int1 = 17}),
- ?line {ok,{'SeqChoDef',true,17,[]}} =
- asn1_wrapper:decode('SeqOfCho','SeqChoDef',lists:flatten(Bytes11)),
-
-
- ?line {ok,Bytes12} =
- asn1_wrapper:encode('SeqOfCho','SeqChoDef',#'SeqChoDef'{bool1 = true,
- int1 = 17,
- seq1 = [{boolIn,true},
- {intIn,25}]}),
- ?line {ok,{'SeqChoDef',true,17,[{boolIn,true},{intIn,25}]}} =
- asn1_wrapper:decode('SeqOfCho','SeqChoDef',lists:flatten(Bytes12)),
-
-
-
- ?line {ok,Bytes15} =
- asn1_wrapper:encode('SeqOfCho','SeqChoOpt',#'SeqChoOpt'{bool1 = true,
- int1 = 17}),
- ?line {ok,{'SeqChoOpt',true,17,asn1_NOVALUE}} =
- asn1_wrapper:decode('SeqOfCho','SeqChoOpt',lists:flatten(Bytes15)),
-
-
- ?line {ok,Bytes16} =
- asn1_wrapper:encode('SeqOfCho','SeqChoOpt',#'SeqChoOpt'{bool1 = true,
- int1 = 17,
- seq1 = [{boolIn,true},
- {intIn,25}]}),
- ?line {ok,{'SeqChoOpt',true,17,[{boolIn,true},{intIn,25}]}} =
- asn1_wrapper:decode('SeqOfCho','SeqChoOpt',lists:flatten(Bytes16)),
-
-
-
-
-
- ?line {ok,Bytes21} =
- asn1_wrapper:encode('SeqOfCho','SeqChoEmbDef',#'SeqChoEmbDef'{bool1 = true,
- int1 = 17}),
- ?line {ok,{'SeqChoEmbDef',true,17,[]}} =
- asn1_wrapper:decode('SeqOfCho','SeqChoEmbDef',lists:flatten(Bytes21)),
-
-
- ?line {ok,Bytes22} =
- asn1_wrapper:encode('SeqOfCho','SeqChoEmbDef',#'SeqChoEmbDef'{bool1 = true,
- int1 = 17,
- seq1 = [{boolIn,true},
- {intIn,25}]}),
- ?line {ok,{'SeqChoEmbDef',true,17,[{boolIn,true},{intIn,25}]}} =
- asn1_wrapper:decode('SeqOfCho','SeqChoEmbDef',lists:flatten(Bytes22)),
-
-
-
- ?line {ok,Bytes25} =
- asn1_wrapper:encode('SeqOfCho','SeqChoEmbOpt',#'SeqChoEmbOpt'{bool1 = true,
- int1 = 17}),
- ?line {ok,{'SeqChoEmbOpt',true,17,asn1_NOVALUE}} =
- asn1_wrapper:decode('SeqOfCho','SeqChoEmbOpt',lists:flatten(Bytes25)),
-
-
- ?line {ok,Bytes26} =
- asn1_wrapper:encode('SeqOfCho','SeqChoEmbOpt',#'SeqChoEmbOpt'{bool1 = true,
- int1 = 17,
- seq1 = [{boolIn,true},
- {intIn,25}]}),
- ?line {ok,{'SeqChoEmbOpt',true,17,[{boolIn,true},{intIn,25}]}} =
- asn1_wrapper:decode('SeqOfCho','SeqChoEmbOpt',lists:flatten(Bytes26)),
-
-
-
-
-
-
- ?line {ok,Bytes31} =
- asn1_wrapper:encode('SeqOfCho','SeqOfChoEmbDef',[#'SeqOfChoEmbDef_SEQOF'{bool1 = true,
- int1 = 17}]),
- ?line {ok,[{'SeqOfChoEmbDef_SEQOF',true,17,[]}]} =
- asn1_wrapper:decode('SeqOfCho','SeqOfChoEmbDef',lists:flatten(Bytes31)),
-
-
- ?line {ok,Bytes32} =
- asn1_wrapper:encode('SeqOfCho','SeqOfChoEmbDef',
- [#'SeqOfChoEmbDef_SEQOF'{bool1 = true,
- int1 = 17,
- seq1 = [{boolIn,true},
- {intIn,25}]}]),
- ?line {ok,[{'SeqOfChoEmbDef_SEQOF',true,17,[{boolIn,true},{intIn,25}]}]} =
- asn1_wrapper:decode('SeqOfCho','SeqOfChoEmbDef',lists:flatten(Bytes32)),
-
-
-
- ?line {ok,Bytes35} =
- asn1_wrapper:encode('SeqOfCho','SeqOfChoEmbOpt',[#'SeqOfChoEmbOpt_SEQOF'{bool1 = true,
- int1 = 17}]),
- ?line {ok,[{'SeqOfChoEmbOpt_SEQOF',true,17,asn1_NOVALUE}]} =
- asn1_wrapper:decode('SeqOfCho','SeqOfChoEmbOpt',lists:flatten(Bytes35)),
-
-
- ?line {ok,Bytes36} =
- asn1_wrapper:encode('SeqOfCho','SeqOfChoEmbOpt',
- [#'SeqOfChoEmbOpt_SEQOF'{bool1 = true,
- int1 = 17,
- seq1 = [{boolIn,true},
- {intIn,25}]}]),
- ?line {ok,[{'SeqOfChoEmbOpt_SEQOF',true,17,[{boolIn,true},{intIn,25}]}]} =
- asn1_wrapper:decode('SeqOfCho','SeqOfChoEmbOpt',lists:flatten(Bytes36)),
-
-
-
-
+ roundtrip('SeqChoDef',
+ #'SeqChoDef'{bool1=true,int1=17,seq1=asn1_DEFAULT},
+ #'SeqChoDef'{bool1=true,int1=17,seq1=[]}),
+ roundtrip('SeqChoDef',
+ #'SeqChoDef'{bool1=true,int1=17,
+ seq1=[{boolIn,true},{intIn,25}]}),
+ roundtrip('SeqChoOpt',
+ #'SeqChoOpt'{bool1=true,int1=17,seq1=asn1_NOVALUE}),
+ roundtrip('SeqChoOpt',
+ #'SeqChoOpt'{bool1=true,int1=17,
+ seq1=[{boolIn,true},{intIn,25}]}),
+
+ roundtrip('SeqChoEmbDef',
+ #'SeqChoEmbDef'{bool1=true,int1=17,seq1=asn1_DEFAULT},
+ #'SeqChoEmbDef'{bool1=true,int1=17,seq1=[]}),
+ roundtrip('SeqChoEmbDef',
+ #'SeqChoEmbDef'{bool1=true,int1=17,
+ seq1=[{boolIn,true},{intIn,25}]}),
+ roundtrip('SeqChoEmbOpt',
+ #'SeqChoEmbOpt'{bool1=true,int1=17,seq1=asn1_NOVALUE}),
+ roundtrip('SeqChoEmbOpt',
+ #'SeqChoEmbOpt'{bool1=true,int1=17,
+ seq1=[{boolIn,true},{intIn,25}]}),
+
+ roundtrip('SeqOfChoEmbDef',
+ [#'SeqOfChoEmbDef_SEQOF'{bool1=true,int1=17,seq1=asn1_DEFAULT}],
+ [#'SeqOfChoEmbDef_SEQOF'{bool1=true,int1=17,seq1=[]}]),
+ roundtrip('SeqOfChoEmbDef',
+ [#'SeqOfChoEmbDef_SEQOF'{bool1=true,int1=17,
+ seq1=[{boolIn,true},{intIn,25}]}]),
+ roundtrip('SeqOfChoEmbOpt',
+ [#'SeqOfChoEmbOpt_SEQOF'{bool1=true,int1=17,seq1=asn1_NOVALUE}]),
+ roundtrip('SeqOfChoEmbOpt',
+ [#'SeqOfChoEmbOpt_SEQOF'{bool1=true,int1=17,
+ seq1=[{boolIn,true},{intIn,25}]}]),
ok.
+roundtrip(Type, Value) ->
+ roundtrip(Type, Value, Value).
+roundtrip(Type, Value, ExpectedValue) ->
+ asn1_test_lib:roundtrip('SeqOfCho', Type, Value, ExpectedValue).