From 0994a8f1b060bd953762f779ba367d4afdaac0e5 Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Wed, 21 Sep 2022 16:54:13 +0400 Subject: [PATCH] Dropped taskbarless test server With taskbar no longer being injected into the responses, it doesn't make any sense testing the search on different flavours of the server. --- test/server_search.cpp | 11 ++++------- test/server_testing_tools.h | 12 ------------ 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/test/server_search.cpp b/test/server_search.cpp index 435763d70..4f301f3e3 100644 --- a/test/server_search.cpp +++ b/test/server_search.cpp @@ -1453,16 +1453,13 @@ TEST_F(ServerTest, searchResults) for ( const auto& t : testData ) { const std::string htmlSearchUrl = t.url(); - const auto htmlRes = taskbarlessZimFileServer().GET(htmlSearchUrl.c_str()); + const auto htmlRes = zfs1_->GET(htmlSearchUrl.c_str()); EXPECT_EQ(htmlRes->status, 200); t.checkHtml(htmlRes->body); const std::string xmlSearchUrl = t.xmlSearchUrl(); - const auto xmlRes1 = zfs1_->GET(xmlSearchUrl.c_str()); - const auto xmlRes2 = taskbarlessZimFileServer().GET(xmlSearchUrl.c_str()); - EXPECT_EQ(xmlRes1->status, 200); - EXPECT_EQ(xmlRes2->status, 200); - EXPECT_EQ(xmlRes1->body, xmlRes2->body); - t.checkXml(xmlRes1->body); + const auto xmlRes = zfs1_->GET(xmlSearchUrl.c_str()); + EXPECT_EQ(xmlRes->status, 200); + t.checkXml(xmlRes->body); } } diff --git a/test/server_testing_tools.h b/test/server_testing_tools.h index f9b96dc21..c1eae3b30 100644 --- a/test/server_testing_tools.h +++ b/test/server_testing_tools.h @@ -136,9 +136,6 @@ ZimFileServer::~ZimFileServer() class ServerTest : public ::testing::Test { -private: - std::unique_ptr taskbarlessZfs_; - protected: std::unique_ptr zfs1_; @@ -154,16 +151,7 @@ protected: zfs1_.reset(new ZimFileServer(SERVER_PORT, /*withTaskbar=*/true, ZIMFILES)); } - ZimFileServer& taskbarlessZimFileServer() - { - if ( ! taskbarlessZfs_ ) { - taskbarlessZfs_.reset(new ZimFileServer(SERVER_PORT+1, /*withTaskbar=*/false, ZIMFILES)); - } - return *taskbarlessZfs_; - } - void TearDown() override { zfs1_.reset(); - taskbarlessZfs_.reset(); } };