aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/test
diff options
context:
space:
mode:
authorKenneth Lundin <[email protected]>2012-03-23 12:21:03 +0100
committerKenneth Lundin <[email protected]>2012-03-27 09:13:26 +0200
commita24997ac5526cb7cbb5f3248aaa4abd403bf406a (patch)
treeffdd3c5ce82996ae8d807cd308c6fe57e38b9cf2 /lib/asn1/test
parent1bc4f4c35876a8dcccad66129e68f602751f6e36 (diff)
downloadotp-a24997ac5526cb7cbb5f3248aaa4abd403bf406a.tar.gz
otp-a24997ac5526cb7cbb5f3248aaa4abd403bf406a.tar.bz2
otp-a24997ac5526cb7cbb5f3248aaa4abd403bf406a.zip
Correct handling of INTEGER (1..4 | 8 | 10 | 20)
Diffstat (limited to 'lib/asn1/test')
-rw-r--r--lib/asn1/test/asn1_SUITE_data/Constraints.py1
-rw-r--r--lib/asn1/test/testConstraints.erl19
2 files changed, 15 insertions, 5 deletions
diff --git a/lib/asn1/test/asn1_SUITE_data/Constraints.py b/lib/asn1/test/asn1_SUITE_data/Constraints.py
index b18c29bd89..de48c4c2ca 100644
--- a/lib/asn1/test/asn1_SUITE_data/Constraints.py
+++ b/lib/asn1/test/asn1_SUITE_data/Constraints.py
@@ -51,6 +51,7 @@ Thing ::= INTEGER {fred (0),fred2 (1),fred3 (2)}
AnotherThing ::= Thing (fred | fred2)
I ::= INTEGER (0|15..269) -- OTP-5457
+X1 ::= INTEGER (1..4 | 8 | 10 | 20) -- OTP-9946
-- OTP-5511
diff --git a/lib/asn1/test/testConstraints.erl b/lib/asn1/test/testConstraints.erl
index cb15a24359..1ce68ec522 100644
--- a/lib/asn1/test/testConstraints.erl
+++ b/lib/asn1/test/testConstraints.erl
@@ -127,17 +127,26 @@ int_constraints(Rules) ->
?line {ok,0} = asn1_wrapper:decode('Constraints','I',Bytes12),
?line {ok,Bytes13} = asn1_wrapper:encode('Constraints','I',20),
?line {ok,20} = asn1_wrapper:decode('Constraints','I',Bytes13),
-
+
+ %%==========================================================
+ %% Constraint Combinations (Duboisson p. 285)
+ %% X1 ::= INTEGER (1..4|8|10|20)
+ %%==========================================================
+
+ ?line {ok,Bytes14} = asn1_wrapper:encode('Constraints','X1',1),
+ ?line {ok,1} = asn1_wrapper:decode('Constraints','X1',Bytes14),
+ ?line {ok,Bytes15} = asn1_wrapper:encode('Constraints','X1',20),
+ ?line {ok,20} = asn1_wrapper:decode('Constraints','X1',Bytes15),
%%==========================================================
%% SIZE Constraint (Duboisson p. 268)
%% T ::= IA5String (SIZE (1|2, ..., SIZE (1|2|3)))
%% T2 ::= IA5String (SIZE (1|2, ..., 3))
%%==========================================================
- ?line {ok,Bytes14} = asn1_wrapper:encode('Constraints','T',"IA"),
- ?line {ok,"IA"} = asn1_wrapper:decode('Constraints','T',Bytes14),
- ?line {ok,Bytes15} = asn1_wrapper:encode('Constraints','T2',"IA"),
- ?line {ok,"IA"} = asn1_wrapper:decode('Constraints','T2',Bytes15).
+ ?line {ok,Bytes16} = asn1_wrapper:encode('Constraints','T',"IA"),
+ ?line {ok,"IA"} = asn1_wrapper:decode('Constraints','T',Bytes16),
+ ?line {ok,Bytes17} = asn1_wrapper:encode('Constraints','T2',"IA"),
+ ?line {ok,"IA"} = asn1_wrapper:decode('Constraints','T2',Bytes17).
refed_NNL_name(_Erule) ->