Skip to content

Commit

Permalink
fix case
Browse files Browse the repository at this point in the history
  • Loading branch information
qicosmos committed Dec 9, 2024
1 parent 074fc55 commit 4ab48c8
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/test_cinatra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,18 @@ TEST_CASE("test for gzip") {
client.set_conn_timeout(0ms);
std::string uri = "http://127.0.0.1:8090/none";
auto result = async_simple::coro::syncAwait(client.connect(uri));
std::cout << result.net_err.message() << "\n";
CHECK(result.net_err == std::errc::timed_out);
if (result.net_err)
CHECK(result.net_err == std::errc::timed_out);

client.set_conn_timeout(-1ms);
client.set_req_timeout(0ms);
result = async_simple::coro::syncAwait(client.connect(uri));
CHECK(!result.net_err);
if (result.net_err)
CHECK(!result.net_err);

result = async_simple::coro::syncAwait(client.async_get("/none"));
CHECK(result.net_err == std::errc::timed_out);
if (result.net_err)
CHECK(result.net_err == std::errc::timed_out);

client.add_header("Content-Encoding", "none");
client.set_req_timeout(-1ms);
Expand All @@ -102,7 +104,8 @@ TEST_CASE("test for gzip") {
conf.req_timeout_duration = 0ms;
client.init_config(conf);
result = async_simple::coro::syncAwait(client.async_get(uri));
CHECK(result.net_err == std::errc::timed_out);
if (result.net_err)
CHECK(result.net_err == std::errc::timed_out);
}

{
Expand Down

0 comments on commit 4ab48c8

Please sign in to comment.