From 62496ccb01733218ce082afe5efc280f1355cb59 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Thu, 31 Aug 2023 11:23:00 +0200 Subject: [PATCH] Define function use with `WITH_TEST_DATA` only if `WITH_TEST_DATA`. Or else, they will be detected as defined but not used. --- test/archive.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/archive.cpp b/test/archive.cpp index fb172834c..ee6eee983 100644 --- a/test/archive.cpp +++ b/test/archive.cpp @@ -481,7 +481,7 @@ TEST(ZimArchive, validate) EXPECT_BROKEN_ZIMFILE(testfile.path, expected) } } -#endif + void checkEquivalence(const zim::Archive& archive1, const zim::Archive& archive2) { @@ -559,7 +559,6 @@ void checkEquivalence(const zim::Archive& archive1, const zim::Archive& archive2 #endif } -#if WITH_TEST_DATA TEST(ZimArchive, multipart) { auto nonSplittedZims = getDataFilePath("wikibooks_be_all_nopic_2017-02.zim"); @@ -617,6 +616,8 @@ TEST(ZimArchive, openZIMFileEmbeddedInAnotherFile) #endif // not _WIN32 #endif // WITH_TEST_DATA + +#if WITH_TEST_DATA zim::Blob readItemData(const zim::Item::DirectAccessInfo& dai, zim::size_type size) { zim::DEFAULTFS::FD fd(zim::DEFAULTFS::openFile(dai.first)); @@ -625,7 +626,6 @@ zim::Blob readItemData(const zim::Item::DirectAccessInfo& dai, zim::size_type si return zim::Blob(data, size); } -#if WITH_TEST_DATA TEST(ZimArchive, getDirectAccessInformation) { for(auto& testfile:getDataFilePath("small.zim")) {