diff options
Diffstat (limited to 'lib/asn1/test/testInfObj.erl')
-rw-r--r-- | lib/asn1/test/testInfObj.erl | 44 |
1 files changed, 39 insertions, 5 deletions
diff --git a/lib/asn1/test/testInfObj.erl b/lib/asn1/test/testInfObj.erl index cd335e1023..37c134b1b9 100644 --- a/lib/asn1/test/testInfObj.erl +++ b/lib/asn1/test/testInfObj.erl @@ -49,7 +49,7 @@ main(_Erule) -> roundtrip('RANAPextract1', 'InitiatingMessage2', Val3), roundtrip('InfObj', 'MyPdu', {'MyPdu',42,12,false,"string"}), - roundtrip('InfObj', 'MyPdu', {'MyPdu',{'Seq',1023,"hello"}, + roundtrip('InfObj', 'MyPdu', {'MyPdu',{'Seq',1023,<<"hello">>}, 42,true,"longer string"}), roundtrip('InfObj', 'MyPdu', {'MyPdu',"75712346",43,true,"string"}), @@ -110,15 +110,49 @@ main(_Erule) -> enc_dec('InfObj', 'DefaultInSeq', {'DefaultInSeq',3,asn1_DEFAULT}), roundtrip('InfObj', 'Multiple-Optionals', - {'Multiple-Optionals',1,42,true,"abc"}), + {'Multiple-Optionals',1,42,true,<<"abc">>}), roundtrip('InfObj', 'Multiple-Optionals', - {'Multiple-Optionals',1,asn1_NOVALUE,true,"abc"}), + {'Multiple-Optionals',1,asn1_NOVALUE,true,<<"abc">>}), roundtrip('InfObj', 'Multiple-Optionals', - {'Multiple-Optionals',1,42,asn1_NOVALUE,"abc"}), + {'Multiple-Optionals',1,42,asn1_NOVALUE,<<"abc">>}), roundtrip('InfObj', 'Multiple-Optionals', {'Multiple-Optionals',1,42,true,asn1_NOVALUE}), roundtrip('InfObj', 'Multiple-Optionals', - {'Multiple-Optionals',1,asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE}). + {'Multiple-Optionals',1,asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE}), + + test_objset('OstSeq12', [1,2]), + test_objset('OstSeq123', [1,2,3]), + test_objset('OstSeq1234', [1,2,3,4]), + test_objset('OstSeq45', [4,5]), + test_objset('OstSeq12345', [1,2,3,4,5]), + + test_objset('ExOstSeq12', [1,2]), + test_objset('ExOstSeq123', [1,2,3]), + %%test_objset('ExOstSeq1234', [1,2,3,4]), + test_objset('ExOstSeq45', [4,5]), + test_objset('ExOstSeq12345', [1,2,3,4,5]), + + ok. + +test_objset(Type, Keys) -> + _ = [test_object(Type, Key) || Key <- Keys], + _ = [(catch test_object(Type, Key)) || + Key <- lists:seq(1, 5) -- Keys], + ok. + +test_object(T, 1) -> + roundtrip('InfObj', T, {T,1,<<42:7>>}); +test_object(T, 2) -> + roundtrip('InfObj', T, {T,2,<<"abc">>}); +test_object(T, 3) -> + roundtrip('InfObj', T, {T,3,donald}), + roundtrip('InfObj', T, {T,3,scrooge}); +test_object(T, 4) -> + roundtrip('InfObj', T, {T,4,true}), + roundtrip('InfObj', T, {T,4,false}); +test_object(T, 5) -> + roundtrip('InfObj', T, {T,5,0}), + roundtrip('InfObj', T, {T,5,15}). roundtrip(M, T, V) -> asn1_test_lib:roundtrip(M, T, V). |