fix UPER decoding of large [bit-]strings of size a multiple of 16K
diff --git a/tests/tests-randomized/bundles/03-BIT-STRING-bundle.txt b/tests/tests-randomized/bundles/03-BIT-STRING-bundle.txt
index 2835b3c..f2d253e 100644
--- a/tests/tests-randomized/bundles/03-BIT-STRING-bundle.txt
+++ b/tests/tests-randomized/bundles/03-BIT-STRING-bundle.txt
@@ -17,3 +17,9 @@
T ::= BIT STRING { foo(2147483648), baz(2147483647) } (SIZE(31,...))
T ::= BIT STRING { foo(2147483648), baz(2147483647) } (SIZE(0..32))
T ::= BIT STRING { foo(2147483648), baz(2147483647) } (SIZE(0..31,...))
+T ::= BIT STRING { foo(0) } (SIZE(65535)) -- RMAX=65540
+T ::= BIT STRING { foo(0) } (SIZE(65536)) -- RMAX=65540
+T ::= BIT STRING { foo(0) } (SIZE(65537)) -- RMAX=65540
+T ::= BIT STRING { foo(0) } (SIZE(65535,...)) -- RMAX=65540
+T ::= BIT STRING { foo(0) } (SIZE(65536,...)) -- RMAX=65540
+T ::= BIT STRING { foo(0) } (SIZE(65537,...)) -- RMAX=65540
diff --git a/tests/tests-randomized/bundles/04-VisibleString-bundle.txt b/tests/tests-randomized/bundles/04-VisibleString-bundle.txt
index ec03664..55a658b 100644
--- a/tests/tests-randomized/bundles/04-VisibleString-bundle.txt
+++ b/tests/tests-randomized/bundles/04-VisibleString-bundle.txt
@@ -16,11 +16,12 @@
T ::= VisibleString (SIZE(1..128))
T ::= VisibleString (SIZE(1..129))
T ::= VisibleString (SIZE(5) INTERSECTION FROM("A".."Z"))
-RMAX=64000 VisibleString (SIZE(64000)) -- Length is not encoded, #11.9.3.3
-RMAX=33000 T ::= VisibleString (SIZE(32000..32002))
-RMAX=33000 T ::= VisibleString (SIZE(32000..32002)) (FROM("A".."B"))
-RMAX=33000 T ::= VisibleString (SIZE(32000..32002,...)) (FROM("A".."B"))
-RMAX=65536 T ::= VisibleString (SIZE(65530..65535))
-RMAX=65536 T ::= VisibleString (SIZE(65530..65536))
T ::= VisibleString (SIZE(4..6) INTERSECTION (FROM("A".."B")))
T ::= VisibleString (SIZE(4..6,...) INTERSECTION (FROM("A".."B")))
+VisibleString (SIZE(64000)) -- RMAX=64000, #11.9.3.3
+T ::= VisibleString (SIZE(32000..32002)) -- RMAX=33000
+T ::= VisibleString (SIZE(32000..32002)) (FROM("A".."B")) -- RMAX=33000
+T ::= VisibleString (SIZE(32000..32002,...)) (FROM("A".."B")) -- RMAX=33000
+T ::= VisibleString (SIZE(65530..65535)) -- RMAX=65536
+T ::= VisibleString (SIZE(65530..65536)) -- RMAX=65536
+T ::= VisibleString (SIZE(65535..65550)) -- RMAX=66000
diff --git a/tests/tests-randomized/bundles/README b/tests/tests-randomized/bundles/README
index 29c1aab..e962eed 100644
--- a/tests/tests-randomized/bundles/README
+++ b/tests/tests-randomized/bundles/README
@@ -14,9 +14,9 @@
* By default, the random value generator attempts to generate values
limited to very roughly to around 128 bytes. If huge values are desired
- (perhaps due to large constraints), the RMAX=<size> prefix can be specified
- on a line:
+ (perhaps due to large constraints), the RMAX=<size> setting can be specified
+ in the ASN.1 comments:
- RMAX=64000 T ::= VisibleString (SIZE(64000))
+ T ::= VisibleString (SIZE(64000)) -- RMAX=64000
diff --git a/tests/tests-randomized/check-bundles.sh b/tests/tests-randomized/check-bundles.sh
index 12f6e89..5c8bd2e 100755
--- a/tests/tests-randomized/check-bundles.sh
+++ b/tests/tests-randomized/check-bundles.sh
@@ -148,12 +148,11 @@
local asn="$1"
shift
- # Create "INTEGER (1..2)" from "RMAX=5 T ::= INTEGER (1..2) -- Comment"
+ # Create "INTEGER (1..2)" from "T ::= INTEGER (1..2) -- RMAX=5"
local short_asn=$(echo "$asn" | sed -e 's/ *--.*//;s/RMAX=[^ ]* //;')
if [ $(echo "$short_asn" | grep -c "::=") = 1 ]; then
short_asn=$(echo "$short_asn" | sed -e 's/.*::= *//')
fi
- asn=$(echo "$asn" | sed -e 's/RMAX=[^ ]* //;')
test ! -f Makefile.am # Protection from accidental clobbering
echo "Test DEFINITIONS ::= BEGIN $asn" > test.asn1