mirror of
https://github.com/yhirose/cpp-httplib
synced 2024-11-21 14:29:10 -07:00
Added a unit test
This commit is contained in:
parent
72ce293fed
commit
15c4106a36
1 changed files with 14 additions and 0 deletions
14
test/test.cc
14
test/test.cc
|
@ -394,6 +394,20 @@ TEST(ConnectionErrorTest, InvalidHost) {
|
|||
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) {
|
||||
auto host = "localhost";
|
||||
|
||||
|
|
Loading…
Reference in a new issue