From 59fea7cc603e221d21e998a912d78df12e0760ac Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Mon, 19 Apr 2021 14:48:13 +0200 Subject: [PATCH] Move "normal" (older) zim files under the name "withns". "normal" is normal only for a time. They will become old with time. It is better to name them by their characteristics. --- test/archive.cpp | 6 +++--- .../invalid.bad_mimetype_in_dirent.zim | Bin .../invalid.bad_mimetype_list.zim | Bin .../invalid.invalid_checksumpos.zim | Bin .../invalid.invalid_mimelistpos.zim | Bin .../invalid.nonsorted_dirent_table.zim | Bin .../invalid.nonsorted_title_index.zim | Bin .../invalid.outofbounds_clusterptrpos.zim | Bin .../invalid.outofbounds_first_clusterptr.zim | Bin .../invalid.outofbounds_first_direntptr.zim | Bin .../invalid.outofbounds_first_title_entry.zim | Bin .../invalid.outofbounds_last_direntptr.zim | Bin .../invalid.outofbounds_last_title_entry.zim | Bin .../invalid.outofbounds_titleptrpos.zim | Bin .../invalid.outofbounds_urlptrpos.zim | Bin .../invalid.smaller_than_header.zim | Bin test/data/{normal => withns}/small.zim | Bin test/data/{normal => withns}/small.zim.embedded | Bin .../wikibooks_be_all_nopic_2017-02.zim | Bin .../wikibooks_be_all_nopic_2017-02_splitted.zimaa | Bin .../wikibooks_be_all_nopic_2017-02_splitted.zimab | Bin .../wikibooks_be_all_nopic_2017-02_splitted.zimac | Bin .../wikipedia_en_climate_change_nopic_2020-01.zim | Bin test/find.cpp | 2 +- test/iterator.cpp | 10 +++++----- test/tools.cpp | 2 +- 26 files changed, 10 insertions(+), 10 deletions(-) rename test/data/{normal => withns}/invalid.bad_mimetype_in_dirent.zim (100%) rename test/data/{normal => withns}/invalid.bad_mimetype_list.zim (100%) rename test/data/{normal => withns}/invalid.invalid_checksumpos.zim (100%) rename test/data/{normal => withns}/invalid.invalid_mimelistpos.zim (100%) rename test/data/{normal => withns}/invalid.nonsorted_dirent_table.zim (100%) rename test/data/{normal => withns}/invalid.nonsorted_title_index.zim (100%) rename test/data/{normal => withns}/invalid.outofbounds_clusterptrpos.zim (100%) rename test/data/{normal => withns}/invalid.outofbounds_first_clusterptr.zim (100%) rename test/data/{normal => withns}/invalid.outofbounds_first_direntptr.zim (100%) rename test/data/{normal => withns}/invalid.outofbounds_first_title_entry.zim (100%) rename test/data/{normal => withns}/invalid.outofbounds_last_direntptr.zim (100%) rename test/data/{normal => withns}/invalid.outofbounds_last_title_entry.zim (100%) rename test/data/{normal => withns}/invalid.outofbounds_titleptrpos.zim (100%) rename test/data/{normal => withns}/invalid.outofbounds_urlptrpos.zim (100%) rename test/data/{normal => withns}/invalid.smaller_than_header.zim (100%) rename test/data/{normal => withns}/small.zim (100%) rename test/data/{normal => withns}/small.zim.embedded (100%) rename test/data/{normal => withns}/wikibooks_be_all_nopic_2017-02.zim (100%) rename test/data/{normal => withns}/wikibooks_be_all_nopic_2017-02_splitted.zimaa (100%) rename test/data/{normal => withns}/wikibooks_be_all_nopic_2017-02_splitted.zimab (100%) rename test/data/{normal => withns}/wikibooks_be_all_nopic_2017-02_splitted.zimac (100%) rename test/data/{normal => withns}/wikipedia_en_climate_change_nopic_2020-01.zim (100%) diff --git a/test/archive.cpp b/test/archive.cpp index 04c2236c0..b75cbabd2 100644 --- a/test/archive.cpp +++ b/test/archive.cpp @@ -235,7 +235,7 @@ TEST(ZimArchive, validate) for(auto& testfile: getDataFilePath("invalid.outofbounds_titleptrpos.zim")) { std::string expected; - if (testfile.category == "normal") { + if (testfile.category == "withns") { expected = "Title index table outside (or not fully inside) ZIM file.\n"; } else { expected = "Full Title index table outside (or not fully inside) ZIM file.\n"; @@ -286,7 +286,7 @@ TEST(ZimArchive, validate) for(auto& testfile: getDataFilePath("invalid.nonsorted_dirent_table.zim")) { std::string expected; - if (testfile.category == "normal") { + if (testfile.category == "withns") { expected = "Dirent table is not properly sorted:\n" " #0: A/main.html\n" " #1: -/favicon\n"; @@ -310,7 +310,7 @@ TEST(ZimArchive, validate) for(auto& testfile: getDataFilePath("invalid.bad_mimetype_in_dirent.zim")) { std::string expected; - if (testfile.category == "normal") { + if (testfile.category == "withns") { expected = "Entry M/Language has invalid MIME-type value 1234.\n"; } else { expected = "Entry M/Scraper has invalid MIME-type value 1234.\n"; diff --git a/test/data/normal/invalid.bad_mimetype_in_dirent.zim b/test/data/withns/invalid.bad_mimetype_in_dirent.zim similarity index 100% rename from test/data/normal/invalid.bad_mimetype_in_dirent.zim rename to test/data/withns/invalid.bad_mimetype_in_dirent.zim diff --git a/test/data/normal/invalid.bad_mimetype_list.zim b/test/data/withns/invalid.bad_mimetype_list.zim similarity index 100% rename from test/data/normal/invalid.bad_mimetype_list.zim rename to test/data/withns/invalid.bad_mimetype_list.zim diff --git a/test/data/normal/invalid.invalid_checksumpos.zim b/test/data/withns/invalid.invalid_checksumpos.zim similarity index 100% rename from test/data/normal/invalid.invalid_checksumpos.zim rename to test/data/withns/invalid.invalid_checksumpos.zim diff --git a/test/data/normal/invalid.invalid_mimelistpos.zim b/test/data/withns/invalid.invalid_mimelistpos.zim similarity index 100% rename from test/data/normal/invalid.invalid_mimelistpos.zim rename to test/data/withns/invalid.invalid_mimelistpos.zim diff --git a/test/data/normal/invalid.nonsorted_dirent_table.zim b/test/data/withns/invalid.nonsorted_dirent_table.zim similarity index 100% rename from test/data/normal/invalid.nonsorted_dirent_table.zim rename to test/data/withns/invalid.nonsorted_dirent_table.zim diff --git a/test/data/normal/invalid.nonsorted_title_index.zim b/test/data/withns/invalid.nonsorted_title_index.zim similarity index 100% rename from test/data/normal/invalid.nonsorted_title_index.zim rename to test/data/withns/invalid.nonsorted_title_index.zim diff --git a/test/data/normal/invalid.outofbounds_clusterptrpos.zim b/test/data/withns/invalid.outofbounds_clusterptrpos.zim similarity index 100% rename from test/data/normal/invalid.outofbounds_clusterptrpos.zim rename to test/data/withns/invalid.outofbounds_clusterptrpos.zim diff --git a/test/data/normal/invalid.outofbounds_first_clusterptr.zim b/test/data/withns/invalid.outofbounds_first_clusterptr.zim similarity index 100% rename from test/data/normal/invalid.outofbounds_first_clusterptr.zim rename to test/data/withns/invalid.outofbounds_first_clusterptr.zim diff --git a/test/data/normal/invalid.outofbounds_first_direntptr.zim b/test/data/withns/invalid.outofbounds_first_direntptr.zim similarity index 100% rename from test/data/normal/invalid.outofbounds_first_direntptr.zim rename to test/data/withns/invalid.outofbounds_first_direntptr.zim diff --git a/test/data/normal/invalid.outofbounds_first_title_entry.zim b/test/data/withns/invalid.outofbounds_first_title_entry.zim similarity index 100% rename from test/data/normal/invalid.outofbounds_first_title_entry.zim rename to test/data/withns/invalid.outofbounds_first_title_entry.zim diff --git a/test/data/normal/invalid.outofbounds_last_direntptr.zim b/test/data/withns/invalid.outofbounds_last_direntptr.zim similarity index 100% rename from test/data/normal/invalid.outofbounds_last_direntptr.zim rename to test/data/withns/invalid.outofbounds_last_direntptr.zim diff --git a/test/data/normal/invalid.outofbounds_last_title_entry.zim b/test/data/withns/invalid.outofbounds_last_title_entry.zim similarity index 100% rename from test/data/normal/invalid.outofbounds_last_title_entry.zim rename to test/data/withns/invalid.outofbounds_last_title_entry.zim diff --git a/test/data/normal/invalid.outofbounds_titleptrpos.zim b/test/data/withns/invalid.outofbounds_titleptrpos.zim similarity index 100% rename from test/data/normal/invalid.outofbounds_titleptrpos.zim rename to test/data/withns/invalid.outofbounds_titleptrpos.zim diff --git a/test/data/normal/invalid.outofbounds_urlptrpos.zim b/test/data/withns/invalid.outofbounds_urlptrpos.zim similarity index 100% rename from test/data/normal/invalid.outofbounds_urlptrpos.zim rename to test/data/withns/invalid.outofbounds_urlptrpos.zim diff --git a/test/data/normal/invalid.smaller_than_header.zim b/test/data/withns/invalid.smaller_than_header.zim similarity index 100% rename from test/data/normal/invalid.smaller_than_header.zim rename to test/data/withns/invalid.smaller_than_header.zim diff --git a/test/data/normal/small.zim b/test/data/withns/small.zim similarity index 100% rename from test/data/normal/small.zim rename to test/data/withns/small.zim diff --git a/test/data/normal/small.zim.embedded b/test/data/withns/small.zim.embedded similarity index 100% rename from test/data/normal/small.zim.embedded rename to test/data/withns/small.zim.embedded diff --git a/test/data/normal/wikibooks_be_all_nopic_2017-02.zim b/test/data/withns/wikibooks_be_all_nopic_2017-02.zim similarity index 100% rename from test/data/normal/wikibooks_be_all_nopic_2017-02.zim rename to test/data/withns/wikibooks_be_all_nopic_2017-02.zim diff --git a/test/data/normal/wikibooks_be_all_nopic_2017-02_splitted.zimaa b/test/data/withns/wikibooks_be_all_nopic_2017-02_splitted.zimaa similarity index 100% rename from test/data/normal/wikibooks_be_all_nopic_2017-02_splitted.zimaa rename to test/data/withns/wikibooks_be_all_nopic_2017-02_splitted.zimaa diff --git a/test/data/normal/wikibooks_be_all_nopic_2017-02_splitted.zimab b/test/data/withns/wikibooks_be_all_nopic_2017-02_splitted.zimab similarity index 100% rename from test/data/normal/wikibooks_be_all_nopic_2017-02_splitted.zimab rename to test/data/withns/wikibooks_be_all_nopic_2017-02_splitted.zimab diff --git a/test/data/normal/wikibooks_be_all_nopic_2017-02_splitted.zimac b/test/data/withns/wikibooks_be_all_nopic_2017-02_splitted.zimac similarity index 100% rename from test/data/normal/wikibooks_be_all_nopic_2017-02_splitted.zimac rename to test/data/withns/wikibooks_be_all_nopic_2017-02_splitted.zimac diff --git a/test/data/normal/wikipedia_en_climate_change_nopic_2020-01.zim b/test/data/withns/wikipedia_en_climate_change_nopic_2020-01.zim similarity index 100% rename from test/data/normal/wikipedia_en_climate_change_nopic_2020-01.zim rename to test/data/withns/wikipedia_en_climate_change_nopic_2020-01.zim diff --git a/test/find.cpp b/test/find.cpp index 7383d182a..c038ef039 100644 --- a/test/find.cpp +++ b/test/find.cpp @@ -95,7 +95,7 @@ TEST(FindTests, ByTitle) // By Path TEST(FindTests, ByPath) { - for(auto& testfile:getDataFilePath("wikibooks_be_all_nopic_2017-02.zim", "normal")) { + for(auto& testfile:getDataFilePath("wikibooks_be_all_nopic_2017-02.zim", "withns")) { zim::Archive archive (testfile.path); auto range0 = archive.findByPath("A/Main_Page.html"); diff --git a/test/iterator.cpp b/test/iterator.cpp index 3222dc292..5cc6b3795 100644 --- a/test/iterator.cpp +++ b/test/iterator.cpp @@ -39,7 +39,7 @@ TEST(ClusterIteratorTest, getEntryByClusterOrder) 117, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108 }; - for(auto& testfile:getDataFilePath("wikibooks_be_all_nopic_2017-02.zim", "normal")) { + for(auto& testfile:getDataFilePath("wikibooks_be_all_nopic_2017-02.zim", "withns")) { zim::Archive archive (testfile.path); auto nbEntries = archive.getEntryCount(); @@ -55,7 +55,7 @@ TEST(ClusterIteratorTest, getEntryByClusterOrder) TEST(getEntry, indexOutOfRange) { - for(auto& testfile:getDataFilePath("wikibooks_be_all_nopic_2017-02.zim", "normal")) { + for(auto& testfile:getDataFilePath("wikibooks_be_all_nopic_2017-02.zim", "withns")) { zim::Archive archive (testfile.path); auto nbEntries = archive.getEntryCount(); @@ -82,7 +82,7 @@ TEST(IteratorTests, begin) 117, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108 }; - for(auto& testfile:getDataFilePath("wikibooks_be_all_nopic_2017-02.zim", "normal")) { + for(auto& testfile:getDataFilePath("wikibooks_be_all_nopic_2017-02.zim", "withns")) { zim::Archive archive (testfile.path); int i = 0; @@ -99,7 +99,7 @@ TEST(IteratorTests, beginByTitle) { std::vector expected = { 0, 1, 2, 3, 4, 5, 7, 8, 9, 10}; - for(auto& testfile:getDataFilePath("wikibooks_be_all_nopic_2017-02.zim", "normal")) { + for(auto& testfile:getDataFilePath("wikibooks_be_all_nopic_2017-02.zim", "withns")) { zim::Archive archive (testfile.path); auto it = archive.iterByTitle().begin(); @@ -120,7 +120,7 @@ TEST(IteratorTests, beginByPath) { std::vector expected = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; - for(auto& testfile:getDataFilePath("wikibooks_be_all_nopic_2017-02.zim", "normal")) { + for(auto& testfile:getDataFilePath("wikibooks_be_all_nopic_2017-02.zim", "withns")) { zim::Archive archive (testfile.path); auto it = archive.iterByPath().begin(); diff --git a/test/tools.cpp b/test/tools.cpp index 96da1d078..041f15e02 100644 --- a/test/tools.cpp +++ b/test/tools.cpp @@ -132,7 +132,7 @@ const std::vector getDataFilePath(const std::string& filename, const s // We don't have dirent.h in windows. // If we move to test data out of the repository, we will need a way to discover the data. // Use a static list of categories for now. - for (auto& category: {"normal", "nons"}) { + for (auto& category: {"withns", "nons"}) { filePaths.emplace_back(dataDirPath, category, filename); } #else