test for constraints on primitive types being defined

git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@785 59561ff5-6e30-0410-9f3c-9617f08c8826
This commit is contained in:
vlm 2005-03-10 11:30:23 +00:00
parent e65d03cd7d
commit 434ba1cbfe
2 changed files with 58 additions and 0 deletions

View File

@ -0,0 +1,22 @@
-- OK: Everything is fine
-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
-- .spelio.software.asn1c.test (9363.1.5.1)
-- .74
ModuleTestIntegerAndEnumeratedConstraints
{ iso org(3) dod(6) internet (1) private(4) enterprise(1)
spelio(9363) software(1) asn1c(5) test(1) 74 }
DEFINITIONS ::=
BEGIN
-- Enumeration constrained by the second choice.
Enum ::= ENUMERATED { one, two } (two|one)
-- Integer constrained by the only choice.
Int ::= INTEGER { v1-0(123) } (v1-0)
EnumRef ::= Enum (two)
END

View File

@ -0,0 +1,36 @@
ModuleTestIntegerAndEnumeratedConstraints {iso org(3) dod(6) internet(1) private(4)
enterprise(1) spelio(9363) software(1) asn1c(5) test(1)
74 }
DEFINITIONS ::=
BEGIN
Enum ::= ENUMERATED {
one(0)
-- Practical constraints (one):
-- PER-visible constraints (one):
,
two(1)
-- Practical constraints (two):
-- PER-visible constraints (two):
} (1 | 0)
-- Combined constraints: (1 | 0)
-- Practical constraints (Enum): (0..1)
-- PER-visible constraints (Enum): (0..1)
Int ::= INTEGER {
v1-0(123)
-- Practical constraints (v1-0):
-- PER-visible constraints (v1-0):
} (123)
-- Combined constraints: (123)
-- Practical constraints (Int): (123)
-- PER-visible constraints (Int): (123)
EnumRef ::= Enum (1)
-- Combined constraints: (1 | 0)(1)
-- Practical constraints (Enum): (1)
-- PER-visible constraints (Enum): (1)
END