mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-08 22:20:56 +00:00
GenerateText gives text error on failure
This commit is contained in:
@@ -626,7 +626,7 @@ void TestMonsterExtraFloats(const std::string &tests_data_path) {
|
||||
TEST_EQ(def_extra->d3(), -infinity_d);
|
||||
std::string jsongen;
|
||||
auto result = GenerateText(parser, def_obj, &jsongen);
|
||||
TEST_EQ(result, true);
|
||||
TEST_NULL(result);
|
||||
// Check expected default values.
|
||||
TEST_EQ(std::string::npos != jsongen.find("f0: nan"), true);
|
||||
TEST_EQ(std::string::npos != jsongen.find("f1: nan"), true);
|
||||
@@ -777,7 +777,7 @@ void ParseAndGenerateTextTest(const std::string &tests_data_path, bool binary) {
|
||||
std::string jsongen;
|
||||
auto result =
|
||||
GenerateText(parser, parser.builder_.GetBufferPointer(), &jsongen);
|
||||
TEST_EQ(result, true);
|
||||
TEST_NULL(result);
|
||||
TEST_EQ_STR(jsongen.c_str(), jsonfile.c_str());
|
||||
|
||||
// We can also do the above using the convenient Registry that knows about
|
||||
@@ -815,9 +815,8 @@ void ParseAndGenerateTextTest(const std::string &tests_data_path, bool binary) {
|
||||
// request natural printing for utf-8 strings
|
||||
parser.opts.natural_utf8 = true;
|
||||
parser.opts.strict_json = true;
|
||||
TEST_EQ(
|
||||
GenerateText(parser, parser.builder_.GetBufferPointer(), &jsongen_utf8),
|
||||
true);
|
||||
TEST_NULL(
|
||||
GenerateText(parser, parser.builder_.GetBufferPointer(), &jsongen_utf8));
|
||||
TEST_EQ_STR(jsongen_utf8.c_str(), jsonfile_utf8.c_str());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user