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.
This commit is contained in:
Veloman Yunkan 2022-09-21 16:54:13 +04:00
parent fa67b45f50
commit 0994a8f1b0
2 changed files with 4 additions and 19 deletions

View File

@ -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);
}
}

View File

@ -136,9 +136,6 @@ ZimFileServer::~ZimFileServer()
class ServerTest : public ::testing::Test
{
private:
std::unique_ptr<ZimFileServer> taskbarlessZfs_;
protected:
std::unique_ptr<ZimFileServer> 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();
}
};