diff options
author | Kenneth Lundin <[email protected]> | 2010-09-01 15:09:31 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2010-09-07 15:54:01 +0200 |
commit | 210fbb984619e6a6bb1122b7a6f72f54fb72effb (patch) | |
tree | fa5964ff764fa94e6125f6e4ca63546821be1a1a /lib/asn1/test/asn1_SUITE_data | |
parent | 96db19557ac894cffcaa18e8f1191d387a5b05ea (diff) | |
download | otp-210fbb984619e6a6bb1122b7a6f72f54fb72effb.tar.gz otp-210fbb984619e6a6bb1122b7a6f72f54fb72effb.tar.bz2 otp-210fbb984619e6a6bb1122b7a6f72f54fb72effb.zip |
Add support for ExtensionAdditionGroup notation in nested types as well
In the previous version support for ExtensionAdditionGroups (i.e [[...]])
was added but it did not handle the occurence of the notation in nested types.
Now this is handled as well and the support is hopefully complete.
Also cleanup of warnings for obsolete guard functions in test suites.
Diffstat (limited to 'lib/asn1/test/asn1_SUITE_data')
-rw-r--r-- | lib/asn1/test/asn1_SUITE_data/Extension-Addition-Group.asn | 18 | ||||
-rw-r--r-- | lib/asn1/test/asn1_SUITE_data/extensionAdditionGroup.erl | 13 |
2 files changed, 30 insertions, 1 deletions
diff --git a/lib/asn1/test/asn1_SUITE_data/Extension-Addition-Group.asn b/lib/asn1/test/asn1_SUITE_data/Extension-Addition-Group.asn index b985c970ac..fc244c30a2 100644 --- a/lib/asn1/test/asn1_SUITE_data/Extension-Addition-Group.asn +++ b/lib/asn1/test/asn1_SUITE_data/Extension-Addition-Group.asn @@ -48,6 +48,7 @@ Ax ::= SEQUENCE { } -- valAx Ax ::= { a 253, b TRUE, c e: TRUE, g "123", h TRUE } + Ax2 ::= SEQUENCE { a INTEGER (250..253), b BOOLEAN, @@ -55,7 +56,6 @@ Ax2 ::= SEQUENCE { ug NumericString } -END -- The value { a 253, b TRUE, c e: TRUE, g "123", h TRUE } -- is encoded in PER as @@ -64,3 +64,19 @@ END -- is encoded in Unaligned PER as -- 9E000600 040A4690 + +Ax3 ::= SEQUENCE { + a INTEGER (250..253), + b BOOLEAN, + s SEQUENCE { + sa INTEGER, + sb BOOLEAN, + ..., + [[ + sextaddgroup INTEGER OPTIONAL + ]] + } +} + +-- { a 253, b TRUE, s {sa 17, sb TRUE, sextaddgroup 11}} +END diff --git a/lib/asn1/test/asn1_SUITE_data/extensionAdditionGroup.erl b/lib/asn1/test/asn1_SUITE_data/extensionAdditionGroup.erl index 79e200f561..c86c787610 100644 --- a/lib/asn1/test/asn1_SUITE_data/extensionAdditionGroup.erl +++ b/lib/asn1/test/asn1_SUITE_data/extensionAdditionGroup.erl @@ -41,3 +41,16 @@ run(Erule) -> Val -> ok; _ -> exit({expected,Val, got, Val2}) end. + +run2(Erule) -> + Val = #'Ax3'{a=253, b = true, s = #'Ax3_s'{sa = 11, sb = true, sextaddgroup = 17}}, + io:format("~p:~p~n",[Erule,Val]), + {ok,List}= asn1rt:encode('Extension-Addition-Group','Ax3',Val), + Enc = iolist_to_binary(List), + io:format("~p~n",[Enc]), + {ok,Val2} = asn1rt:decode('Extension-Addition-Group','Ax3',Enc), + io:format("~p~n",[Val2]), + case Val2 of + Val -> ok; + _ -> exit({expected,Val, got, Val2}) + end. |