mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-14 16:58:30 +00:00
Simplified scope_exit
This commit is contained in:
parent
a66a013ed7
commit
76230db97f
2 changed files with 11 additions and 9 deletions
12
test/test.cc
12
test/test.cc
|
@ -1220,7 +1220,7 @@ TEST(PathUrlEncodeTest, PathUrlEncode) {
|
|||
ASSERT_FALSE(svr.is_running());
|
||||
}
|
||||
|
||||
TEST(BindServerTest, BindDualStack) {
|
||||
TEST(BindServerTest, DISABLED_BindDualStack) {
|
||||
Server svr;
|
||||
|
||||
svr.Get("/1", [&](const Request & /*req*/, Response &res) {
|
||||
|
@ -6026,6 +6026,12 @@ TEST(RedirectTest, RedirectToUrlWithQueryParameters) {
|
|||
|
||||
auto thread = std::thread([&]() { svr.listen(HOST, PORT); });
|
||||
|
||||
auto se = detail::scope_exit([&](void) {
|
||||
svr.stop();
|
||||
thread.join();
|
||||
ASSERT_FALSE(svr.is_running());
|
||||
});
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
|
||||
{
|
||||
|
@ -6037,9 +6043,5 @@ TEST(RedirectTest, RedirectToUrlWithQueryParameters) {
|
|||
EXPECT_EQ(200, res->status);
|
||||
EXPECT_EQ("val&key2=val2", res->body);
|
||||
}
|
||||
|
||||
svr.stop();
|
||||
thread.join();
|
||||
ASSERT_FALSE(svr.is_running());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue