blob: 8942cc85ba04912cdefc458e383382032e5cffb7 [file] [log] [blame]
Austin Schuh3e95e5d2019-09-20 00:08:54 -07001namespace aos.testing;
2
Alex Perrycb7da4b2019-08-28 19:35:56 -07003enum BaseType : byte {
4 None,
5 UType,
6 Bool,
7 Byte,
8 UByte,
9 Short,
10 UShort,
11 Int,
12 UInt,
13 Long,
14 ULong,
15 Float,
16 Double,
17 String,
18 Vector,
19 Obj, // Used for tables & structs.
20 Union,
21 Array
22}
23
Austin Schuh3e95e5d2019-09-20 00:08:54 -070024table Location {
25 name:string;
26 type:string;
27 frequency:int;
28 max_size:int;
29}
30
31table Map {
32 match:Location;
33 rename:Location;
34}
35
36table Application {
37 name:string;
Austin Schuh09d7ffa2019-10-03 23:43:34 -070038 priority:int;
Austin Schuh3e95e5d2019-09-20 00:08:54 -070039 maps:[Map];
40}
41
Alex Perrycb7da4b2019-08-28 19:35:56 -070042table VectorOfStrings {
43 str:[string];
44}
45
46table VectorOfVectorOfString {
47 v:[VectorOfStrings];
48}
49
Austin Schuh3e95e5d2019-09-20 00:08:54 -070050table Configuration {
51 locations:[Location] (id: 0);
52 maps:[Map] (id: 1);
Austin Schuh09d7ffa2019-10-03 23:43:34 -070053 apps:[Application] (id: 2);
Austin Schuh3e95e5d2019-09-20 00:08:54 -070054 imports:[string] (id: 3);
55
56 // 8 bit: byte ubyte bool
57 // 16 bit: short ushort
58 // 32 bit: int uint float
59 // 64 bit: long ulong double
60
61 // Simple values.
62 foo_byte:byte (id: 4);
63 foo_ubyte:ubyte (id: 5);
64 foo_bool:bool (id: 6);
65
66 foo_short:short (id: 7);
67 foo_ushort:ushort (id: 8);
68
69 foo_int:int (id: 9);
70 foo_uint:uint (id: 10);
71
72 foo_long:long (id: 11);
73 foo_ulong:ulong (id: 12);
74
75 foo_float:float (id: 13);
76 foo_double:double (id: 14);
77
78 foo_string:string (id: 15);
79
Alex Perrycb7da4b2019-08-28 19:35:56 -070080 foo_enum:BaseType (id: 16);
81 foo_enum_default:BaseType = None (id: 17);
82
Austin Schuh3e95e5d2019-09-20 00:08:54 -070083 // Test vectors now.
Alex Perrycb7da4b2019-08-28 19:35:56 -070084 vector_foo_byte:[byte] (id: 18);
85 vector_foo_ubyte:[ubyte] (id: 19);
86 vector_foo_bool:[bool] (id: 20);
Austin Schuh3e95e5d2019-09-20 00:08:54 -070087
Alex Perrycb7da4b2019-08-28 19:35:56 -070088 vector_foo_short:[short] (id: 21);
89 vector_foo_ushort:[ushort] (id: 22);
Austin Schuh3e95e5d2019-09-20 00:08:54 -070090
Alex Perrycb7da4b2019-08-28 19:35:56 -070091 vector_foo_int:[int] (id: 23);
92 vector_foo_uint:[uint] (id: 24);
Austin Schuh3e95e5d2019-09-20 00:08:54 -070093
Alex Perrycb7da4b2019-08-28 19:35:56 -070094 vector_foo_long:[long] (id: 25);
95 vector_foo_ulong:[ulong] (id: 26);
Austin Schuh3e95e5d2019-09-20 00:08:54 -070096
Alex Perrycb7da4b2019-08-28 19:35:56 -070097 vector_foo_float:[float] (id: 27);
98 vector_foo_double:[double] (id: 28);
Austin Schuh3e95e5d2019-09-20 00:08:54 -070099
Alex Perrycb7da4b2019-08-28 19:35:56 -0700100 vector_foo_string:[string] (id: 29);
101
102 vector_foo_enum:[BaseType] (id: 30);
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700103
104 // And a simple nested application.
Alex Perrycb7da4b2019-08-28 19:35:56 -0700105 single_application:Application (id: 31);
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700106
107 // And nest this object to get some crazy coverage.
Alex Perrycb7da4b2019-08-28 19:35:56 -0700108 nested_config:Configuration (id: 32);
109
110 vov:VectorOfVectorOfString (id: 33);
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700111}
112
113root_type Configuration;