blob: 8c0402c9e47ef411da714df2ed240ec133c757aa [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
Tyler Chatow5e369a42019-11-23 11:57:31 -080050struct FooStructNested {
51 foo_byte:byte;
52}
53
54struct FooStruct {
55 foo_byte:byte;
56 nested_struct:FooStructNested;
57}
58
59struct StructEnum {
60 foo_enum:BaseType;
61}
62
Austin Schuh3e95e5d2019-09-20 00:08:54 -070063table Configuration {
64 locations:[Location] (id: 0);
65 maps:[Map] (id: 1);
Austin Schuh09d7ffa2019-10-03 23:43:34 -070066 apps:[Application] (id: 2);
Austin Schuh3e95e5d2019-09-20 00:08:54 -070067 imports:[string] (id: 3);
68
69 // 8 bit: byte ubyte bool
70 // 16 bit: short ushort
71 // 32 bit: int uint float
72 // 64 bit: long ulong double
73
74 // Simple values.
75 foo_byte:byte (id: 4);
76 foo_ubyte:ubyte (id: 5);
77 foo_bool:bool (id: 6);
78
79 foo_short:short (id: 7);
80 foo_ushort:ushort (id: 8);
81
82 foo_int:int (id: 9);
83 foo_uint:uint (id: 10);
84
85 foo_long:long (id: 11);
86 foo_ulong:ulong (id: 12);
87
88 foo_float:float (id: 13);
89 foo_double:double (id: 14);
90
91 foo_string:string (id: 15);
92
Alex Perrycb7da4b2019-08-28 19:35:56 -070093 foo_enum:BaseType (id: 16);
94 foo_enum_default:BaseType = None (id: 17);
95
Austin Schuh3e95e5d2019-09-20 00:08:54 -070096 // Test vectors now.
Alex Perrycb7da4b2019-08-28 19:35:56 -070097 vector_foo_byte:[byte] (id: 18);
98 vector_foo_ubyte:[ubyte] (id: 19);
99 vector_foo_bool:[bool] (id: 20);
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700100
Alex Perrycb7da4b2019-08-28 19:35:56 -0700101 vector_foo_short:[short] (id: 21);
102 vector_foo_ushort:[ushort] (id: 22);
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700103
Alex Perrycb7da4b2019-08-28 19:35:56 -0700104 vector_foo_int:[int] (id: 23);
105 vector_foo_uint:[uint] (id: 24);
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700106
Alex Perrycb7da4b2019-08-28 19:35:56 -0700107 vector_foo_long:[long] (id: 25);
108 vector_foo_ulong:[ulong] (id: 26);
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700109
Alex Perrycb7da4b2019-08-28 19:35:56 -0700110 vector_foo_float:[float] (id: 27);
111 vector_foo_double:[double] (id: 28);
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700112
Alex Perrycb7da4b2019-08-28 19:35:56 -0700113 vector_foo_string:[string] (id: 29);
114
115 vector_foo_enum:[BaseType] (id: 30);
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700116
117 // And a simple nested application.
Alex Perrycb7da4b2019-08-28 19:35:56 -0700118 single_application:Application (id: 31);
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700119
120 // And nest this object to get some crazy coverage.
Alex Perrycb7da4b2019-08-28 19:35:56 -0700121 nested_config:Configuration (id: 32);
122
123 vov:VectorOfVectorOfString (id: 33);
Tyler Chatow5e369a42019-11-23 11:57:31 -0800124
125 foo_struct:FooStruct (id: 34);
126 vector_foo_struct:[FooStruct] (id: 35);
127 foo_struct_enum:StructEnum (id: 36);
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700128}
129
130root_type Configuration;