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
3bcab4eb
Commit
3bcab4eb
authored
Nov 02, 2017
by
Jon Ringle
Committed by
Lev Walkin
Nov 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test case for issue #178
parent
8baaf6b0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
321 additions
and
0 deletions
+321
-0
tests/tests-asn1c-compiler/158-sequence-of-sequence-nested-OK.asn1
...ts-asn1c-compiler/158-sequence-of-sequence-nested-OK.asn1
+24
-0
tests/tests-asn1c-compiler/158-sequence-of-sequence-nested-OK.asn1.-Pfcompound-names
...158-sequence-of-sequence-nested-OK.asn1.-Pfcompound-names
+269
-0
tests/tests-c-compiler/Makefile.am
tests/tests-c-compiler/Makefile.am
+4
-0
tests/tests-c-compiler/check-src/check-158.-fcompound-names.c
...s/tests-c-compiler/check-src/check-158.-fcompound-names.c
+24
-0
No files found.
tests/tests-asn1c-compiler/158-sequence-of-sequence-nested-OK.asn1
0 → 100644
View file @
3bcab4eb
-- OK: Everything is fine
-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
-- .spelio.software.asn1c.test (9363.1.5.1)
-- .158
ModuleTestSequenceOfSequenceNested
{ iso org(3) dod(6) internet(1) private(4) enterprise(1)
spelio(9363) software(1) asn1c(5) test(1) 158 }
DEFINITIONS IMPLICIT TAGS ::=
BEGIN
SeqWithNestedSOS ::= SEQUENCE {
someString [0] UTF8String,
sos [1] SEQUENCE OF SEQUENCE {
anotherString [2] UTF8String,
nested-sos [3] SEQUENCE OF SEQUENCE {
nested-string [4] UTF8String
}
}
}
END
tests/tests-asn1c-compiler/158-sequence-of-sequence-nested-OK.asn1.-Pfcompound-names
0 → 100644
View file @
3bcab4eb
/*** <<< INCLUDES [SeqWithNestedSOS] >>> ***/
#include <UTF8String.h>
#include <asn_SEQUENCE_OF.h>
#include <constr_SEQUENCE.h>
#include <constr_SEQUENCE_OF.h>
/*** <<< FWD-DEFS [SeqWithNestedSOS] >>> ***/
typedef struct SeqWithNestedSOS__sos__Member {
UTF8String_t anotherString;
struct SeqWithNestedSOS__sos__Member__nested_sos {
A_SEQUENCE_OF(typedef struct SeqWithNestedSOS__sos__Member__nested_sos__Member {
UTF8String_t nested_string;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} SeqWithNestedSOS__sos__Member__nested_sos__Member;
SeqWithNestedSOS__sos__Member__nested_sos__Member) list;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} nested_sos;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} SeqWithNestedSOS__sos__Member;
/*** <<< TYPE-DECLS [SeqWithNestedSOS] >>> ***/
typedef struct SeqWithNestedSOS {
UTF8String_t someString;
struct SeqWithNestedSOS__sos {
A_SEQUENCE_OF(SeqWithNestedSOS__sos__Member) list;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} sos;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} SeqWithNestedSOS_t;
/*** <<< FUNC-DECLS [SeqWithNestedSOS] >>> ***/
extern asn_TYPE_descriptor_t asn_DEF_SeqWithNestedSOS;
/*** <<< STAT-DEFS [SeqWithNestedSOS] >>> ***/
static asn_TYPE_member_t asn_MBR_Member_7[] = {
{ ATF_NOFLAGS, 0, offsetof(struct SeqWithNestedSOS__sos__Member__nested_sos__Member, nested_string),
.tag = (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
.tag_mode = -1, /* IMPLICIT tag at current level */
.type = &asn_DEF_UTF8String,
.type_selector = 0,
{ .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
0, 0, /* No default value */
.name = "nested-string"
},
};
static const ber_tlv_tag_t asn_DEF_Member_tags_7[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_Member_tag2el_7[] = {
{ (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 0, 0, 0 } /* nested-string */
};
static asn_SEQUENCE_specifics_t asn_SPC_Member_specs_7 = {
sizeof(struct SeqWithNestedSOS__sos__Member__nested_sos__Member),
offsetof(struct SeqWithNestedSOS__sos__Member__nested_sos__Member, _asn_ctx),
.tag2el = asn_MAP_Member_tag2el_7,
.tag2el_count = 1, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
-1, /* First extension addition */
};
static /* Use -fall-defs-global to expose */
asn_TYPE_descriptor_t asn_DEF_Member_7 = {
"SEQUENCE",
"SEQUENCE",
&asn_OP_SEQUENCE,
asn_DEF_Member_tags_7,
sizeof(asn_DEF_Member_tags_7)
/sizeof(asn_DEF_Member_tags_7[0]), /* 1 */
asn_DEF_Member_tags_7, /* Same as above */
sizeof(asn_DEF_Member_tags_7)
/sizeof(asn_DEF_Member_tags_7[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_Member_7,
1, /* Elements count */
&asn_SPC_Member_specs_7 /* Additional specs */
};
static asn_TYPE_member_t asn_MBR_nested_sos_6[] = {
{ ATF_POINTER, 0, 0,
.tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
.tag_mode = 0,
.type = &asn_DEF_Member_7,
.type_selector = 0,
{ .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
0, 0, /* No default value */
.name = ""
},
};
static const ber_tlv_tag_t asn_DEF_nested_sos_tags_6[] = {
(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_SET_OF_specifics_t asn_SPC_nested_sos_specs_6 = {
sizeof(struct SeqWithNestedSOS__sos__Member__nested_sos),
offsetof(struct SeqWithNestedSOS__sos__Member__nested_sos, _asn_ctx),
0, /* XER encoding is XMLDelimitedItemList */
};
static /* Use -fall-defs-global to expose */
asn_TYPE_descriptor_t asn_DEF_nested_sos_6 = {
"nested-sos",
"nested-sos",
&asn_OP_SEQUENCE_OF,
asn_DEF_nested_sos_tags_6,
sizeof(asn_DEF_nested_sos_tags_6)
/sizeof(asn_DEF_nested_sos_tags_6[0]) - 1, /* 1 */
asn_DEF_nested_sos_tags_6, /* Same as above */
sizeof(asn_DEF_nested_sos_tags_6)
/sizeof(asn_DEF_nested_sos_tags_6[0]), /* 2 */
{ 0, 0, SEQUENCE_OF_constraint },
asn_MBR_nested_sos_6,
1, /* Single element */
&asn_SPC_nested_sos_specs_6 /* Additional specs */
};
static asn_TYPE_member_t asn_MBR_Member_4[] = {
{ ATF_NOFLAGS, 0, offsetof(struct SeqWithNestedSOS__sos__Member, anotherString),
.tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
.tag_mode = -1, /* IMPLICIT tag at current level */
.type = &asn_DEF_UTF8String,
.type_selector = 0,
{ .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
0, 0, /* No default value */
.name = "anotherString"
},
{ ATF_NOFLAGS, 0, offsetof(struct SeqWithNestedSOS__sos__Member, nested_sos),
.tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
.tag_mode = 0,
.type = &asn_DEF_nested_sos_6,
.type_selector = 0,
{ .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
0, 0, /* No default value */
.name = "nested-sos"
},
};
static const ber_tlv_tag_t asn_DEF_Member_tags_4[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_Member_tag2el_4[] = {
{ (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 0, 0, 0 }, /* anotherString */
{ (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 1, 0, 0 } /* nested-sos */
};
static asn_SEQUENCE_specifics_t asn_SPC_Member_specs_4 = {
sizeof(struct SeqWithNestedSOS__sos__Member),
offsetof(struct SeqWithNestedSOS__sos__Member, _asn_ctx),
.tag2el = asn_MAP_Member_tag2el_4,
.tag2el_count = 2, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
-1, /* First extension addition */
};
static /* Use -fall-defs-global to expose */
asn_TYPE_descriptor_t asn_DEF_Member_4 = {
"SEQUENCE",
"SEQUENCE",
&asn_OP_SEQUENCE,
asn_DEF_Member_tags_4,
sizeof(asn_DEF_Member_tags_4)
/sizeof(asn_DEF_Member_tags_4[0]), /* 1 */
asn_DEF_Member_tags_4, /* Same as above */
sizeof(asn_DEF_Member_tags_4)
/sizeof(asn_DEF_Member_tags_4[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_Member_4,
2, /* Elements count */
&asn_SPC_Member_specs_4 /* Additional specs */
};
static asn_TYPE_member_t asn_MBR_sos_3[] = {
{ ATF_POINTER, 0, 0,
.tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
.tag_mode = 0,
.type = &asn_DEF_Member_4,
.type_selector = 0,
{ .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
0, 0, /* No default value */
.name = ""
},
};
static const ber_tlv_tag_t asn_DEF_sos_tags_3[] = {
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_SET_OF_specifics_t asn_SPC_sos_specs_3 = {
sizeof(struct SeqWithNestedSOS__sos),
offsetof(struct SeqWithNestedSOS__sos, _asn_ctx),
0, /* XER encoding is XMLDelimitedItemList */
};
static /* Use -fall-defs-global to expose */
asn_TYPE_descriptor_t asn_DEF_sos_3 = {
"sos",
"sos",
&asn_OP_SEQUENCE_OF,
asn_DEF_sos_tags_3,
sizeof(asn_DEF_sos_tags_3)
/sizeof(asn_DEF_sos_tags_3[0]) - 1, /* 1 */
asn_DEF_sos_tags_3, /* Same as above */
sizeof(asn_DEF_sos_tags_3)
/sizeof(asn_DEF_sos_tags_3[0]), /* 2 */
{ 0, 0, SEQUENCE_OF_constraint },
asn_MBR_sos_3,
1, /* Single element */
&asn_SPC_sos_specs_3 /* Additional specs */
};
static asn_TYPE_member_t asn_MBR_SeqWithNestedSOS_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct SeqWithNestedSOS, someString),
.tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
.tag_mode = -1, /* IMPLICIT tag at current level */
.type = &asn_DEF_UTF8String,
.type_selector = 0,
{ .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
0, 0, /* No default value */
.name = "someString"
},
{ ATF_NOFLAGS, 0, offsetof(struct SeqWithNestedSOS, sos),
.tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
.tag_mode = 0,
.type = &asn_DEF_sos_3,
.type_selector = 0,
{ .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
0, 0, /* No default value */
.name = "sos"
},
};
static const ber_tlv_tag_t asn_DEF_SeqWithNestedSOS_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_SeqWithNestedSOS_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* someString */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* sos */
};
static asn_SEQUENCE_specifics_t asn_SPC_SeqWithNestedSOS_specs_1 = {
sizeof(struct SeqWithNestedSOS),
offsetof(struct SeqWithNestedSOS, _asn_ctx),
.tag2el = asn_MAP_SeqWithNestedSOS_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_SeqWithNestedSOS = {
"SeqWithNestedSOS",
"SeqWithNestedSOS",
&asn_OP_SEQUENCE,
asn_DEF_SeqWithNestedSOS_tags_1,
sizeof(asn_DEF_SeqWithNestedSOS_tags_1)
/sizeof(asn_DEF_SeqWithNestedSOS_tags_1[0]), /* 1 */
asn_DEF_SeqWithNestedSOS_tags_1, /* Same as above */
sizeof(asn_DEF_SeqWithNestedSOS_tags_1)
/sizeof(asn_DEF_SeqWithNestedSOS_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_SeqWithNestedSOS_1,
2, /* Elements count */
&asn_SPC_SeqWithNestedSOS_specs_1 /* Additional specs */
};
tests/tests-c-compiler/Makefile.am
View file @
3bcab4eb
...
...
@@ -60,12 +60,16 @@ TESTS += check-src/check-72.-fcompound-names.c
TESTS
+=
check-src/check-73.c
TESTS
+=
check-src/check-92.-findirect-choice.c
TESTS
+=
check-src/check-92.c
TESTS
+=
check-src/check-158.-fcompound-names.c
if
TEST_64BIT
TESTS
+=
check-src/check64-134.-gen-PER.c
TESTS
+=
check-src/check64-136.-gen-OER.c
endif
XFAIL_TESTS
=
XFAIL_TESTS
+=
check-src/check-158.-fcompound-names.c
EXTRA_DIST
=
\
data-62
\
data-70
\
...
...
tests/tests-c-compiler/check-src/check-158.-fcompound-names.c
0 → 100644
View file @
3bcab4eb
#undef NDEBUG
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <string.h>
#include <assert.h>
#include <Type.h>
int
main
(
int
ac
,
char
**
av
)
{
Type_t
t
;
(
void
)
ac
;
/* Unused argument */
(
void
)
av
;
/* Unused argument */
memset
(
&
t
,
0
,
sizeof
(
t
));
/*
* No plans to fill it up: just checking whether it compiles or not.
*/
return
0
;
}
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