summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDerek Bailey <derekbailey@google.com>2023-05-09 21:50:28 -0700
committerGitHub <noreply@github.com>2023-05-09 21:50:28 -0700
commit10b79d87c19bd2d0f4fd061d623f3b08cb55a1a9 (patch)
treec05ee752775d9d37d36e0dd10908a380b0e87601 /tests
parent16a7df46f0aee4ea6f74f1e3af36a0eefa1caf05 (diff)
downloadflatbuffers-10b79d87c19bd2d0f4fd061d623f3b08cb55a1a9.tar.gz
flatbuffers-10b79d87c19bd2d0f4fd061d623f3b08cb55a1a9.tar.bz2
flatbuffers-10b79d87c19bd2d0f4fd061d623f3b08cb55a1a9.zip
removed extern code generation declarations preferring direct includes (#7948)
* removed extern code generation definitions, preferring direct includes * add static to functions * remove idl_gen_lua
Diffstat (limited to 'tests')
-rw-r--r--tests/proto_test.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/proto_test.cpp b/tests/proto_test.cpp
index 3480bc57..755ddd08 100644
--- a/tests/proto_test.cpp
+++ b/tests/proto_test.cpp
@@ -17,7 +17,10 @@ void RunTest(const flatbuffers::IDLOptions &opts, const std::string &proto_path,
TEST_EQ(parser.Parse(proto_file.c_str(), include_directories), true);
// Generate fbs.
- auto fbs = flatbuffers::GenerateFBS(parser, "test", true);
+ std::unique_ptr<CodeGenerator> fbs_generator = NewFBSCodeGenerator(true);
+ std::string fbs;
+ TEST_EQ(fbs_generator->GenerateCodeString(parser, "test", fbs),
+ CodeGenerator::Status::OK);
// Ensure generated file is parsable.
flatbuffers::Parser parser2;
@@ -27,7 +30,10 @@ void RunTest(const flatbuffers::IDLOptions &opts, const std::string &proto_path,
flatbuffers::Parser import_parser(opts);
TEST_EQ(import_parser.Parse(import_proto_file.c_str(), include_directories),
true);
- auto import_fbs = flatbuffers::GenerateFBS(import_parser, "test", true);
+ std::string import_fbs;
+ TEST_EQ(fbs_generator->GenerateCodeString(import_parser, "test", import_fbs),
+ CodeGenerator::Status::OK);
+ // auto import_fbs = flatbuffers::GenerateFBS(import_parser, "test", true);
// Since `imported.fbs` isn't in the filesystem AbsolutePath can't figure it
// out by itself. We manually construct it so Parser works.
std::string imported_fbs = flatbuffers::PosixPath(