diff options
author | Marcus Arendt <[email protected]> | 2014-11-26 12:04:27 +0100 |
---|---|---|
committer | Marcus Arendt <[email protected]> | 2014-11-26 12:04:27 +0100 |
commit | b830d31da35c36b57072c59eff0566f3bcd12b2d (patch) | |
tree | b1f480d97ae19934b3eb969626e36f262486bf26 | |
parent | d7993911d68e9919f67812e2eb6113e6a1a1c786 (diff) | |
parent | e3191ce95cd58db6cc7e207934938fb88d0c9eae (diff) | |
download | otp-b830d31da35c36b57072c59eff0566f3bcd12b2d.tar.gz otp-b830d31da35c36b57072c59eff0566f3bcd12b2d.tar.bz2 otp-b830d31da35c36b57072c59eff0566f3bcd12b2d.zip |
Merge branch 'maint'
-rw-r--r-- | lib/asn1/src/asn1ct_check.erl | 2 | ||||
-rw-r--r-- | lib/asn1/test/asn1_SUITE.erl | 16 | ||||
-rw-r--r-- | lib/asn1/test/asn1_SUITE_data/TAGDEFAULT-AUTOMATIC.asn | 25 |
3 files changed, 42 insertions, 1 deletions
diff --git a/lib/asn1/src/asn1ct_check.erl b/lib/asn1/src/asn1ct_check.erl index 5d8740b92e..45f1d3a8c9 100644 --- a/lib/asn1/src/asn1ct_check.erl +++ b/lib/asn1/src/asn1ct_check.erl @@ -6581,6 +6581,8 @@ merge_tags2([T1= #tag{type='IMPLICIT'}, T2 |Rest], Acc) -> merge_tags2([T1#tag{type=T2#tag.type, form=T2#tag.form}|Rest],Acc); merge_tags2([T1= #tag{type={default,'IMPLICIT'}}, T2 |Rest], Acc) -> merge_tags2([T1#tag{type=T2#tag.type, form=T2#tag.form}|Rest],Acc); +merge_tags2([T1= #tag{type={default,'AUTOMATIC'}}, T2 |Rest], Acc) -> + merge_tags2([T1#tag{type=T2#tag.type, form=T2#tag.form}|Rest],Acc); merge_tags2([H|T],Acc) -> merge_tags2(T, [H|Acc]); merge_tags2([], Acc) -> diff --git a/lib/asn1/test/asn1_SUITE.erl b/lib/asn1/test/asn1_SUITE.erl index 888339a4d2..432197eec0 100644 --- a/lib/asn1/test/asn1_SUITE.erl +++ b/lib/asn1/test/asn1_SUITE.erl @@ -60,7 +60,8 @@ groups() -> {ber, Parallel, [ber_choiceinseq, % Uses 'SOpttest' - ber_optional]}, + ber_optional, + tagdefault_automatic]}, {app_test, [], [{asn1_app_test, all}]}, @@ -659,6 +660,19 @@ ber_optional(Config, Rule, Opts) -> {'C', asn1_NOVALUE, 111, asn1_NOVALUE}}, asn1_test_lib:roundtrip('SOpttest', 'S', V). +tagdefault_automatic(Config) -> + test(Config, fun tagdefault_automatic/3, [ber]). +tagdefault_automatic(Config, Rule, Opts) -> + asn1_test_lib:compile("TAGDEFAULT-AUTOMATIC", Config, [Rule|Opts]), + << 48,8,128,2,100,101,129,2,110,111 >> = + asn1_test_lib:roundtrip_enc('TAGDEFAULT-AUTOMATIC', 'Tagged', {'Tagged', << 100,101 >>, << 110,111 >>}), + << 48,8,128,2,100,101,129,2,110,111 >> = + asn1_test_lib:roundtrip_enc('TAGDEFAULT-AUTOMATIC', 'Untagged', {'Untagged', << 100,101 >>, << 110,111 >>}), + << 48,8,4,2,100,101,130,2,110,111 >> = + asn1_test_lib:roundtrip_enc('TAGDEFAULT-AUTOMATIC', 'Mixed', {'Mixed', << 100,101 >>, << 110,111 >>}), + + ok. + %% records used by test-case default -record('Def1', {bool0, bool1 = asn1_DEFAULT, diff --git a/lib/asn1/test/asn1_SUITE_data/TAGDEFAULT-AUTOMATIC.asn b/lib/asn1/test/asn1_SUITE_data/TAGDEFAULT-AUTOMATIC.asn new file mode 100644 index 0000000000..2fcba1f71e --- /dev/null +++ b/lib/asn1/test/asn1_SUITE_data/TAGDEFAULT-AUTOMATIC.asn @@ -0,0 +1,25 @@ +TAGDEFAULT-AUTOMATIC DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +EXPORTS + Tagged, + Untagged, + Mixed +; + +Tagged ::= SEQUENCE { + o0 [0] OCTET STRING, + o1 [1] OCTET STRING +} + +Untagged ::= SEQUENCE { + o0 OCTET STRING, + o1 OCTET STRING +} + +Mixed ::= SEQUENCE { + o0 OCTET STRING, + o2 [2] OCTET STRING +} + +END |