GenerateText gives text error on failure

This commit is contained in:
Wouter van Oortmerssen
2023-05-03 13:03:00 -07:00
parent c1e7aee489
commit ed11b08fc9
14 changed files with 122 additions and 112 deletions

View File

@@ -317,9 +317,9 @@ void ParseProtoBufAsciiTest() {
TEST_EQ(parser.Parse("{ A [1 2] C { B:2 }}"), true);
// Similarly, in text output, it should omit these.
std::string text;
auto ok = flatbuffers::GenerateText(
auto err = flatbuffers::GenerateText(
parser, parser.builder_.GetBufferPointer(), &text);
TEST_EQ(ok, true);
TEST_NULL(err);
TEST_EQ_STR(text.c_str(),
"{\n A [\n 1\n 2\n ]\n C {\n B: 2\n }\n}\n");
}