aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/72-same-names-OK.asn1.-P6
-rw-r--r--tests/89-bit-string-enum-OK.asn118
-rw-r--r--tests/89-bit-string-enum-OK.asn1.-P76
-rw-r--r--tests/89-bit-string-enum-OK.asn1.-Pfcompound-names76
4 files changed, 176 insertions, 0 deletions
diff --git a/tests/72-same-names-OK.asn1.-P b/tests/72-same-names-OK.asn1.-P
index 0014fe1e..3433fd1d 100644
--- a/tests/72-same-names-OK.asn1.-P
+++ b/tests/72-same-names-OK.asn1.-P
@@ -322,6 +322,9 @@ typedef enum Type2_PR {
Type2_PR_one_name,
Type2_PR_two_name,
} Type2_PR;
+typedef enum a {
+ a_one = 0
+} a_e;
/*
* Method of determining the components presence
@@ -329,6 +332,9 @@ typedef enum Type2_PR {
typedef enum two_name_PR {
two_name_PR_another_name, /* Member another_name is present */
} two_name_PR;
+typedef enum a {
+ a_one = 0
+} a_e;
/*** <<< TYPE-DECLS [Type2] >>> ***/
diff --git a/tests/89-bit-string-enum-OK.asn1 b/tests/89-bit-string-enum-OK.asn1
new file mode 100644
index 00000000..a47a7296
--- /dev/null
+++ b/tests/89-bit-string-enum-OK.asn1
@@ -0,0 +1,18 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .89
+
+ModuleIntegerEnumeration
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 89 }
+DEFINITIONS ::=
+BEGIN
+
+ T ::= CHOICE {
+ bs BIT STRING { a(1), b(2) }
+ }
+
+END
diff --git a/tests/89-bit-string-enum-OK.asn1.-P b/tests/89-bit-string-enum-OK.asn1.-P
new file mode 100644
index 00000000..0ab33be9
--- /dev/null
+++ b/tests/89-bit-string-enum-OK.asn1.-P
@@ -0,0 +1,76 @@
+
+/*** <<< INCLUDES [T] >>> ***/
+
+#include <BIT_STRING.h>
+#include <constr_CHOICE.h>
+
+/*** <<< DEPS [T] >>> ***/
+
+typedef enum T_PR {
+ T_PR_NOTHING, /* No components present */
+ T_PR_bs,
+} T_PR;
+typedef enum bs {
+ bs_a = 1,
+ bs_b = 2
+} bs_e;
+
+/*** <<< TYPE-DECLS [T] >>> ***/
+
+typedef struct T {
+ T_PR present;
+ union {
+ BIT_STRING_t bs;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} T_t;
+
+/*** <<< FUNC-DECLS [T] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_T;
+
+/*** <<< STAT-DEFS [T] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_T_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct T, choice.bs),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)),
+ .tag_mode = 0,
+ .type = (void *)&asn_DEF_BIT_STRING,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .name = "bs"
+ },
+};
+static asn_TYPE_tag2member_t asn_MAP_T_1_tag2el[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 0, 0, 0 } /* bs at 15 */
+};
+static asn_CHOICE_specifics_t asn_SPC_T_1_specs = {
+ sizeof(struct T),
+ offsetof(struct T, _asn_ctx),
+ offsetof(struct T, present),
+ sizeof(((struct T *)0)->present),
+ asn_MAP_T_1_tag2el,
+ 1, /* Count of tags in the map */
+ 0 /* Whether extensible */
+};
+asn_TYPE_descriptor_t asn_DEF_T = {
+ "T",
+ "T",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ asn_MBR_T_1,
+ 1, /* Elements count */
+ &asn_SPC_T_1_specs /* Additional specs */
+};
+
diff --git a/tests/89-bit-string-enum-OK.asn1.-Pfcompound-names b/tests/89-bit-string-enum-OK.asn1.-Pfcompound-names
new file mode 100644
index 00000000..1fe136a4
--- /dev/null
+++ b/tests/89-bit-string-enum-OK.asn1.-Pfcompound-names
@@ -0,0 +1,76 @@
+
+/*** <<< INCLUDES [T] >>> ***/
+
+#include <BIT_STRING.h>
+#include <constr_CHOICE.h>
+
+/*** <<< DEPS [T] >>> ***/
+
+typedef enum T_PR {
+ T_PR_NOTHING, /* No components present */
+ T_PR_bs,
+} T_PR;
+typedef enum T__bs {
+ T__bs_a = 1,
+ T__bs_b = 2
+} T__bs_e;
+
+/*** <<< TYPE-DECLS [T] >>> ***/
+
+typedef struct T {
+ T_PR present;
+ union {
+ BIT_STRING_t bs;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} T_t;
+
+/*** <<< FUNC-DECLS [T] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_T;
+
+/*** <<< STAT-DEFS [T] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_T_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct T, choice.bs),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)),
+ .tag_mode = 0,
+ .type = (void *)&asn_DEF_BIT_STRING,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .name = "bs"
+ },
+};
+static asn_TYPE_tag2member_t asn_MAP_T_1_tag2el[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 0, 0, 0 } /* bs at 15 */
+};
+static asn_CHOICE_specifics_t asn_SPC_T_1_specs = {
+ sizeof(struct T),
+ offsetof(struct T, _asn_ctx),
+ offsetof(struct T, present),
+ sizeof(((struct T *)0)->present),
+ asn_MAP_T_1_tag2el,
+ 1, /* Count of tags in the map */
+ 0 /* Whether extensible */
+};
+asn_TYPE_descriptor_t asn_DEF_T = {
+ "T",
+ "T",
+ CHOICE_free,
+ CHOICE_print,
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_decode_xer,
+ CHOICE_encode_xer,
+ CHOICE_outmost_tag,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ asn_MBR_T_1,
+ 1, /* Elements count */
+ &asn_SPC_T_1_specs /* Additional specs */
+};
+