diff options
author | Derek Bailey <derekbailey@google.com> | 2023-05-09 21:50:28 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-09 21:50:28 -0700 |
commit | 10b79d87c19bd2d0f4fd061d623f3b08cb55a1a9 (patch) | |
tree | c05ee752775d9d37d36e0dd10908a380b0e87601 /tests | |
parent | 16a7df46f0aee4ea6f74f1e3af36a0eefa1caf05 (diff) | |
download | flatbuffers-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.cpp | 10 |
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( |