From 915d6453928c161e2ef7f87cd1435c08fd077bc7 Mon Sep 17 00:00:00 2001 From: vlm Date: Sun, 22 Aug 2004 03:06:30 +0000 Subject: [PATCH] COMPONENTS OF support testing git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@177 59561ff5-6e30-0410-9f3c-9617f08c8826 --- tests/55-components-of-OK.asn1 | 34 ++++++++++++++++++++++++++ tests/55-components-of-OK.asn1.-EF | 33 ++++++++++++++++++++++++++ tests/56-components-of-SE.asn1 | 20 ++++++++++++++++ tests/57-components-of-OK.asn1 | 38 ++++++++++++++++++++++++++++++ 4 files changed, 125 insertions(+) create mode 100644 tests/55-components-of-OK.asn1 create mode 100644 tests/55-components-of-OK.asn1.-EF create mode 100644 tests/56-components-of-SE.asn1 create mode 100644 tests/57-components-of-OK.asn1 diff --git a/tests/55-components-of-OK.asn1 b/tests/55-components-of-OK.asn1 new file mode 100644 index 00000000..54ecc1f8 --- /dev/null +++ b/tests/55-components-of-OK.asn1 @@ -0,0 +1,34 @@ + +-- OK: Everything is fine + +-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) +-- .spelio.software.asn1c.test (9363.1.5.1) +-- .55 + +ModuleTestComponentsOf + { iso org(3) dod(6) internet(1) private(4) enterprise(1) + spelio(9363) software(1) asn1c(5) test(1) 55 } + DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + + OneType ::= SEQUENCE { + one-1 INTEGER, + one-2 [1] BOOLEAN, + one-3 SEQUENCE { + alpha INTEGER, + beta INTEGER, + ... + }, + ..., + ignored-in-SecondType INTEGER, + ..., + one-4 INTEGER + } + + SecondType ::= SEQUENCE { + a IA5String, + COMPONENTS OF OneType, + b UniversalString + } + +END diff --git a/tests/55-components-of-OK.asn1.-EF b/tests/55-components-of-OK.asn1.-EF new file mode 100644 index 00000000..4d640d0a --- /dev/null +++ b/tests/55-components-of-OK.asn1.-EF @@ -0,0 +1,33 @@ + +ModuleTestComponentsOf {iso(-1) org(3) dod(6) internet(1) private(4) + enterprise(1) spelio(9363) software(1) asn1c(5) test(1) + 55 } +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +OneType ::= SEQUENCE { + one-1 INTEGER, + one-2 [1] EXPLICIT BOOLEAN, + one-3 SEQUENCE { + alpha [0] IMPLICIT INTEGER, + beta [1] IMPLICIT INTEGER, + ... + }, + one-4 INTEGER, + ..., + ignored-in-SecondType INTEGER +} + +SecondType ::= SEQUENCE { + a [0] IMPLICIT IA5String, + one-1 [1] IMPLICIT INTEGER, + one-2 [2] IMPLICIT BOOLEAN, + one-3 [3] IMPLICIT SEQUENCE { + alpha [0] IMPLICIT INTEGER, + beta [1] IMPLICIT INTEGER + }, + one-4 [4] IMPLICIT INTEGER, + b [5] IMPLICIT UniversalString +} + +END diff --git a/tests/56-components-of-SE.asn1 b/tests/56-components-of-SE.asn1 new file mode 100644 index 00000000..26e07575 --- /dev/null +++ b/tests/56-components-of-SE.asn1 @@ -0,0 +1,20 @@ + +-- SE: Semantic error + +-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) +-- .spelio.software.asn1c.test (9363.1.5.1) +-- .56 + +ModuleTestComponentsOfInvalidReference + { iso org(3) dod(6) internet(1) private(4) enterprise(1) + spelio(9363) software(1) asn1c(5) test(1) 56 } + DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + + OneType ::= SEQUENCE { + a IA5String, + COMPONENTS OF INTEGER, -- Error is here + b UniversalString + } + +END diff --git a/tests/57-components-of-OK.asn1 b/tests/57-components-of-OK.asn1 new file mode 100644 index 00000000..bb2c8bf7 --- /dev/null +++ b/tests/57-components-of-OK.asn1 @@ -0,0 +1,38 @@ + +-- OK: Everything is fine + +-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) +-- .spelio.software.asn1c.test (9363.1.5.1) +-- .57 + +ModuleTestComponentsOfCrossModule1 + { iso org(3) dod(6) internet(1) private(4) enterprise(1) + spelio(9363) software(1) asn1c(5) test(1) 57 1 } + DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + + SecondType ::= SEQUENCE { + a IA5String, + COMPONENTS OF ModuleTestComponentsOfCrossModule2.OneType, + b UniversalString + } + +END + +ModuleTestComponentsOfCrossModule2 + { iso org(3) dod(6) internet(1) private(4) enterprise(1) + spelio(9363) software(1) asn1c(5) test(1) 57 2 } + DEFINITIONS EXPLICIT TAGS ::= +BEGIN + + OneType ::= SEQUENCE { + x T1, + y T2, + z T3 + } + + T1 ::= INTEGER + T2 ::= INTEGER + T3 ::= INTEGER + +END