2022-09-29 21:06:46 +02:00
|
|
|
/*
|
|
|
|
* tests/lxdrgen.lxdr: a test protocol for the generator
|
|
|
|
*/
|
|
|
|
const VERSION = 1;
|
|
|
|
const NOISREV = -1;
|
|
|
|
|
|
|
|
// TODO: Test failure paths, and in general go for full coverage.
|
|
|
|
struct Struct {
|
|
|
|
union Union switch (enum Enum {
|
|
|
|
NUMBERS = VERSION,
|
|
|
|
OTHERS = 2,
|
|
|
|
NOTHING,
|
|
|
|
} tag) {
|
|
|
|
case NUMBERS:
|
|
|
|
i8 a; i16 b; i32 c; i64 d;
|
|
|
|
u8 e; u16 f; u32 g; u64 h;
|
|
|
|
case OTHERS:
|
|
|
|
bool foo;
|
|
|
|
string bar;
|
2023-07-07 12:25:14 +02:00
|
|
|
u8 baz<>;
|
2022-09-29 21:06:46 +02:00
|
|
|
case NOTHING:
|
|
|
|
void;
|
|
|
|
} u<>;
|
2023-07-06 06:38:25 +02:00
|
|
|
|
|
|
|
union Onion switch (Enum tag) {
|
|
|
|
case NOTHING:
|
|
|
|
void;
|
|
|
|
} o;
|
2022-09-29 21:06:46 +02:00
|
|
|
};
|