diff options
author | Björn Gustavsson <[email protected]> | 2014-08-22 14:31:39 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2014-09-01 14:37:15 +0200 |
commit | f2491c28caea8244eab619321bc95832257bf146 (patch) | |
tree | 677737b2e260c86691edcef4a6e4a08884299b76 /lib/asn1/test/testInfObj.erl | |
parent | db3f8d752054d69285c318e39adb45cf4c85a3e7 (diff) | |
download | otp-f2491c28caea8244eab619321bc95832257bf146.tar.gz otp-f2491c28caea8244eab619321bc95832257bf146.tar.bz2 otp-f2491c28caea8244eab619321bc95832257bf146.zip |
Workaround for combining two object sets separated by extension
The following type of code would crash the compiler:
OSET SOME-CLASS ::= {OSET1, ..., OSET2}
Diffstat (limited to 'lib/asn1/test/testInfObj.erl')
-rw-r--r-- | lib/asn1/test/testInfObj.erl | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/lib/asn1/test/testInfObj.erl b/lib/asn1/test/testInfObj.erl index 311595cfda..37c134b1b9 100644 --- a/lib/asn1/test/testInfObj.erl +++ b/lib/asn1/test/testInfObj.erl @@ -118,7 +118,41 @@ main(_Erule) -> 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). |