mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-10 09:43:51 +00:00
Added a unit test
This commit is contained in:
parent
72ce293fed
commit
15c4106a36
14
test/test.cc
14
test/test.cc
@ -394,6 +394,20 @@ TEST(ConnectionErrorTest, InvalidHost) {
|
|||||||
ASSERT_TRUE(res == nullptr);
|
ASSERT_TRUE(res == nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(ConnectionErrorTest, InvalidHost2) {
|
||||||
|
auto host = "httpbin.org/";
|
||||||
|
|
||||||
|
#ifdef CPPHTTPLIB_OPENSSL_SUPPORT
|
||||||
|
httplib::SSLClient cli(host);
|
||||||
|
#else
|
||||||
|
httplib::Client cli(host);
|
||||||
|
#endif
|
||||||
|
cli.set_connection_timeout(2);
|
||||||
|
|
||||||
|
auto res = cli.Get("/");
|
||||||
|
ASSERT_TRUE(res == nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
TEST(ConnectionErrorTest, InvalidPort) {
|
TEST(ConnectionErrorTest, InvalidPort) {
|
||||||
auto host = "localhost";
|
auto host = "localhost";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user