Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asn1c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
asn1c
Commits
6eae4421
Commit
6eae4421
authored
Jan 16, 2018
by
Bi-Ruei, Chiu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Regenerate test cases
parent
6b76c7c7
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
328 additions
and
138 deletions
+328
-138
tests/tests-asn1c-compiler/139-component-relation-OK.asn1.-P
tests/tests-asn1c-compiler/139-component-relation-OK.asn1.-P
+28
-2
tests/tests-asn1c-compiler/140-component-relation-OK.asn1.-P
tests/tests-asn1c-compiler/140-component-relation-OK.asn1.-P
+28
-2
tests/tests-asn1c-compiler/141-component-relation-OK.asn1.-P
tests/tests-asn1c-compiler/141-component-relation-OK.asn1.-P
+29
-2
tests/tests-asn1c-compiler/144-ios-parameterization-OK.asn1.-P
.../tests-asn1c-compiler/144-ios-parameterization-OK.asn1.-P
+35
-31
tests/tests-asn1c-compiler/146-ios-parameterization-per-OK.asn1.-Pgen-PER
...c-compiler/146-ios-parameterization-per-OK.asn1.-Pgen-PER
+35
-31
tests/tests-asn1c-compiler/155-parameterization-more-than-two-level-OK.asn1.-Pgen-PER
...55-parameterization-more-than-two-level-OK.asn1.-Pgen-PER
+70
-39
tests/tests-asn1c-compiler/156-union-ios-OK.asn1.-Pgen-PER
tests/tests-asn1c-compiler/156-union-ios-OK.asn1.-Pgen-PER
+35
-31
tests/tests-asn1c-compiler/32-sequence-of-OK.asn1.-P
tests/tests-asn1c-compiler/32-sequence-of-OK.asn1.-P
+22
-0
tests/tests-asn1c-compiler/50-constraint-OK.asn1.-Pfwide-types
.../tests-asn1c-compiler/50-constraint-OK.asn1.-Pfwide-types
+23
-0
tests/tests-asn1c-compiler/50-constraint-OK.asn1.-Pgen-PER
tests/tests-asn1c-compiler/50-constraint-OK.asn1.-Pgen-PER
+23
-0
No files found.
tests/tests-asn1c-compiler/139-component-relation-OK.asn1.-P
View file @
6eae4421
...
...
@@ -86,16 +86,20 @@ select_Frame_value_type(const asn_TYPE_descriptor_t *parent_type, const void *pa
const asn_ioc_set_t *itable = asn_IOS_FrameTypes_1;
size_t constraining_column = 0; /* &id */
size_t for_column = 1; /* &Type */
size_t row;
size_t row
, presence_index = 0
;
const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct Frame, ident));
for(row=0; row < itable->rows_count; row++) {
const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
if(type_cell->cell_kind == aioc__undefined)
continue;
presence_index++;
if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
result.type_descriptor = type_cell->type_descriptor;
result.presence_index =
row + 1
;
result.presence_index =
presence_index
;
break;
}
}
...
...
@@ -316,3 +320,25 @@ asn_TYPE_descriptor_t asn_DEF_ComplexMessage = {
&asn_SPC_ComplexMessage_specs_1 /* Additional specs */
};
/*** <<< asn_constant.h >>> ***/
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
*/
#ifndef _ASN_CONSTANT_H
#define _ASN_CONSTANT_H
#ifdef __cplusplus
extern "C" {
#endif
#define basicMessage (1)
#ifdef __cplusplus
}
#endif
#endif /* _ASN_CONSTANT_H */
tests/tests-asn1c-compiler/140-component-relation-OK.asn1.-P
View file @
6eae4421
...
...
@@ -86,16 +86,20 @@ select_Frame_value_type(const asn_TYPE_descriptor_t *parent_type, const void *pa
const asn_ioc_set_t *itable = asn_IOS_FrameTypes_1;
size_t constraining_column = 0; /* &id */
size_t for_column = 1; /* &Type */
size_t row;
size_t row
, presence_index = 0
;
const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct Frame, ident));
for(row=0; row < itable->rows_count; row++) {
const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
if(type_cell->cell_kind == aioc__undefined)
continue;
presence_index++;
if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
result.type_descriptor = type_cell->type_descriptor;
result.presence_index =
row + 1
;
result.presence_index =
presence_index
;
break;
}
}
...
...
@@ -316,3 +320,25 @@ asn_TYPE_descriptor_t asn_DEF_ComplexMessage = {
&asn_SPC_ComplexMessage_specs_1 /* Additional specs */
};
/*** <<< asn_constant.h >>> ***/
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
*/
#ifndef _ASN_CONSTANT_H
#define _ASN_CONSTANT_H
#ifdef __cplusplus
extern "C" {
#endif
#define basicMessage (1)
#ifdef __cplusplus
}
#endif
#endif /* _ASN_CONSTANT_H */
tests/tests-asn1c-compiler/141-component-relation-OK.asn1.-P
View file @
6eae4421
...
...
@@ -92,16 +92,20 @@ select_Frame_value_type(const asn_TYPE_descriptor_t *parent_type, const void *pa
const asn_ioc_set_t *itable = asn_IOS_FrameTypes_1;
size_t constraining_column = 0; /* &id */
size_t for_column = 1; /* &Type */
size_t row;
size_t row
, presence_index = 0
;
const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct Frame, ident));
for(row=0; row < itable->rows_count; row++) {
const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
if(type_cell->cell_kind == aioc__undefined)
continue;
presence_index++;
if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
result.type_descriptor = type_cell->type_descriptor;
result.presence_index =
row + 1
;
result.presence_index =
presence_index
;
break;
}
}
...
...
@@ -395,3 +399,26 @@ asn_TYPE_descriptor_t asn_DEF_ComplexMessage = {
&asn_SPC_ComplexMessage_specs_1 /* Additional specs */
};
/*** <<< asn_constant.h >>> ***/
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
*/
#ifndef _ASN_CONSTANT_H
#define _ASN_CONSTANT_H
#ifdef __cplusplus
extern "C" {
#endif
#define primMessage (1)
#define cplxMessage (2)
#ifdef __cplusplus
}
#endif
#endif /* _ASN_CONSTANT_H */
tests/tests-asn1c-compiler/144-ios-parameterization-OK.asn1.-P
View file @
6eae4421
...
...
@@ -7,7 +7,7 @@
/*** <<< TYPE-DECLS [Message] >>> ***/
typedef struct Message {
RegionalExtension_
30P0_
t content;
RegionalExtension_t content;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
...
...
@@ -23,7 +23,7 @@ static asn_TYPE_member_t asn_MBR_Message_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct Message, content),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
.tag_mode = 0,
.type = &asn_DEF_RegionalExtension
_30P0
,
.type = &asn_DEF_RegionalExtension,
.type_selector = 0,
{ .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
0, 0, /* No default value */
...
...
@@ -81,11 +81,11 @@ typedef enum value_PR {
/*** <<< TYPE-DECLS [SpecializedContent] >>> ***/
typedef struct RegionalExtension
_30P0
{
typedef struct RegionalExtension {
long id;
struct value {
value_PR present;
union RegionalExtension_
30P0_
_value_u {
union RegionalExtension__value_u {
long INTEGER;
BOOLEAN_t BOOLEAN;
} choice;
...
...
@@ -96,13 +96,13 @@ typedef struct RegionalExtension_30P0 {
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} RegionalExtension_
30P0_
t;
} RegionalExtension_t;
/*** <<< FUNC-DECLS [SpecializedContent] >>> ***/
extern asn_TYPE_descriptor_t asn_DEF_RegionalExtension
_30P0
;
extern asn_SEQUENCE_specifics_t asn_SPC_RegionalExtension_
30P0_
specs_1;
extern asn_TYPE_member_t asn_MBR_RegionalExtension_
30P0_
1[2];
extern asn_TYPE_descriptor_t asn_DEF_RegionalExtension;
extern asn_SEQUENCE_specifics_t asn_SPC_RegionalExtension_specs_1;
extern asn_TYPE_member_t asn_MBR_RegionalExtension_1[2];
/*** <<< IOC-TABLES [SpecializedContent] >>> ***/
...
...
@@ -140,21 +140,25 @@ memb_id_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
}
static asn_type_selector_result_t
select_RegionalExtension_
30P0_
value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
select_RegionalExtension_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
asn_type_selector_result_t result = {0, 0};
const asn_ioc_set_t *itable = asn_IOS_RegionalExtension_1;
size_t constraining_column = 0; /* &id */
size_t for_column = 1; /* &Type */
size_t row;
const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RegionalExtension
_30P0
, id));
size_t row
, presence_index = 0
;
const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RegionalExtension, id));
for(row=0; row < itable->rows_count; row++) {
const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
if(type_cell->cell_kind == aioc__undefined)
continue;
presence_index++;
if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
result.type_descriptor = type_cell->type_descriptor;
result.presence_index =
row + 1
;
result.presence_index =
presence_index
;
break;
}
}
...
...
@@ -233,8 +237,8 @@ asn_TYPE_descriptor_t asn_DEF_value_3 = {
&asn_SPC_value_specs_3 /* Additional specs */
};
asn_TYPE_member_t asn_MBR_RegionalExtension_
30P0_
1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct RegionalExtension
_30P0
, id),
asn_TYPE_member_t asn_MBR_RegionalExtension_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct RegionalExtension, id),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
.tag_mode = 0,
.type = &asn_DEF_NativeInteger,
...
...
@@ -243,43 +247,43 @@ asn_TYPE_member_t asn_MBR_RegionalExtension_30P0_1[] = {
0, 0, /* No default value */
.name = "id"
},
{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RegionalExtension
_30P0
, value),
{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RegionalExtension, value),
.tag = -1 /* Ambiguous tag (ANY?) */,
.tag_mode = 0,
.type = &asn_DEF_value_3,
.type_selector = select_RegionalExtension_
30P0_
value_type,
.type_selector = select_RegionalExtension_value_type,
{ .oer_constraints = 0, .per_constraints = 0, .general_constraints = memb_value_constraint_1 },
0, 0, /* No default value */
.name = "value"
},
};
static const ber_tlv_tag_t asn_DEF_RegionalExtension_
30P0_
tags_1[] = {
static const ber_tlv_tag_t asn_DEF_RegionalExtension_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_RegionalExtension_
30P0_
tag2el_1[] = {
static const asn_TYPE_tag2member_t asn_MAP_RegionalExtension_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* id */
};
asn_SEQUENCE_specifics_t asn_SPC_RegionalExtension_
30P0_
specs_1 = {
sizeof(struct RegionalExtension
_30P0
),
offsetof(struct RegionalExtension
_30P0
, _asn_ctx),
.tag2el = asn_MAP_RegionalExtension_
30P0_
tag2el_1,
asn_SEQUENCE_specifics_t asn_SPC_RegionalExtension_specs_1 = {
sizeof(struct RegionalExtension),
offsetof(struct RegionalExtension, _asn_ctx),
.tag2el = asn_MAP_RegionalExtension_tag2el_1,
.tag2el_count = 1, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
-1, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_RegionalExtension
_30P0
= {
asn_TYPE_descriptor_t asn_DEF_RegionalExtension = {
"RegionalExtension",
"RegionalExtension",
&asn_OP_SEQUENCE,
asn_DEF_RegionalExtension_
30P0_
tags_1,
sizeof(asn_DEF_RegionalExtension_
30P0_
tags_1)
/sizeof(asn_DEF_RegionalExtension_
30P0_
tags_1[0]), /* 1 */
asn_DEF_RegionalExtension_
30P0_
tags_1, /* Same as above */
sizeof(asn_DEF_RegionalExtension_
30P0_
tags_1)
/sizeof(asn_DEF_RegionalExtension_
30P0_
tags_1[0]), /* 1 */
asn_DEF_RegionalExtension_tags_1,
sizeof(asn_DEF_RegionalExtension_tags_1)
/sizeof(asn_DEF_RegionalExtension_tags_1[0]), /* 1 */
asn_DEF_RegionalExtension_tags_1, /* Same as above */
sizeof(asn_DEF_RegionalExtension_tags_1)
/sizeof(asn_DEF_RegionalExtension_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_RegionalExtension_
30P0_
1,
asn_MBR_RegionalExtension_1,
2, /* Elements count */
&asn_SPC_RegionalExtension_
30P0_
specs_1 /* Additional specs */
&asn_SPC_RegionalExtension_specs_1 /* Additional specs */
};
tests/tests-asn1c-compiler/146-ios-parameterization-per-OK.asn1.-Pgen-PER
View file @
6eae4421
...
...
@@ -7,7 +7,7 @@
/*** <<< TYPE-DECLS [Message] >>> ***/
typedef struct Message {
RegionalExtension_
30P0_
t content;
RegionalExtension_t content;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
...
...
@@ -23,7 +23,7 @@ static asn_TYPE_member_t asn_MBR_Message_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct Message, content),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
.tag_mode = 0,
.type = &asn_DEF_RegionalExtension
_30P0
,
.type = &asn_DEF_RegionalExtension,
.type_selector = 0,
{ .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
0, 0, /* No default value */
...
...
@@ -81,11 +81,11 @@ typedef enum value_PR {
/*** <<< TYPE-DECLS [SpecializedContent] >>> ***/
typedef struct RegionalExtension
_30P0
{
typedef struct RegionalExtension {
long id;
struct value {
value_PR present;
union RegionalExtension_
30P0_
_value_u {
union RegionalExtension__value_u {
long INTEGER;
BOOLEAN_t BOOLEAN;
} choice;
...
...
@@ -96,13 +96,13 @@ typedef struct RegionalExtension_30P0 {
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} RegionalExtension_
30P0_
t;
} RegionalExtension_t;
/*** <<< FUNC-DECLS [SpecializedContent] >>> ***/
extern asn_TYPE_descriptor_t asn_DEF_RegionalExtension
_30P0
;
extern asn_SEQUENCE_specifics_t asn_SPC_RegionalExtension_
30P0_
specs_1;
extern asn_TYPE_member_t asn_MBR_RegionalExtension_
30P0_
1[2];
extern asn_TYPE_descriptor_t asn_DEF_RegionalExtension;
extern asn_SEQUENCE_specifics_t asn_SPC_RegionalExtension_specs_1;
extern asn_TYPE_member_t asn_MBR_RegionalExtension_1[2];
/*** <<< IOC-TABLES [SpecializedContent] >>> ***/
...
...
@@ -140,21 +140,25 @@ memb_id_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
}
static asn_type_selector_result_t
select_RegionalExtension_
30P0_
value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
select_RegionalExtension_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
asn_type_selector_result_t result = {0, 0};
const asn_ioc_set_t *itable = asn_IOS_RegionalExtension_1;
size_t constraining_column = 0; /* &id */
size_t for_column = 1; /* &Type */
size_t row;
const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RegionalExtension
_30P0
, id));
size_t row
, presence_index = 0
;
const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RegionalExtension, id));
for(row=0; row < itable->rows_count; row++) {
const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
if(type_cell->cell_kind == aioc__undefined)
continue;
presence_index++;
if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
result.type_descriptor = type_cell->type_descriptor;
result.presence_index =
row + 1
;
result.presence_index =
presence_index
;
break;
}
}
...
...
@@ -249,8 +253,8 @@ asn_TYPE_descriptor_t asn_DEF_value_3 = {
&asn_SPC_value_specs_3 /* Additional specs */
};
asn_TYPE_member_t asn_MBR_RegionalExtension_
30P0_
1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct RegionalExtension
_30P0
, id),
asn_TYPE_member_t asn_MBR_RegionalExtension_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct RegionalExtension, id),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
.tag_mode = 0,
.type = &asn_DEF_NativeInteger,
...
...
@@ -259,43 +263,43 @@ asn_TYPE_member_t asn_MBR_RegionalExtension_30P0_1[] = {
0, 0, /* No default value */
.name = "id"
},
{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RegionalExtension
_30P0
, value),
{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RegionalExtension, value),
.tag = -1 /* Ambiguous tag (ANY?) */,
.tag_mode = 0,
.type = &asn_DEF_value_3,
.type_selector = select_RegionalExtension_
30P0_
value_type,
.type_selector = select_RegionalExtension_value_type,
{ .oer_constraints = 0, .per_constraints = &asn_PER_memb_value_constr_3, .general_constraints = memb_value_constraint_1 },
0, 0, /* No default value */
.name = "value"
},
};
static const ber_tlv_tag_t asn_DEF_RegionalExtension_
30P0_
tags_1[] = {
static const ber_tlv_tag_t asn_DEF_RegionalExtension_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_RegionalExtension_
30P0_
tag2el_1[] = {
static const asn_TYPE_tag2member_t asn_MAP_RegionalExtension_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* id */
};
asn_SEQUENCE_specifics_t asn_SPC_RegionalExtension_
30P0_
specs_1 = {
sizeof(struct RegionalExtension
_30P0
),
offsetof(struct RegionalExtension
_30P0
, _asn_ctx),
.tag2el = asn_MAP_RegionalExtension_
30P0_
tag2el_1,
asn_SEQUENCE_specifics_t asn_SPC_RegionalExtension_specs_1 = {
sizeof(struct RegionalExtension),
offsetof(struct RegionalExtension, _asn_ctx),
.tag2el = asn_MAP_RegionalExtension_tag2el_1,
.tag2el_count = 1, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
-1, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_RegionalExtension
_30P0
= {
asn_TYPE_descriptor_t asn_DEF_RegionalExtension = {
"RegionalExtension",
"RegionalExtension",
&asn_OP_SEQUENCE,
asn_DEF_RegionalExtension_
30P0_
tags_1,
sizeof(asn_DEF_RegionalExtension_
30P0_
tags_1)
/sizeof(asn_DEF_RegionalExtension_
30P0_
tags_1[0]), /* 1 */
asn_DEF_RegionalExtension_
30P0_
tags_1, /* Same as above */
sizeof(asn_DEF_RegionalExtension_
30P0_
tags_1)
/sizeof(asn_DEF_RegionalExtension_
30P0_
tags_1[0]), /* 1 */
asn_DEF_RegionalExtension_tags_1,
sizeof(asn_DEF_RegionalExtension_tags_1)
/sizeof(asn_DEF_RegionalExtension_tags_1[0]), /* 1 */
asn_DEF_RegionalExtension_tags_1, /* Same as above */
sizeof(asn_DEF_RegionalExtension_tags_1)
/sizeof(asn_DEF_RegionalExtension_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_RegionalExtension_
30P0_
1,
asn_MBR_RegionalExtension_1,
2, /* Elements count */
&asn_SPC_RegionalExtension_
30P0_
specs_1 /* Additional specs */
&asn_SPC_RegionalExtension_specs_1 /* Additional specs */
};
tests/tests-asn1c-compiler/155-parameterization-more-than-two-level-OK.asn1.-Pgen-PER
View file @
6eae4421
...
...
@@ -9,6 +9,7 @@ typedef long PacketId_t;
/*** <<< FUNC-DECLS [PacketId] >>> ***/
#define PacketId_id_TYPE1 ((PacketId_t)1)
extern asn_per_constraints_t asn_PER_type_PacketId_constr_1;
extern asn_TYPE_descriptor_t asn_DEF_PacketId;
asn_struct_free_f PacketId_free;
...
...
@@ -501,7 +502,7 @@ asn_TYPE_descriptor_t asn_DEF_LowerLayer_List_45P0 = {
/*** <<< TYPE-DECLS [SinglePacket] >>> ***/
typedef ClassItem_
51P0_
t SinglePacket_48P0_t;
typedef ClassItem_t SinglePacket_48P0_t;
/*** <<< FUNC-DECLS [SinglePacket] >>> ***/
...
...
@@ -519,7 +520,7 @@ per_type_encoder_f SinglePacket_48P0_encode_uper;
/*** <<< CODE [SinglePacket] >>> ***/
/*
* This type is implemented using ClassItem
_51P0
,
* This type is implemented using ClassItem,
* so here we adjust the DEF accordingly.
*/
...
...
@@ -539,9 +540,9 @@ asn_TYPE_descriptor_t asn_DEF_SinglePacket_48P0 = {
sizeof(asn_DEF_SinglePacket_48P0_tags_1)
/sizeof(asn_DEF_SinglePacket_48P0_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_ClassItem_
51P0_
1,
asn_MBR_ClassItem_1,
3, /* Elements count */
&asn_SPC_ClassItem_
51P0_
specs_1 /* Additional specs */
&asn_SPC_ClassItem_specs_1 /* Additional specs */
};
...
...
@@ -566,12 +567,12 @@ typedef enum value_PR {
/*** <<< TYPE-DECLS [Packet] >>> ***/
typedef struct ClassItem
_51P0
{
typedef struct ClassItem {
PacketId_t id;
Color_t color;
struct value {
value_PR present;
union ClassItem_
51P0_
_value_u {
union ClassItem__value_u {
OCTET_STRING_t OCTET_STRING;
} choice;
...
...
@@ -581,13 +582,13 @@ typedef struct ClassItem_51P0 {
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} ClassItem_
51P0_
t;
} ClassItem_t;
/*** <<< FUNC-DECLS [Packet] >>> ***/
extern asn_TYPE_descriptor_t asn_DEF_ClassItem
_51P0
;
extern asn_SEQUENCE_specifics_t asn_SPC_ClassItem_
51P0_
specs_1;
extern asn_TYPE_member_t asn_MBR_ClassItem_
51P0_
1[3];
extern asn_TYPE_descriptor_t asn_DEF_ClassItem;
extern asn_SEQUENCE_specifics_t asn_SPC_ClassItem_specs_1;
extern asn_TYPE_member_t asn_MBR_ClassItem_1[3];
/*** <<< IOC-TABLES [Packet] >>> ***/
...
...
@@ -632,21 +633,25 @@ memb_id_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
}
static asn_type_selector_result_t
select_ClassItem_
51P0_
color_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
select_ClassItem_color_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
asn_type_selector_result_t result = {0, 0};
const asn_ioc_set_t *itable = asn_IOS_ClassItem_1;
size_t constraining_column = 0; /* &id */
size_t for_column = 1; /* &color */
size_t row;
const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct ClassItem
_51P0
, id));
size_t row
, presence_index = 0
;
const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct ClassItem, id));
for(row=0; row < itable->rows_count; row++) {
const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
if(type_cell->cell_kind == aioc__undefined)
continue;
presence_index++;
if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
result.type_descriptor = type_cell->type_descriptor;
result.presence_index =
row + 1
;
result.presence_index =
presence_index
;
break;
}
}
...
...
@@ -674,21 +679,25 @@ memb_color_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
}
static asn_type_selector_result_t
select_ClassItem_
51P0_
value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
select_ClassItem_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
asn_type_selector_result_t result = {0, 0};
const asn_ioc_set_t *itable = asn_IOS_ClassItem_1;
size_t constraining_column = 0; /* &id */
size_t for_column = 2; /* &Value */
size_t row;
const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct ClassItem
_51P0
, id));
size_t row
, presence_index = 0
;
const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct ClassItem, id));
for(row=0; row < itable->rows_count; row++) {
const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
if(type_cell->cell_kind == aioc__undefined)
continue;
presence_index++;
if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
result.type_descriptor = type_cell->type_descriptor;
result.presence_index =
row + 1
;
result.presence_index =
presence_index
;
break;
}
}
...
...
@@ -775,8 +784,8 @@ asn_TYPE_descriptor_t asn_DEF_value_4 = {
&asn_SPC_value_specs_4 /* Additional specs */
};
asn_TYPE_member_t asn_MBR_ClassItem_
51P0_
1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct ClassItem
_51P0
, id),
asn_TYPE_member_t asn_MBR_ClassItem_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct ClassItem, id),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
.tag_mode = 0,
.type = &asn_DEF_PacketId,
...
...
@@ -785,53 +794,75 @@ asn_TYPE_member_t asn_MBR_ClassItem_51P0_1[] = {
0, 0, /* No default value */
.name = "id"
},
{ ATF_NOFLAGS, 0, offsetof(struct ClassItem
_51P0
, color),
{ ATF_NOFLAGS, 0, offsetof(struct ClassItem, color),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
.tag_mode = 0,
.type = &asn_DEF_Color,
.type_selector = select_ClassItem_
51P0_
color_type,
.type_selector = select_ClassItem_color_type,
{ .oer_constraints = 0, .per_constraints = &asn_PER_memb_color_constr_3, .general_constraints = memb_color_constraint_1 },
0, 0, /* No default value */
.name = "color"
},
{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct ClassItem
_51P0
, value),
{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct ClassItem, value),
.tag = -1 /* Ambiguous tag (ANY?) */,
.tag_mode = 0,
.type = &asn_DEF_value_4,
.type_selector = select_ClassItem_
51P0_
value_type,
.type_selector = select_ClassItem_value_type,
{ .oer_constraints = 0, .per_constraints = &asn_PER_memb_value_constr_4, .general_constraints = memb_value_constraint_1 },
0, 0, /* No default value */
.name = "value"
},
};
static const ber_tlv_tag_t asn_DEF_ClassItem_
51P0_
tags_1[] = {
static const ber_tlv_tag_t asn_DEF_ClassItem_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_ClassItem_
51P0_
tag2el_1[] = {
static const asn_TYPE_tag2member_t asn_MAP_ClassItem_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
{ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* color */
};
asn_SEQUENCE_specifics_t asn_SPC_ClassItem_
51P0_
specs_1 = {
sizeof(struct ClassItem
_51P0
),
offsetof(struct ClassItem
_51P0
, _asn_ctx),
.tag2el = asn_MAP_ClassItem_
51P0_
tag2el_1,
asn_SEQUENCE_specifics_t asn_SPC_ClassItem_specs_1 = {
sizeof(struct ClassItem),
offsetof(struct ClassItem, _asn_ctx),
.tag2el = asn_MAP_ClassItem_tag2el_1,
.tag2el_count = 2, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
-1, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_ClassItem
_51P0
= {
asn_TYPE_descriptor_t asn_DEF_ClassItem = {
"ClassItem",
"ClassItem",
&asn_OP_SEQUENCE,
asn_DEF_ClassItem_
51P0_
tags_1,
sizeof(asn_DEF_ClassItem_
51P0_
tags_1)
/sizeof(asn_DEF_ClassItem_
51P0_
tags_1[0]), /* 1 */
asn_DEF_ClassItem_
51P0_
tags_1, /* Same as above */
sizeof(asn_DEF_ClassItem_
51P0_
tags_1)
/sizeof(asn_DEF_ClassItem_
51P0_
tags_1[0]), /* 1 */
asn_DEF_ClassItem_tags_1,
sizeof(asn_DEF_ClassItem_tags_1)
/sizeof(asn_DEF_ClassItem_tags_1[0]), /* 1 */
asn_DEF_ClassItem_tags_1, /* Same as above */
sizeof(asn_DEF_ClassItem_tags_1)
/sizeof(asn_DEF_ClassItem_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_ClassItem_
51P0_
1,
asn_MBR_ClassItem_1,
3, /* Elements count */
&asn_SPC_ClassItem_
51P0_
specs_1 /* Additional specs */
&asn_SPC_ClassItem_specs_1 /* Additional specs */
};
/*** <<< asn_constant.h >>> ***/
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
*/
#ifndef _ASN_CONSTANT_H
#define _ASN_CONSTANT_H
#ifdef __cplusplus
extern "C" {
#endif
#define max_items (256)
#ifdef __cplusplus
}
#endif
#endif /* _ASN_CONSTANT_H */
tests/tests-asn1c-compiler/156-union-ios-OK.asn1.-Pgen-PER
View file @
6eae4421
...
...
@@ -7,7 +7,7 @@
/*** <<< TYPE-DECLS [Message] >>> ***/
typedef struct Message {
TotalRegionExtension_
42P0_
t content;
TotalRegionExtension_t content;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
...
...
@@ -23,7 +23,7 @@ static asn_TYPE_member_t asn_MBR_Message_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct Message, content),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
.tag_mode = 0,
.type = &asn_DEF_TotalRegionExtension
_42P0
,
.type = &asn_DEF_TotalRegionExtension,
.type_selector = 0,
{ .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
0, 0, /* No default value */
...
...
@@ -83,11 +83,11 @@ typedef enum value_PR {
/*** <<< TYPE-DECLS [SpecializedContent] >>> ***/
typedef struct TotalRegionExtension
_42P0
{
typedef struct TotalRegionExtension {
long id;
struct value {
value_PR present;
union TotalRegionExtension_
42P0_
_value_u {
union TotalRegionExtension__value_u {
long INTEGER;
BOOLEAN_t BOOLEAN;
OCTET_STRING_t OCTET_STRING;
...
...
@@ -99,13 +99,13 @@ typedef struct TotalRegionExtension_42P0 {
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} TotalRegionExtension_
42P0_
t;
} TotalRegionExtension_t;
/*** <<< FUNC-DECLS [SpecializedContent] >>> ***/
extern asn_TYPE_descriptor_t asn_DEF_TotalRegionExtension
_42P0
;
extern asn_SEQUENCE_specifics_t asn_SPC_TotalRegionExtension_
42P0_
specs_1;
extern asn_TYPE_member_t asn_MBR_TotalRegionExtension_
42P0_
1[2];
extern asn_TYPE_descriptor_t asn_DEF_TotalRegionExtension;
extern asn_SEQUENCE_specifics_t asn_SPC_TotalRegionExtension_specs_1;
extern asn_TYPE_member_t asn_MBR_TotalRegionExtension_1[2];
/*** <<< IOC-TABLES [SpecializedContent] >>> ***/
...
...
@@ -155,21 +155,25 @@ memb_id_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
}
static asn_type_selector_result_t
select_TotalRegionExtension_
42P0_
value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
select_TotalRegionExtension_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
asn_type_selector_result_t result = {0, 0};
const asn_ioc_set_t *itable = asn_IOS_TotalRegionExtension_1;
size_t constraining_column = 0; /* &id */
size_t for_column = 1; /* &Type */
size_t row;
const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct TotalRegionExtension
_42P0
, id));
size_t row
, presence_index = 0
;
const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct TotalRegionExtension, id));
for(row=0; row < itable->rows_count; row++) {
const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
if(type_cell->cell_kind == aioc__undefined)
continue;
presence_index++;
if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
result.type_descriptor = type_cell->type_descriptor;
result.presence_index =
row + 1
;
result.presence_index =
presence_index
;
break;
}
}
...
...
@@ -274,8 +278,8 @@ asn_TYPE_descriptor_t asn_DEF_value_3 = {
&asn_SPC_value_specs_3 /* Additional specs */
};
asn_TYPE_member_t asn_MBR_TotalRegionExtension_
42P0_
1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct TotalRegionExtension
_42P0
, id),
asn_TYPE_member_t asn_MBR_TotalRegionExtension_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct TotalRegionExtension, id),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
.tag_mode = 0,
.type = &asn_DEF_NativeInteger,
...
...
@@ -284,43 +288,43 @@ asn_TYPE_member_t asn_MBR_TotalRegionExtension_42P0_1[] = {
0, 0, /* No default value */
.name = "id"
},
{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct TotalRegionExtension
_42P0
, value),
{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct TotalRegionExtension, value),
.tag = -1 /* Ambiguous tag (ANY?) */,
.tag_mode = 0,
.type = &asn_DEF_value_3,
.type_selector = select_TotalRegionExtension_
42P0_
value_type,
.type_selector = select_TotalRegionExtension_value_type,
{ .oer_constraints = 0, .per_constraints = &asn_PER_memb_value_constr_3, .general_constraints = memb_value_constraint_1 },
0, 0, /* No default value */
.name = "value"
},
};
static const ber_tlv_tag_t asn_DEF_TotalRegionExtension_
42P0_
tags_1[] = {
static const ber_tlv_tag_t asn_DEF_TotalRegionExtension_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_TotalRegionExtension_
42P0_
tag2el_1[] = {
static const asn_TYPE_tag2member_t asn_MAP_TotalRegionExtension_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* id */
};
asn_SEQUENCE_specifics_t asn_SPC_TotalRegionExtension_
42P0_
specs_1 = {
sizeof(struct TotalRegionExtension
_42P0
),
offsetof(struct TotalRegionExtension
_42P0
, _asn_ctx),
.tag2el = asn_MAP_TotalRegionExtension_
42P0_
tag2el_1,
asn_SEQUENCE_specifics_t asn_SPC_TotalRegionExtension_specs_1 = {
sizeof(struct TotalRegionExtension),
offsetof(struct TotalRegionExtension, _asn_ctx),
.tag2el = asn_MAP_TotalRegionExtension_tag2el_1,
.tag2el_count = 1, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
-1, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_TotalRegionExtension
_42P0
= {
asn_TYPE_descriptor_t asn_DEF_TotalRegionExtension = {
"TotalRegionExtension",
"TotalRegionExtension",
&asn_OP_SEQUENCE,
asn_DEF_TotalRegionExtension_
42P0_
tags_1,
sizeof(asn_DEF_TotalRegionExtension_
42P0_
tags_1)
/sizeof(asn_DEF_TotalRegionExtension_
42P0_
tags_1[0]), /* 1 */
asn_DEF_TotalRegionExtension_
42P0_
tags_1, /* Same as above */
sizeof(asn_DEF_TotalRegionExtension_
42P0_
tags_1)
/sizeof(asn_DEF_TotalRegionExtension_
42P0_
tags_1[0]), /* 1 */
asn_DEF_TotalRegionExtension_tags_1,
sizeof(asn_DEF_TotalRegionExtension_tags_1)
/sizeof(asn_DEF_TotalRegionExtension_tags_1[0]), /* 1 */
asn_DEF_TotalRegionExtension_tags_1, /* Same as above */
sizeof(asn_DEF_TotalRegionExtension_tags_1)
/sizeof(asn_DEF_TotalRegionExtension_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_TotalRegionExtension_
42P0_
1,
asn_MBR_TotalRegionExtension_1,
2, /* Elements count */
&asn_SPC_TotalRegionExtension_
42P0_
specs_1 /* Additional specs */
&asn_SPC_TotalRegionExtension_specs_1 /* Additional specs */
};
tests/tests-asn1c-compiler/32-sequence-of-OK.asn1.-P
View file @
6eae4421
...
...
@@ -428,3 +428,25 @@ asn_TYPE_descriptor_t asn_DEF_SeqWithOptional = {
&asn_SPC_SeqWithOptional_specs_1 /* Additional specs */
};
/*** <<< asn_constant.h >>> ***/
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
*/
#ifndef _ASN_CONSTANT_H
#define _ASN_CONSTANT_H
#ifdef __cplusplus
extern "C" {
#endif
#define maxSize (10)
#ifdef __cplusplus
}
#endif
#endif /* _ASN_CONSTANT_H */
tests/tests-asn1c-compiler/50-constraint-OK.asn1.-Pfwide-types
View file @
6eae4421
...
...
@@ -17,6 +17,7 @@ ber_type_decoder_f Int1_decode_ber;
der_type_encoder_f Int1_encode_der;
xer_type_decoder_f Int1_decode_xer;
xer_type_encoder_f Int1_encode_xer;
#define Int1_ten ((Int1_t)10)
/*** <<< CODE [Int1] >>> ***/
...
...
@@ -2548,3 +2549,25 @@ asn_TYPE_descriptor_t asn_DEF_Identifier = {
0 /* No specifics */
};
/*** <<< asn_constant.h >>> ***/
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
*/
#ifndef _ASN_CONSTANT_H
#define _ASN_CONSTANT_H
#ifdef __cplusplus
extern "C" {
#endif
#define maxIdentifier (32)
#ifdef __cplusplus
}
#endif
#endif /* _ASN_CONSTANT_H */
tests/tests-asn1c-compiler/50-constraint-OK.asn1.-Pgen-PER
View file @
6eae4421
...
...
@@ -19,6 +19,7 @@ xer_type_decoder_f Int1_decode_xer;
xer_type_encoder_f Int1_encode_xer;
per_type_decoder_f Int1_decode_uper;
per_type_encoder_f Int1_encode_uper;
#define Int1_ten ((Int1_t)10)
/*** <<< CODE [Int1] >>> ***/
...
...
@@ -2835,3 +2836,25 @@ asn_TYPE_descriptor_t asn_DEF_Identifier = {
0 /* No specifics */
};
/*** <<< asn_constant.h >>> ***/
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
*/
#ifndef _ASN_CONSTANT_H
#define _ASN_CONSTANT_H
#ifdef __cplusplus
extern "C" {
#endif
#define maxIdentifier (32)
#ifdef __cplusplus
}
#endif
#endif /* _ASN_CONSTANT_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment