mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-10-24 12:04:40 +00:00
Enable BindDualStack test and remove disabled large content test due to memory issues
This commit is contained in:
1 parent
2e61fd3e6e
commit
69d468f4d9
1 file changed
+1
-33
+1
-33
@@ -2569,7 +2569,7 @@ TEST(PathUrlEncodeTest, IncludePercentEncodingLF) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(BindServerTest, DISABLED_BindDualStack) {
|
TEST(BindServerTest, BindDualStack) {
|
||||||
Server svr;
|
Server svr;
|
||||||
|
|
||||||
svr.Get("/1", [&](const Request & /*req*/, Response &res) {
|
svr.Get("/1", [&](const Request & /*req*/, Response &res) {
|
||||||
@@ -10782,38 +10782,6 @@ TEST(ClientImplMethods, GetSocketTest) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disabled due to out-of-memory problem on GitHub Actions
|
|
||||||
#ifdef _WIN64
|
|
||||||
TEST(ServerLargeContentTest, DISABLED_SendLargeContent) {
|
|
||||||
// allocate content size larger than 2GB in memory
|
|
||||||
const size_t content_size = 2LL * 1024LL * 1024LL * 1024LL + 1LL;
|
|
||||||
char *content = (char *)malloc(content_size);
|
|
||||||
ASSERT_TRUE(content);
|
|
||||||
|
|
||||||
Server svr;
|
|
||||||
svr.Get("/foo",
|
|
||||||
[=](const httplib::Request & /*req*/, httplib::Response &res) {
|
|
||||||
res.set_content(content, content_size, "application/octet-stream");
|
|
||||||
});
|
|
||||||
|
|
||||||
auto listen_thread = std::thread([&svr]() { svr.listen(HOST, PORT); });
|
|
||||||
auto se = detail::scope_exit([&] {
|
|
||||||
svr.stop();
|
|
||||||
listen_thread.join();
|
|
||||||
if (content) free(content);
|
|
||||||
ASSERT_FALSE(svr.is_running());
|
|
||||||
});
|
|
||||||
|
|
||||||
svr.wait_until_ready();
|
|
||||||
|
|
||||||
Client cli(HOST, PORT);
|
|
||||||
auto res = cli.Get("/foo");
|
|
||||||
ASSERT_TRUE(res);
|
|
||||||
EXPECT_EQ(StatusCode::OK_200, res->status);
|
|
||||||
EXPECT_EQ(content_size, res->body.length());
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CPPHTTPLIB_SSL_ENABLED
|
#ifdef CPPHTTPLIB_SSL_ENABLED
|
||||||
TEST(YahooRedirectTest2, SimpleInterface_Online) {
|
TEST(YahooRedirectTest2, SimpleInterface_Online) {
|
||||||
Client cli("http://yahoo.com");
|
Client cli("http://yahoo.com");
|
||||||
|
|||||||
Reference in new issue
Block a user