mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-09 22:56:27 +00:00
run scripts/clang-format-all.sh
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
|
||||
#include "flatbuffers/flatbuffers.h"
|
||||
#include "flatbuffers/idl.h"
|
||||
#include "monster_test_bfbs_generated.h"
|
||||
#include "monster_test_generated.h"
|
||||
#include "monster_test_bfbs_generated.h"
|
||||
#include "optional_scalars_generated.h"
|
||||
#include "test_assert.h"
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace tests {
|
||||
using namespace MyGame::Example;
|
||||
|
||||
// Check stringify of an default enum value to json
|
||||
void JsonDefaultTest(const std::string& tests_data_path) {
|
||||
void JsonDefaultTest(const std::string &tests_data_path) {
|
||||
// load FlatBuffer schema (.fbs) from disk
|
||||
std::string schemafile;
|
||||
TEST_EQ(flatbuffers::LoadFile((tests_data_path + "monster_test.fbs").c_str(),
|
||||
@@ -44,7 +44,7 @@ void JsonDefaultTest(const std::string& tests_data_path) {
|
||||
TEST_EQ(std::string::npos != jsongen.find("testf: 3.14159"), true);
|
||||
}
|
||||
|
||||
void JsonEnumsTest(const std::string& tests_data_path) {
|
||||
void JsonEnumsTest(const std::string &tests_data_path) {
|
||||
// load FlatBuffer schema (.fbs) from disk
|
||||
std::string schemafile;
|
||||
TEST_EQ(flatbuffers::LoadFile((tests_data_path + "monster_test.fbs").c_str(),
|
||||
@@ -83,7 +83,8 @@ void JsonEnumsTest(const std::string& tests_data_path) {
|
||||
TEST_EQ(std::string::npos != future_json.find("color: 13"), true);
|
||||
}
|
||||
|
||||
void JsonOptionalTest(const std::string& tests_data_path, bool default_scalars) {
|
||||
void JsonOptionalTest(const std::string &tests_data_path,
|
||||
bool default_scalars) {
|
||||
// load FlatBuffer schema (.fbs) and JSON from disk
|
||||
std::string schemafile;
|
||||
std::string jsonfile;
|
||||
@@ -124,7 +125,7 @@ void JsonOptionalTest(const std::string& tests_data_path, bool default_scalars)
|
||||
TEST_EQ_STR(jsongen.c_str(), jsonfile.c_str());
|
||||
}
|
||||
|
||||
void ParseIncorrectMonsterJsonTest(const std::string& tests_data_path) {
|
||||
void ParseIncorrectMonsterJsonTest(const std::string &tests_data_path) {
|
||||
std::string schemafile;
|
||||
TEST_EQ(flatbuffers::LoadFile((tests_data_path + "monster_test.bfbs").c_str(),
|
||||
true, &schemafile),
|
||||
@@ -179,7 +180,7 @@ table JsonUnionStructTest { union_with_struct: UnionWithStruct; }
|
||||
root_type JsonUnionStructTest;
|
||||
)";
|
||||
// source text to parse and expected result of generation text back
|
||||
auto json_source =R"({
|
||||
auto json_source = R"({
|
||||
union_with_struct_type: "MyStruct",
|
||||
union_with_struct: {
|
||||
field: 12345
|
||||
|
||||
Reference in New Issue
Block a user