summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorengedy <engedy@google.com>2022-12-21 23:59:34 +0100
committerGitHub <noreply@github.com>2022-12-21 14:59:34 -0800
commitb47ba1d5ffae3bd4d5eaad615e33d7cc5c1e3d4a (patch)
tree578bbcd8a4f83c0348f4b7567d3c18b4dbfcca7c
parenta078130c878b0f997af24d532c6ade903ea7f65b (diff)
downloadflatbuffers-b47ba1d5ffae3bd4d5eaad615e33d7cc5c1e3d4a.tar.gz
flatbuffers-b47ba1d5ffae3bd4d5eaad615e33d7cc5c1e3d4a.tar.bz2
flatbuffers-b47ba1d5ffae3bd4d5eaad615e33d7cc5c1e3d4a.zip
Add include guards around DoNotRequireEofTest (#7728)
Guard DoNotRequireEofTest against -Wunused-function on platforms without file tests.
-rw-r--r--tests/test.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/test.cpp b/tests/test.cpp
index 15d0d4fc..96a07640 100644
--- a/tests/test.cpp
+++ b/tests/test.cpp
@@ -1419,6 +1419,8 @@ void NativeInlineTableVectorTest() {
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) {
std::string schemafile;
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(monster->hp(), 10);
}
+#endif
int FlatBufferTests(const std::string &tests_data_path) {
// Run our various test suites: