Lines Matching refs:Table
146 // values. They have little overhead compared to storing the table directly.
337 // accessor that directly gives you the root table:
715 // Make sure the table index is what we expect it to be.
952 void CompareTableFieldValue(flatbuffers::Table *table,
954 T read = table->GetField(voffset, static_cast<T>(0));
1018 auto table = reinterpret_cast<flatbuffers::Table *>(eob - objects[i]);
1023 case 0: CompareTableFieldValue(table, off, bool_val); break;
1024 case 1: CompareTableFieldValue(table, off, char_val); break;
1025 case 2: CompareTableFieldValue(table, off, uchar_val); break;
1026 case 3: CompareTableFieldValue(table, off, short_val); break;
1027 case 4: CompareTableFieldValue(table, off, ushort_val); break;
1028 case 5: CompareTableFieldValue(table, off, int_val); break;
1029 case 6: CompareTableFieldValue(table, off, uint_val); break;
1030 case 7: CompareTableFieldValue(table, off, long_val); break;
1031 case 8: CompareTableFieldValue(table, off, ulong_val); break;
1032 case 9: CompareTableFieldValue(table, off, float_val); break;
1033 case 10: CompareTableFieldValue(table, off, double_val); break;
1083 // generate random fields, some of which may be struct/table types
1095 ((is_struct ? "struct " : "table ") + definition_name + " {\n").c_str(),
1101 // Deprecate 1 in deprecation_rate fields. Only table fields can be
1255 TestError("table X { Y:byte; } root_type X; { Y: 999 }", "does not fit");
1258 TestError("table ///", "documentation");
1260 TestError("table 1", "expecting");
1261 TestError("table X { Y:[[int]]; }", "nested vector");
1262 TestError("table X { Y:1; }", "illegal type");
1263 TestError("table X { Y:int; Y:int; }", "field already");
1264 TestError("table Y {} table X { Y:int; }", "same as table");
1266 TestError("table X { Y:string = \"\"; }", "default values");
1267 TestError("enum Y:byte { Z = 1 } table X { y:Y; }", "not part of enum");
1269 TestError("union Z { X } table X { Y:Z; } root_type X; { Y: {}, A:1 }",
1271 TestError("union Z { X } table X { Y:Z; } root_type X; { Y_type: 99, Y: {",
1273 TestError("table X { Y:int; } root_type X; { Z:", "unknown field");
1274 TestError("table X { Y:int; } root_type X; { Y:", "string constant", true);
1275 TestError("table X { Y:int; } root_type X; { \"Y\":1, }", "string constant",
1278 "struct X { Y:int; Z:int; } table W { V:X; } root_type W; "
1281 TestError("enum E:byte { A } table X { Y:E; } root_type X; { Y:U }",
1283 TestError("table X { Y:byte; } root_type X; { Y:; }", "starting");
1289 TestError("table X { Y:int; } table X {", "datatype already");
1293 TestError("table X { Y:byte; } root_type X; { Y:1 } { Y:1 }", "end of file");
1294 TestError("table X { Y:byte; } root_type X; { Y:1 } table Y{ Z:int }",
1297 TestError("struct X { Y:int; } root_type X;", "a table");
1300 TestError("table X { Y:[int]; YLength:int; }", "clash");
1301 TestError("table X { Y:byte; } root_type X; { Y:1, Y:2 }", "more than once");
1303 TestError("table X { Y:int; } root_type X; { Y:1.0 }", "float");
1304 TestError("table X { Y:bool; } root_type X; { Y:1.0 }", "float");
1315 "table X { Y:" + std::string(type_name) + "; } root_type X;";
1330 auto root = flatbuffers::GetRoot<flatbuffers::Table>(
1385 TEST_EQ(parser1.Parse("struct Test { a:short; b:byte; } table T { F:[Test]; }"
1393 TEST_EQ(parser1.Parse("enum E:byte { A, B, C } table T { F:[E]; }"
1398 TEST_EQ(parser2.Parse("enum E:byte { A, B, C } table T { F:[int]; }"
1426 TestError("table Y{} union X { Y = -1 }",
1428 TestError("table Y{} union X { Y = 256 }", "enum value does not fit");
1429 TestError("table Y{} union X { Y = 255, Z:Y }", "enum value does not fit");
1443 TestError("table T { F:byte; } root_type T; { F:128 }",
1445 TestError("table T { F:byte; } root_type T; { F:-129 }",
1447 TestError("table T { F:ubyte; } root_type T; { F:256 }",
1449 TestError("table T { F:ubyte; } root_type T; { F:-1 }",
1451 TestError("table T { F:short; } root_type T; { F:32768 }",
1453 TestError("table T { F:short; } root_type T; { F:-32769 }",
1455 TestError("table T { F:ushort; } root_type T; { F:65536 }",
1457 TestError("table T { F:ushort; } root_type T; { F:-1 }",
1459 TestError("table T { F:int; } root_type T; { F:2147483648 }",
1461 TestError("table T { F:int; } root_type T; { F:-2147483649 }",
1463 TestError("table T { F:uint; } root_type T; { F:4294967296 }",
1465 TestError("table T { F:uint; } root_type T; { F:-1 }",
1468 TestError("table X { Y:uint8; } root_type X; { Y: -1 }", "does not fit");
1469 TestError("table X { Y:uint8; } root_type X; { Y: 256 }", "does not fit");
1470 TestError("table X { Y:uint16; } root_type X; { Y: -1 }", "does not fit");
1471 TestError("table X { Y:uint16; } root_type X; { Y: 65536 }", "does not fit");
1472 TestError("table X { Y:uint32; } root_type X; { Y: -1 }", "");
1473 TestError("table X { Y:uint32; } root_type X; { Y: 4294967296 }",
1475 TestError("table X { Y:uint64; } root_type X; { Y: -1 }", "");
1476 TestError("table X { Y:uint64; } root_type X; { Y: -9223372036854775809 }",
1478 TestError("table X { Y:uint64; } root_type X; { Y: 18446744073709551616 }",
1481 TestError("table X { Y:int8; } root_type X; { Y: -129 }", "does not fit");
1482 TestError("table X { Y:int8; } root_type X; { Y: 128 }", "does not fit");
1483 TestError("table X { Y:int16; } root_type X; { Y: -32769 }", "does not fit");
1484 TestError("table X { Y:int16; } root_type X; { Y: 32768 }", "does not fit");
1485 TestError("table X { Y:int32; } root_type X; { Y: -2147483649 }", "");
1486 TestError("table X { Y:int32; } root_type X; { Y: 2147483648 }",
1488 TestError("table X { Y:int64; } root_type X; { Y: -9223372036854775809 }",
1490 TestError("table X { Y:int64; } root_type X; { Y: 9223372036854775808 }",
1493 TestError("table X { Y:int8; } root_type X; { Y: -9223372036854775809 }",
1495 TestError("table X { Y:int8; } root_type X; { Y: 9223372036854775808 }",
1499 TestError("table X { Y:int64=-9223372036854775809; } root_type X; {}",
1501 TestError("table X { Y:int64= 9223372036854775808; } root_type X; {}",
1503 TestError("table X { Y:uint64; } root_type X; { Y: -1 }", "");
1504 TestError("table X { Y:uint64=-9223372036854775809; } root_type X; {}",
1506 TestError("table X { Y:uint64= 18446744073709551616; } root_type X; {}",
1621 TestError("table T { F:float; } root_type T; { F:1,0 }", "");
1622 TestError("table T { F:float; } root_type T; { F:. }", "");
1623 TestError("table T { F:float; } root_type T; { F:- }", invalid_msg);
1624 TestError("table T { F:float; } root_type T; { F:+ }", invalid_msg);
1625 TestError("table T { F:float; } root_type T; { F:-. }", invalid_msg);
1626 TestError("table T { F:float; } root_type T; { F:+. }", invalid_msg);
1627 TestError("table T { F:float; } root_type T; { F:.e }", "");
1628 TestError("table T { F:float; } root_type T; { F:-e }", invalid_msg);
1629 TestError("table T { F:float; } root_type T; { F:+e }", invalid_msg);
1630 TestError("table T { F:float; } root_type T; { F:-.e }", invalid_msg);
1631 TestError("table T { F:float; } root_type T; { F:+.e }", invalid_msg);
1632 TestError("table T { F:float; } root_type T; { F:-e1 }", invalid_msg);
1633 TestError("table T { F:float; } root_type T; { F:+e1 }", invalid_msg);
1634 TestError("table T { F:float; } root_type T; { F:1.0e+ }", invalid_msg);
1635 TestError("table T { F:float; } root_type T; { F:1.0e- }", invalid_msg);
1637 TestError("table T { F:float; } root_type T; { F:0x0 }", invalid_msg);
1638 TestError("table T { F:float; } root_type T; { F:-0x. }", invalid_msg);
1639 TestError("table T { F:float; } root_type T; { F:0x. }", invalid_msg);
1641 TestError("table T { F:float; } root_type T; { F:0x0.0e+ }", invalid_msg);
1642 TestError("table T { F:float; } root_type T; { F:0x0.0e- }", invalid_msg);
1643 TestError("table T { F:float; } root_type T; { F:0x0.0p }", invalid_msg);
1644 TestError("table T { F:float; } root_type T; { F:0x0.0p+ }", invalid_msg);
1645 TestError("table T { F:float; } root_type T; { F:0x0.0p- }", invalid_msg);
1646 TestError("table T { F:float; } root_type T; { F:0x0.0pa1 }", invalid_msg);
1647 TestError("table T { F:float; } root_type T; { F:0x0.0e+ }", invalid_msg);
1648 TestError("table T { F:float; } root_type T; { F:0x0.0e- }", invalid_msg);
1649 TestError("table T { F:float; } root_type T; { F:0x0.0e+0 }", invalid_msg);
1650 TestError("table T { F:float; } root_type T; { F:0x0.0e-0 }", invalid_msg);
1651 TestError("table T { F:float; } root_type T; { F:0x0.0ep+ }", invalid_msg);
1652 TestError("table T { F:float; } root_type T; { F:0x0.0ep- }", invalid_msg);
1653 TestError("table T { F:float; } root_type T; { F:1.2.3 }", invalid_msg);
1654 TestError("table T { F:float; } root_type T; { F:1.2.e3 }", invalid_msg);
1655 TestError("table T { F:float; } root_type T; { F:1.2e.3 }", invalid_msg);
1656 TestError("table T { F:float; } root_type T; { F:1.2e0.3 }", invalid_msg);
1657 TestError("table T { F:float; } root_type T; { F:1.2e3. }", invalid_msg);
1658 TestError("table T { F:float; } root_type T; { F:1.2e3.0 }", invalid_msg);
1659 TestError("table T { F:float; } root_type T; { F:+-1.0 }", invalid_msg);
1660 TestError("table T { F:float; } root_type T; { F:1.0e+-1 }", invalid_msg);
1661 TestError("table T { F:float; } root_type T; { F:\"1.0e+-1\" }", invalid_msg);
1662 TestError("table T { F:float; } root_type T; { F:1.e0e }", comma_msg);
1663 TestError("table T { F:float; } root_type T; { F:0x1.p0e }", comma_msg);
1664 TestError("table T { F:float; } root_type T; { F:\" 0x10 \" }", invalid_msg);
1666 TestError("table T { F:float; } root_type T; { F:\"1,2.\" }", invalid_msg);
1667 TestError("table T { F:float; } root_type T; { F:\"1.2e3.\" }", invalid_msg);
1668 TestError("table T { F:float; } root_type T; { F:\"0x1.p0e\" }", invalid_msg);
1669 TestError("table T { F:float; } root_type T; { F:\"0x1.0\" }", invalid_msg);
1670 TestError("table T { F:float; } root_type T; { F:\" 0x1.0\" }", invalid_msg);
1671 TestError("table T { F:float; } root_type T; { F:\"+ 0\" }", invalid_msg);
1673 TestError("table T { F:float; } root_type T; { F:\"\\f1.2e3.\" }", "invalid");
1674 TestError("table T { F:float; } root_type T; { F:\"\\t1.2e3.\" }", "invalid");
1675 TestError("table T { F:float; } root_type T; { F:\"\\n1.2e3.\" }", "invalid");
1676 TestError("table T { F:float; } root_type T; { F:\"\\r1.2e3.\" }", "invalid");
1677 TestError("table T { F:float; } root_type T; { F:\"4\\x005\" }", "invalid");
1678 TestError("table T { F:float; } root_type T; { F:\"\'12\'\" }", invalid_msg);
1680 TestError("table T { F:float; } root_type T; { F:\"null\" }", invalid_msg);
1681 TestError("table T { F:float; } root_type T; { F:null }", invalid_msg);
1738 TEST_EQ(parser.Parse("table T { F:string; }"
1759 "table T { F:string; }"
1782 "table T { F:string; }"
1800 TEST_EQ(parser.Parse("table T { F:string (id: 0); }"
1804 auto root = flatbuffers::GetRoot<flatbuffers::Table>(
1813 "table T { F:string; }"
1818 "table T { F:string; }"
1823 "table T { F:string; }"
1828 "table T { F:string; }"
1833 "table T { F:string; }"
1842 "table T { F:string; }"
1848 "table T { F:string; }"
1854 "table T { F:string; }"
1860 "table T { F:string; }"
1866 "table T { F:string; }"
1872 "table T { F:string; }"
1878 "table T { F:string; }"
1884 "table T { F:string; }"
1890 "table T { F:string; }"
1896 "table T { F:string; }"
1903 "table T { F:string; }"
1908 "table T { F:string; }"
1913 "table T { F:string; }"
1920 "table T { F:string; }"
1925 "table T { F:string; }"
1932 "table T { F:string; }"
1940 "table T { F:string; }"
1948 locale_ident += "table T { F";
1961 TEST_EQ(parser.Parse("table T { str:string; i:int;}"
1985 TEST_EQ(parser.Parse("table T { A:int; }"
1987 "table V { X:U; }"
1993 TEST_EQ(parser2.Parse("namespace N; table A {} namespace; union U { N.A }"
1994 "table B { e:U; } root_type B;"
2157 TEST_EQ(parser.Parse("table T { A:int; } enum E:byte { A }"), true);
2167 test_conform(parser, "table T { A:byte; }", "types differ for field");
2168 test_conform(parser, "table T { B:int; A:int; }", "offsets differ for field");
2169 test_conform(parser, "table T { A:int = 1; }", "defaults differ for field");
2170 test_conform(parser, "table T { B:float; }",
2183 parser.Parse("table S { B:int; } table T { A:[int]; C:S; } root_type T;"),