mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-08 06:05:17 +00:00
Refactor FieldDef to model presense as an enum rather than 2 bools. (#6420)
* Define presence. * Migrate to IsRequired and IsOptional methods * moved stuff around * Removed optional and required bools from FieldDef * change assert to return error * Fix tests.cpp * MakeFieldPresence helper * fmt * old c++ compatibility stuff Co-authored-by: Casper Neo <cneo@google.com>
This commit is contained in:
@@ -3654,7 +3654,7 @@ void OptionalScalarsTest() {
|
||||
flatbuffers::Parser parser;
|
||||
TEST_ASSERT(parser.Parse(schema->c_str()));
|
||||
const auto *mana = parser.structs_.Lookup("Monster")->fields.Lookup("mana");
|
||||
TEST_EQ(mana->optional, has_null);
|
||||
TEST_EQ(mana->IsOptional(), has_null);
|
||||
}
|
||||
|
||||
// Test if nullable scalars are allowed for each language.
|
||||
|
||||
Reference in New Issue
Block a user