aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/test/testConstraints.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2013-11-20 12:42:31 +0100
committerBjörn Gustavsson <[email protected]>2013-11-20 12:42:31 +0100
commit7d2867c58b5a8232284e3b168a5f17822bd51283 (patch)
tree9b1de696406d609030bc20893480f86c6c929675 /lib/asn1/test/testConstraints.erl
parentd000febfc34375748494fe64ad25f0bd42fdc3f8 (diff)
parentcf9d62c7c902b06dc589382a0a853b87b0a1ce20 (diff)
downloadotp-7d2867c58b5a8232284e3b168a5f17822bd51283.tar.gz
otp-7d2867c58b5a8232284e3b168a5f17822bd51283.tar.bz2
otp-7d2867c58b5a8232284e3b168a5f17822bd51283.zip
Merge branch 'maint'
* maint: Fix complicated union of INTEGER constraints
Diffstat (limited to 'lib/asn1/test/testConstraints.erl')
-rw-r--r--lib/asn1/test/testConstraints.erl18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/asn1/test/testConstraints.erl b/lib/asn1/test/testConstraints.erl
index 34fbbcf6cc..23322f5e88 100644
--- a/lib/asn1/test/testConstraints.erl
+++ b/lib/asn1/test/testConstraints.erl
@@ -218,6 +218,15 @@ int_constraints(Rules) ->
roundtrip('ShorterExt', "abcde"),
roundtrip('ShorterExt', "abcdef"),
+ %%==========================================================
+ %% Unions of INTEGER constraints
+ %%==========================================================
+ seq_roundtrip(Rules, 'SeqOverlapping', 'SeqNonOverlapping', 7580),
+ seq_roundtrip(Rules, 'SeqOverlapping', 'SeqNonOverlapping', 9600),
+ seq_roundtrip(Rules, 'SeqOverlapping', 'SeqNonOverlapping', 18050),
+ seq_roundtrip(Rules, 'SeqOverlapping', 'SeqNonOverlapping', 19000),
+ seq_roundtrip(Rules, 'SeqOverlapping', 'SeqNonOverlapping', 26900),
+
ok.
%% PER: Ensure that if the lower bound is Lb, Lb+16#80 is encoded
@@ -297,3 +306,12 @@ range_error(Per, Type, Value) when Per =:= per; Per =:= uper ->
%% on encode.
{error,_} = 'Constraints':encode(Type, Value),
ok.
+
+seq_roundtrip(Rules, Seq1, Seq2, Val) ->
+ Enc = roundtrip(Seq1, {Seq1,Val}),
+ case Rules of
+ ber ->
+ roundtrip(Seq2, {Seq2,Val});
+ _ ->
+ roundtrip_enc(Seq2, {Seq2,Val}, Enc)
+ end.