aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2013-05-31 12:44:03 +0200
committerBjörn Gustavsson <[email protected]>2013-06-03 11:39:21 +0200
commit9be1fbb32ef0bbdf99c7c39fac4a845606156a23 (patch)
tree9e0932c5784b4703ddbfe63deba22bce22def553
parent8cd10fdc48a6d2cc61d4143767206ad08ef27539 (diff)
downloadotp-9be1fbb32ef0bbdf99c7c39fac4a845606156a23.tar.gz
otp-9be1fbb32ef0bbdf99c7c39fac4a845606156a23.tar.bz2
otp-9be1fbb32ef0bbdf99c7c39fac4a845606156a23.zip
testSeqOf: Test constrained, extensible sizes
-rw-r--r--lib/asn1/test/asn1_SUITE_data/SeqOf.asn19
-rw-r--r--lib/asn1/test/testSeqOf.erl23
2 files changed, 32 insertions, 0 deletions
diff --git a/lib/asn1/test/asn1_SUITE_data/SeqOf.asn1 b/lib/asn1/test/asn1_SUITE_data/SeqOf.asn1
index 330944cf5c..888dbe5dd7 100644
--- a/lib/asn1/test/asn1_SUITE_data/SeqOf.asn1
+++ b/lib/asn1/test/asn1_SUITE_data/SeqOf.asn1
@@ -62,4 +62,13 @@ Empty ::= SEQUENCE
{
}
+SeqExt ::= SEQUENCE
+{
+ b1 BOOLEAN,
+ s1 SEQUENCE SIZE (1..3, ...) OF SeqIn,
+ b2 BOOLEAN,
+ s2 SEQUENCE SIZE (0..1024, ...) OF SeqIn,
+ magic INTEGER
+}
+
END
diff --git a/lib/asn1/test/testSeqOf.erl b/lib/asn1/test/testSeqOf.erl
index 771045f9af..c1af0d7a32 100644
--- a/lib/asn1/test/testSeqOf.erl
+++ b/lib/asn1/test/testSeqOf.erl
@@ -86,6 +86,29 @@ main(_Rules) ->
roundtrip('SeqEmp', #'SeqEmp'{seq1=[#'Empty'{}]}),
+ %% Test constrained, extensible size.
+
+ SeqIn = #'SeqIn'{boolIn=true,intIn=978654321},
+ roundtrip('SeqExt', {'SeqExt',true,[],true,[],789}),
+ roundtrip('SeqExt', {'SeqExt',true,lists:duplicate(1, SeqIn),
+ true,lists:duplicate(0, SeqIn),777}),
+ roundtrip('SeqExt', {'SeqExt',true,lists:duplicate(1, SeqIn),
+ true,lists:duplicate(1, SeqIn),777}),
+ roundtrip('SeqExt', {'SeqExt',true,lists:duplicate(1, SeqIn),
+ true,lists:duplicate(127, SeqIn),777}),
+ roundtrip('SeqExt', {'SeqExt',true,lists:duplicate(2, SeqIn),
+ true,lists:duplicate(128, SeqIn),1777}),
+ roundtrip('SeqExt', {'SeqExt',true,lists:duplicate(2, SeqIn),
+ true,lists:duplicate(255, SeqIn),7773}),
+ roundtrip('SeqExt', {'SeqExt',true,lists:duplicate(2, SeqIn),
+ true,lists:duplicate(256, SeqIn),77755}),
+ roundtrip('SeqExt', {'SeqExt',true,lists:duplicate(2, SeqIn),
+ true,lists:duplicate(257, SeqIn),8888}),
+ roundtrip('SeqExt', {'SeqExt',true,lists:duplicate(3, SeqIn),
+ true,lists:duplicate(1024, SeqIn),999988888}),
+ roundtrip('SeqExt', {'SeqExt',true,lists:duplicate(15, SeqIn),
+ true,lists:duplicate(2000, SeqIn),555555}),
+
%% Test OTP-4590: correct encoding of the length of SEQUENC OF.
DayNames = ["Monday","Tuesday","Wednesday",
"Thursday","Friday","Saturday","Sunday"],