blob: 7ce9ae69623b364d37eba45260f7ed6a522c3b5a [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 {
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080025 name:string (id: 0);
26 type:string (id: 1);
27 frequency:int (id: 2);
28 max_size:int (id: 3);
Austin Schuh3e95e5d2019-09-20 00:08:54 -070029}
30
31table Map {
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080032 match:Location (id: 0);
33 rename:Location (id: 1);
Austin Schuh3e95e5d2019-09-20 00:08:54 -070034}
35
36table Application {
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080037 name:string (id: 0);
38 priority:int (id: 1);
39 maps:[Map] (id: 2);
40 long_thingy:uint64 (id: 3);
Austin Schuh3e95e5d2019-09-20 00:08:54 -070041}
42
Alex Perrycb7da4b2019-08-28 19:35:56 -070043table VectorOfStrings {
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080044 str:[string] (id: 0);
Alex Perrycb7da4b2019-08-28 19:35:56 -070045}
46
47table VectorOfVectorOfString {
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080048 v:[VectorOfStrings] (id: 0);
Alex Perrycb7da4b2019-08-28 19:35:56 -070049}
50
Tyler Chatow5e369a42019-11-23 11:57:31 -080051struct FooStructNested {
52 foo_byte:byte;
53}
54
55struct FooStruct {
56 foo_byte:byte;
57 nested_struct:FooStructNested;
58}
59
60struct StructEnum {
61 foo_enum:BaseType;
62}
63
Austin Schuh3e95e5d2019-09-20 00:08:54 -070064table Configuration {
65 locations:[Location] (id: 0);
66 maps:[Map] (id: 1);
Austin Schuh09d7ffa2019-10-03 23:43:34 -070067 apps:[Application] (id: 2);
Austin Schuh3e95e5d2019-09-20 00:08:54 -070068 imports:[string] (id: 3);
69
70 // 8 bit: byte ubyte bool
71 // 16 bit: short ushort
72 // 32 bit: int uint float
73 // 64 bit: long ulong double
74
75 // Simple values.
76 foo_byte:byte (id: 4);
77 foo_ubyte:ubyte (id: 5);
78 foo_bool:bool (id: 6);
79
80 foo_short:short (id: 7);
81 foo_ushort:ushort (id: 8);
82
83 foo_int:int (id: 9);
84 foo_uint:uint (id: 10);
85
86 foo_long:long (id: 11);
87 foo_ulong:ulong (id: 12);
88
89 foo_float:float (id: 13);
90 foo_double:double (id: 14);
91
92 foo_string:string (id: 15);
93
Alex Perrycb7da4b2019-08-28 19:35:56 -070094 foo_enum:BaseType (id: 16);
95 foo_enum_default:BaseType = None (id: 17);
96
Austin Schuh3e95e5d2019-09-20 00:08:54 -070097 // Test vectors now.
Alex Perrycb7da4b2019-08-28 19:35:56 -070098 vector_foo_byte:[byte] (id: 18);
99 vector_foo_ubyte:[ubyte] (id: 19);
100 vector_foo_bool:[bool] (id: 20);
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700101
Alex Perrycb7da4b2019-08-28 19:35:56 -0700102 vector_foo_short:[short] (id: 21);
103 vector_foo_ushort:[ushort] (id: 22);
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700104
Alex Perrycb7da4b2019-08-28 19:35:56 -0700105 vector_foo_int:[int] (id: 23);
106 vector_foo_uint:[uint] (id: 24);
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700107
Alex Perrycb7da4b2019-08-28 19:35:56 -0700108 vector_foo_long:[long] (id: 25);
109 vector_foo_ulong:[ulong] (id: 26);
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700110
Alex Perrycb7da4b2019-08-28 19:35:56 -0700111 vector_foo_float:[float] (id: 27);
112 vector_foo_double:[double] (id: 28);
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700113
Alex Perrycb7da4b2019-08-28 19:35:56 -0700114 vector_foo_string:[string] (id: 29);
115
116 vector_foo_enum:[BaseType] (id: 30);
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700117
118 // And a simple nested application.
Alex Perrycb7da4b2019-08-28 19:35:56 -0700119 single_application:Application (id: 31);
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700120
121 // And nest this object to get some crazy coverage.
Alex Perrycb7da4b2019-08-28 19:35:56 -0700122 nested_config:Configuration (id: 32);
123
124 vov:VectorOfVectorOfString (id: 33);
Tyler Chatow5e369a42019-11-23 11:57:31 -0800125
126 foo_struct:FooStruct (id: 34);
127 vector_foo_struct:[FooStruct] (id: 35);
128 foo_struct_enum:StructEnum (id: 36);
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700129}
130
131root_type Configuration;