mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-24 10:01:48 +00:00
Add include guards around DoNotRequireEofTest (#7728)
Guard DoNotRequireEofTest against -Wunused-function on platforms without file tests.
This commit is contained in:
@@ -1419,6 +1419,8 @@ void NativeInlineTableVectorTest() {
|
|||||||
TEST_ASSERT(unpacked.t == test.t);
|
TEST_ASSERT(unpacked.t == test.t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Guard against -Wunused-function on platforms without file tests.
|
||||||
|
#ifndef FLATBUFFERS_NO_FILE_TESTS
|
||||||
void DoNotRequireEofTest(const std::string &tests_data_path) {
|
void DoNotRequireEofTest(const std::string &tests_data_path) {
|
||||||
std::string schemafile;
|
std::string schemafile;
|
||||||
bool ok = flatbuffers::LoadFile(
|
bool ok = flatbuffers::LoadFile(
|
||||||
@@ -1460,6 +1462,7 @@ void DoNotRequireEofTest(const std::string &tests_data_path) {
|
|||||||
TEST_EQ_STR(monster->name()->c_str(), "Imp");
|
TEST_EQ_STR(monster->name()->c_str(), "Imp");
|
||||||
TEST_EQ(monster->hp(), 10);
|
TEST_EQ(monster->hp(), 10);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int FlatBufferTests(const std::string &tests_data_path) {
|
int FlatBufferTests(const std::string &tests_data_path) {
|
||||||
// Run our various test suites:
|
// Run our various test suites:
|
||||||
|
|||||||
Reference in New Issue
Block a user