From 2749564424200ae93355099062ba842ffa05349e Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Tue, 5 Mar 2024 17:57:22 +0400 Subject: [PATCH] Made entries in test library point to "different" files Two entries in test library.xml used to point to the same file path. Note that though the third entry pointed to a different file name it is a symbolic link to the same file. Now all three entries point to pseudo-different files (having the same content behind them). This change is needed so that tests don't break when detection of conflicting book names is made stricter. --- test/data/library.xml | 8 ++--- test/data/zimfile_raycharles.zim | 1 + .../data/zimfile_raycharles_uncategorized.zim | 1 + test/library_server.cpp | 30 +++++++++---------- test/meson.build | 2 ++ 5 files changed, 23 insertions(+), 19 deletions(-) create mode 120000 test/data/zimfile_raycharles.zim create mode 120000 test/data/zimfile_raycharles_uncategorized.zim diff --git a/test/data/library.xml b/test/data/library.xml index 7a2fcdf9c..1c1fe4886 100644 --- a/test/data/library.xml +++ b/test/data/library.xml @@ -1,8 +1,8 @@ \n ", \ CONTENT_NAME, \ - "zimfile", \ + "zimfile_raycharles", \ "569344"\ ) -#define RAY_CHARLES_CATALOG_ENTRY _RAY_CHARLES_CATALOG_ENTRY("zimfile") +#define RAY_CHARLES_CATALOG_ENTRY _RAY_CHARLES_CATALOG_ENTRY("zimfile_raycharles") #define RAY_CHARLES_CATALOG_ENTRY_NO_MAPPER _RAY_CHARLES_CATALOG_ENTRY("raycharles") #define UNCATEGORIZED_RAY_CHARLES_CATALOG_ENTRY CATALOG_ENTRY(\ @@ -145,8 +145,8 @@ std::string maskVariableOPDSFeedData(std::string s) "",\ "public_tag_with_a_value:value_of_a_public_tag;_private_tag_with_a_value:value_of_a_private_tag;wikipedia;_pictures:no;_videos:no;_details:no",\ "",\ - "zimfile", \ - "zimfile", \ + "zimfile_raycharles_uncategorized", \ + "zimfile_raycharles_uncategorized", \ "125952"\ ) @@ -1110,10 +1110,10 @@ TEST_F(LibraryServerTest, no_name_mapper_catalog_v2_individual_entry_access) " \n" \ @@ -1130,10 +1130,10 @@ TEST_F(LibraryServerTest, no_name_mapper_catalog_v2_individual_entry_access) " \n" \ @@ -1224,16 +1224,16 @@ TEST_F(LibraryServerTest, no_name_mapper_catalog_v2_individual_entry_access) "
\n" \ " Download links for Ray (uncategorized) Charles\n" \ "
\n" \ - " \n" \ + " \n" \ "
Direct
\n" \ "
\n" \ - " \n" \ + " \n" \ "
Sha256 hash
\n" \ "
\n" \ - " \n" \ + " \n" \ "
Magnet link
\n" \ "
\n" \ - " \n" \ + " \n" \ "
Torrent file
\n" \ "
\n" \ "\n" \ @@ -1273,7 +1273,7 @@ TEST_F(LibraryServerTest, noJS) { FINAL_HTML_TEXT); // no_js_download - r = zfs1_->GET("/ROOT%23%3F/nojs/download/zimfile"); + r = zfs1_->GET("/ROOT%23%3F/nojs/download/zimfile_raycharles_uncategorized"); EXPECT_EQ(r->status, 200); EXPECT_EQ(r->body, RAY_CHARLES_UNCTZ_DOWNLOAD); } diff --git a/test/meson.build b/test/meson.build index 78446f473..aa55e1d5f 100644 --- a/test/meson.build +++ b/test/meson.build @@ -38,6 +38,8 @@ if gtest_dep.found() and not meson.is_cross_build() 'example.zim', 'zimfile.zim', 'zimfile&other.zim', + 'zimfile_raycharles.zim', + 'zimfile_raycharles_uncategorized.zim', 'corner_cases#&.zim', 'poor.zim', 'library.xml',