aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLev Walkin <vlm@lionet.info>2004-08-18 04:54:10 +0000
committerLev Walkin <vlm@lionet.info>2004-08-18 04:54:10 +0000
commitb2664669bebb17197410e0d1294a6efd5f179904 (patch)
tree4a59dcc7f87470b3ab531637dd269bc7d558a7e8
parentec1ffd475ef646d8d7690fc11a7dfdbcf0b21b0b (diff)
new files for testing subtype constraints support
-rw-r--r--tests/50-constraint-OK.asn142
-rw-r--r--tests/50-constraint-OK.asn1.-EFprint-constraintsbin0 -> 2967 bytes
-rw-r--r--tests/51-constraint-SE.asn116
-rw-r--r--tests/52-constraint-SE.asn116
-rw-r--r--tests/53-constraint-SE.asn116
-rw-r--r--tests/54-constraint-SE.asn117
6 files changed, 107 insertions, 0 deletions
diff --git a/tests/50-constraint-OK.asn1 b/tests/50-constraint-OK.asn1
new file mode 100644
index 00000000..27af95d1
--- /dev/null
+++ b/tests/50-constraint-OK.asn1
@@ -0,0 +1,42 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .50
+
+ModuleNestedConstraintsCheck
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 50 }
+ DEFINITIONS ::=
+BEGIN
+
+ Int1 ::= INTEGER
+ Int2 ::= Int1 (0..MAX) -- X.680-0207::41.4.4
+ Int3 ::= Int2 (MIN..ten) -- Means (0..10)
+ Int4 ::= Int3 (5..MAX,...,1..4) -- Means (5..10,...,1..4)
+ Int5 ::= Int4 (MIN..5) -- Means (5)
+
+ ten Int1 ::= other-ten
+ other-ten Int2 ::= 10
+
+ -- G.4.3.4
+ ExtensibleExtensions ::= INTEGER ((1..256,...) INTERSECTION (1..256))
+
+ Str1 ::= IA5String
+ Str2 ::= Str1 (SIZE(MIN..20 | 25..30))
+ -- Means (SIZE(0..20 | 25..30))
+ Str3 ::= Str2 (SIZE(10..27))(FROM("ABC"|"def"))
+ -- (SIZE(10..20,25..27))(FROM("ABCdef"))
+
+ PER-Visible ::= IA5String (FROM("A".."F"))
+ PER-Visible-2 ::= PER-Visible (FROM("E".."F")) -- Means (FROM("EF"))
+ -- The following maintain parent permitted alphabet constraint
+ Not-PER-Visible-1 ::= PER-Visible (FROM("AB") | SIZE(1..2))
+ Not-PER-Visible-2 ::= PER-Visible (FROM("AB",...))
+ Not-PER-Visible-3 ::= PER-Visible (FROM("AB"),...)
+ SIZE-but-not-FROM ::= PER-Visible (SIZE(1..4) ^ FROM("ABCD",...))
+ SIZE-and-FROM ::= PER-Visible (SIZE(1..4) ^ FROM("ABCD"))
+ Neither-SIZE-nor-FROM ::= PER-Visible (SIZE(1..4) | FROM("ABCD",...))
+
+END
diff --git a/tests/50-constraint-OK.asn1.-EFprint-constraints b/tests/50-constraint-OK.asn1.-EFprint-constraints
new file mode 100644
index 00000000..694f7766
--- /dev/null
+++ b/tests/50-constraint-OK.asn1.-EFprint-constraints
Binary files differ
diff --git a/tests/51-constraint-SE.asn1 b/tests/51-constraint-SE.asn1
new file mode 100644
index 00000000..d26a9bc8
--- /dev/null
+++ b/tests/51-constraint-SE.asn1
@@ -0,0 +1,16 @@
+
+-- SE: Semantic Error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .51
+
+ModuleInvalidConstraintApplicability1
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 51 }
+ DEFINITIONS ::=
+BEGIN
+
+ Int ::= INTEGER (FROM("abc"))
+
+END
diff --git a/tests/52-constraint-SE.asn1 b/tests/52-constraint-SE.asn1
new file mode 100644
index 00000000..c14c3af0
--- /dev/null
+++ b/tests/52-constraint-SE.asn1
@@ -0,0 +1,16 @@
+
+-- SE: Semantic Error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .52
+
+ModuleInvalidConstraintApplicability1
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 52 }
+ DEFINITIONS ::=
+BEGIN
+
+ Int ::= INTEGER (SIZE(0..4))
+
+END
diff --git a/tests/53-constraint-SE.asn1 b/tests/53-constraint-SE.asn1
new file mode 100644
index 00000000..30f34f74
--- /dev/null
+++ b/tests/53-constraint-SE.asn1
@@ -0,0 +1,16 @@
+
+-- SE: Semantic Error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .53
+
+ModuleInvalidConstraintApplicability1
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 53 }
+ DEFINITIONS ::=
+BEGIN
+
+ Int ::= INTEGER (1..32) (MIN..63)
+
+END
diff --git a/tests/54-constraint-SE.asn1 b/tests/54-constraint-SE.asn1
new file mode 100644
index 00000000..f732736a
--- /dev/null
+++ b/tests/54-constraint-SE.asn1
@@ -0,0 +1,17 @@
+
+-- SE: Semantic Error
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .54
+
+ModuleInvalidConstraintApplicability1
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 54 }
+ DEFINITIONS ::=
+BEGIN
+
+ StrFine ::= NumericString (FROM(" ".."9")) -- That's fine
+ StrBad ::= NumericString (FROM("0".."9" | "#")) -- That's bad
+
+END