Skip to content

Commit ff228c0

Browse files
committed
Add winhttp_client testcase for timeouts
1 parent e0d0411 commit ff228c0

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Release/tests/functional/http/client/connections_and_errors.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,19 @@ TEST_FIXTURE(uri_address, request_timeout)
139139
#endif
140140
}
141141

142+
#ifdef _WIN32 // winhttp client
143+
TEST_FIXTURE(uri_address, winhttp_request_timeout)
144+
{
145+
test_http_server::scoped_server scoped(m_uri);
146+
http_client_config config;
147+
config.set_timeout(std::chrono::microseconds(500));
148+
149+
http_client client(m_uri, config);
150+
auto responseTask = client.request(methods::GET);
151+
VERIFY_THROWS_HTTP_ERROR_CODE(responseTask.get(), std::errc::timed_out);
152+
}
153+
#endif
154+
142155
TEST_FIXTURE(uri_address, invalid_method)
143156
{
144157
web::http::uri uri(U("http://www.bing.com/"));

0 commit comments

Comments
 (0)