Commit 9f78ca65 authored by v0-e's avatar v0-e

Default class syntax test 164

parent 8ca8e0ef
-- OK: Everything is fine
-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
-- .spelio.software.asn1c.test (9363.1.5.1)
-- .164
ModuleClassDefaultSyntax
{ iso org(3) dod(6) internet (1) private(4) enterprise(1)
spelio(9363) software(1) asn1c(5) test(1) 164 }
DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
DCLASS ::= CLASS {
&id INTEGER,
&Type
}
Ordered DCLASS ::= {
{&id 1, &Type UTF8String} |
{&id 2, &Type OCTET STRING}
}
Unordered DCLASS ::= {
{&Type UTF8String, &id 17} |
{&id 8, &Type OCTET STRING}
}
A ::= SEQUENCE
{
a-Ordered-id DCLASS.&id ({Ordered}),
a-Ordered-val DCLASS.&Type ({Ordered}{@a-Ordered-id})
}
B ::= SEQUENCE
{
b-Unordered-id DCLASS.&id ({Unordered}),
b-Unordered-val DCLASS.&Type ({Unordered}{@b-Unordered-id})
}
END
......@@ -62,6 +62,7 @@ TESTS += check-src/check-92.-findirect-choice.c
TESTS += check-src/check-92.c
TESTS += check-src/check-158.-fcompound-names.c
TESTS += check-src/check-159.c
TESTS += check-src/check-164.c
if TEST_64BIT
TESTS += check-src/check64-134.-gen-UPER.c
......
#undef NDEBUG
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <string.h>
#include <assert.h>
#include <A.h>
#include <B.h>
int
main(int ac, char **av) {
A_t a;
B_t b;
(void)ac; /* Unused argument */
(void)av; /* Unused argument */
memset(&a, 0, sizeof(a));
memset(&b, 0, sizeof(b));
/* Check existence of the following enum values */
assert(a_Ordered_val_PR_UTF8String);
assert(a_Ordered_val_PR_OCTET_STRING);
assert(b_Unordered_val_PR_UTF8String);
assert(b_Unordered_val_PR_OCTET_STRING);
/*
* No plans to fill it up: just checking whether it compiles or not.
*/
return 0;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment