mirror of https://github.com/kiwix/libkiwix.git
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:
parent
fa67b45f50
commit
0994a8f1b0
|
@ -1453,16 +1453,13 @@ TEST_F(ServerTest, searchResults)
|
||||||
|
|
||||||
for ( const auto& t : testData ) {
|
for ( const auto& t : testData ) {
|
||||||
const std::string htmlSearchUrl = t.url();
|
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);
|
EXPECT_EQ(htmlRes->status, 200);
|
||||||
t.checkHtml(htmlRes->body);
|
t.checkHtml(htmlRes->body);
|
||||||
|
|
||||||
const std::string xmlSearchUrl = t.xmlSearchUrl();
|
const std::string xmlSearchUrl = t.xmlSearchUrl();
|
||||||
const auto xmlRes1 = zfs1_->GET(xmlSearchUrl.c_str());
|
const auto xmlRes = zfs1_->GET(xmlSearchUrl.c_str());
|
||||||
const auto xmlRes2 = taskbarlessZimFileServer().GET(xmlSearchUrl.c_str());
|
EXPECT_EQ(xmlRes->status, 200);
|
||||||
EXPECT_EQ(xmlRes1->status, 200);
|
t.checkXml(xmlRes->body);
|
||||||
EXPECT_EQ(xmlRes2->status, 200);
|
|
||||||
EXPECT_EQ(xmlRes1->body, xmlRes2->body);
|
|
||||||
t.checkXml(xmlRes1->body);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,9 +136,6 @@ ZimFileServer::~ZimFileServer()
|
||||||
|
|
||||||
class ServerTest : public ::testing::Test
|
class ServerTest : public ::testing::Test
|
||||||
{
|
{
|
||||||
private:
|
|
||||||
std::unique_ptr<ZimFileServer> taskbarlessZfs_;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::unique_ptr<ZimFileServer> zfs1_;
|
std::unique_ptr<ZimFileServer> zfs1_;
|
||||||
|
|
||||||
|
@ -154,16 +151,7 @@ protected:
|
||||||
zfs1_.reset(new ZimFileServer(SERVER_PORT, /*withTaskbar=*/true, ZIMFILES));
|
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 {
|
void TearDown() override {
|
||||||
zfs1_.reset();
|
zfs1_.reset();
|
||||||
taskbarlessZfs_.reset();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue