blob: 97b0feff63309d2157f642dae898c8f444003e7c [file] [log] [blame]
James Kuszmaulf5eb4682023-09-22 17:16:59 -07001include "aos/flatbuffers/test_dir/include.fbs";
2
3// TODO: test example with multiple namespaces per file.
4namespace aos.fbs.testing;
5
6struct SubStruct {
7 x:double;
8 y:double;
9}
10
James Kuszmaula75cd7c2023-12-07 15:52:51 -080011table MinimallyAlignedTable {
12 field:ubyte (id: 0);
13}
14
James Kuszmaulf5eb4682023-09-22 17:16:59 -070015table SubTable {
16 foo:short (id: 0);
17 bar:short (id: 1, deprecated);
18 baz:float (id: 2);
19}
20
21attribute "static_length";
22attribute "static_vector_string_length";
23
24table TestTable {
25 scalar:int (id: 0);
26 vector_of_scalars:[int] (id: 1, static_length: 3);
27 string:string (id: 2, static_length: 20);
28 vector_of_strings:[string] (id: 3, static_length: 3, static_vector_string_length: 10);
29 substruct:SubStruct (id: 4);
30 subtable:SubTable (id: 5);
31 // The force-aligned vector is deliberately put in the middle of the table
32 // both by ID and alphabetically (both of these can affect the order in which
33 // certain things are evaluated, and during development there were some issues
34 // with this).
35 vector_aligned:[int] (id: 6, force_align: 64, static_length: 3);
36 vector_of_structs:[SubStruct] (id: 7, static_length: 3);
37 vector_of_tables:[SubTable] (id: 8, static_length: 3);
38 included_table:aos.fbs.testing.included.IncludedTable (id: 9);
39 unspecified_length_vector:[ubyte] (id: 10);
40 unspecified_length_string:string (id: 11);
41 unspecified_length_vector_of_strings:[string] (id: 12);
42}
43
44root_type TestTable;