aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLev Walkin <vlm@lionet.info>2007-06-29 01:42:04 +0000
committerLev Walkin <vlm@lionet.info>2007-06-29 01:42:04 +0000
commitd7a6811e6a54654acf020cbac82526ef0136b891 (patch)
tree65d9ec86781620e3f562f02d8bb4c1e8129cc3b7
parent3877dca336f061231f9c7173ef25d2fcb689a584 (diff)
new members
-rw-r--r--tests/126-per-extensions-OK.asn16
-rw-r--r--tests/126-per-extensions-OK.asn1.-Pgen-PER46
2 files changed, 39 insertions, 13 deletions
diff --git a/tests/126-per-extensions-OK.asn1 b/tests/126-per-extensions-OK.asn1
index 3d708663..7d121730 100644
--- a/tests/126-per-extensions-OK.asn1
+++ b/tests/126-per-extensions-OK.asn1
@@ -24,8 +24,10 @@ BEGIN
}
PDU-2 ::= CHOICE {
- str-p2 IA5String,
- ...
+ main [3] INTEGER,
+ ...,
+ ext1 [1] INTEGER,
+ ext0 [0] INTEGER
}
END
diff --git a/tests/126-per-extensions-OK.asn1.-Pgen-PER b/tests/126-per-extensions-OK.asn1.-Pgen-PER
index 326a705c..91aac0cc 100644
--- a/tests/126-per-extensions-OK.asn1.-Pgen-PER
+++ b/tests/126-per-extensions-OK.asn1.-Pgen-PER
@@ -222,16 +222,17 @@ asn_TYPE_descriptor_t asn_DEF_Singleton = {
/*** <<< INCLUDES [PDU-2] >>> ***/
-#include <IA5String.h>
+#include <INTEGER.h>
#include <constr_CHOICE.h>
/*** <<< DEPS [PDU-2] >>> ***/
typedef enum PDU_2_PR {
PDU_2_PR_NOTHING, /* No components present */
- PDU_2_PR_str_p2,
+ PDU_2_PR_main,
/* Extensions may appear below */
-
+ PDU_2_PR_ext1,
+ PDU_2_PR_ext0
} PDU_2_PR;
/*** <<< TYPE-DECLS [PDU-2] >>> ***/
@@ -239,11 +240,13 @@ typedef enum PDU_2_PR {
typedef struct PDU_2 {
PDU_2_PR present;
union PDU_2_u {
- IA5String_t str_p2;
+ INTEGER_t main;
/*
* This type is extensible,
* possible extensions are below.
*/
+ INTEGER_t ext1;
+ INTEGER_t ext0;
} choice;
/* Context for parsing across buffer boundaries */
@@ -265,18 +268,39 @@ static asn_per_constraints_t asn_PER_type_PDU_2_constr_1 = {
/*** <<< STAT-DEFS [PDU-2] >>> ***/
static asn_TYPE_member_t asn_MBR_PDU_2_1[] = {
- { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.str_p2),
+ { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.main),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_INTEGER,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = 0,
+ .name = "main"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.ext1),
+ .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = &asn_DEF_INTEGER,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .per_constraints = 0, /* No PER visible constraints */
+ .default_value = 0,
+ .name = "ext1"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.ext0),
.tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
.tag_mode = -1, /* IMPLICIT tag at current level */
- .type = &asn_DEF_IA5String,
+ .type = &asn_DEF_INTEGER,
.memb_constraints = 0, /* Defer constraints checking to the member type */
.per_constraints = 0, /* No PER visible constraints */
.default_value = 0,
- .name = "str-p2"
+ .name = "ext0"
},
};
+static int asn_MAP_PDU_2_cmap_1[] = { 0, 2, 1 };
static asn_TYPE_tag2member_t asn_MAP_PDU_2_tag2el_1[] = {
- { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* str-p2 at 27 */
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 2, 0, 0 }, /* ext0 at 31 */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ext1 at 29 */
+ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 0, 0, 0 } /* main at 27 */
};
static asn_CHOICE_specifics_t asn_SPC_PDU_2_specs_1 = {
sizeof(struct PDU_2),
@@ -284,8 +308,8 @@ static asn_CHOICE_specifics_t asn_SPC_PDU_2_specs_1 = {
offsetof(struct PDU_2, present),
sizeof(((struct PDU_2 *)0)->present),
asn_MAP_PDU_2_tag2el_1,
- 1, /* Count of tags in the map */
- .canonical_order = 0,
+ 3, /* Count of tags in the map */
+ .canonical_order = asn_MAP_PDU_2_cmap_1, /* Canonically sorted */
.ext_start = 1 /* Extensions start */
};
asn_TYPE_descriptor_t asn_DEF_PDU_2 = {
@@ -307,7 +331,7 @@ asn_TYPE_descriptor_t asn_DEF_PDU_2 = {
0, /* No tags (count) */
&asn_PER_type_PDU_2_constr_1,
asn_MBR_PDU_2_1,
- 1, /* Elements count */
+ 3, /* Elements count */
&asn_SPC_PDU_2_specs_1 /* Additional specs */
};