mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-10-24 12:04:40 +00:00
Build the tests that throw only with exceptions
ThrowingVerifyCallbackRejectsTheCertificate and ErrorAndExceptionHandlersReplaceProvider throw from a callback, which does not compile with CPPHTTPLIB_NO_EXCEPTIONS and -fno-exceptions.
This commit is contained in:
1 parent
3b9931a85c
commit
f1c5068ee8
1 file changed
+4
@@ -4906,6 +4906,7 @@ TEST(SSLClientServerTest, UpdateCertsPemReplacesClientCA) {
|
|||||||
EXPECT_FALSE(get());
|
EXPECT_FALSE(get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef CPPHTTPLIB_NO_EXCEPTIONS
|
||||||
TEST(SSLClientServerTest, ThrowingVerifyCallbackRejectsTheCertificate) {
|
TEST(SSLClientServerTest, ThrowingVerifyCallbackRejectsTheCertificate) {
|
||||||
SSLServer svr(SERVER_CERT_FILE, SERVER_PRIVATE_KEY_FILE, CLIENT_CA_CERT_FILE);
|
SSLServer svr(SERVER_CERT_FILE, SERVER_PRIVATE_KEY_FILE, CLIENT_CA_CERT_FILE);
|
||||||
ASSERT_TRUE(svr.is_valid());
|
ASSERT_TRUE(svr.is_valid());
|
||||||
@@ -4945,6 +4946,7 @@ TEST(SSLClientServerTest, ThrowingVerifyCallbackRejectsTheCertificate) {
|
|||||||
ASSERT_TRUE(res) << "Error: " << to_string(res.error());
|
ASSERT_TRUE(res) << "Error: " << to_string(res.error());
|
||||||
EXPECT_EQ("ok", res->body);
|
EXPECT_EQ("ok", res->body);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CPPHTTPLIB_OPENSSL_SUPPORT
|
#ifdef CPPHTTPLIB_OPENSSL_SUPPORT
|
||||||
// Sends each request over a new connection with a client certificate,
|
// Sends each request over a new connection with a client certificate,
|
||||||
@@ -13373,6 +13375,7 @@ TEST(ResponseContentSourceTest, FileRequestHandlerCanReplaceFile) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef CPPHTTPLIB_NO_EXCEPTIONS
|
||||||
TEST(ResponseContentSourceTest, ErrorAndExceptionHandlersReplaceProvider) {
|
TEST(ResponseContentSourceTest, ErrorAndExceptionHandlersReplaceProvider) {
|
||||||
Server svr;
|
Server svr;
|
||||||
|
|
||||||
@@ -13456,6 +13459,7 @@ TEST(ResponseContentSourceTest, ErrorAndExceptionHandlersReplaceProvider) {
|
|||||||
std::lock_guard<std::mutex> guard(released_mutex);
|
std::lock_guard<std::mutex> guard(released_mutex);
|
||||||
EXPECT_EQ((std::vector<bool>{false, false, false}), released);
|
EXPECT_EQ((std::vector<bool>{false, false, false}), released);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
TEST(ResponseContentSourceTest, LastContentSetterWins) {
|
TEST(ResponseContentSourceTest, LastContentSetterWins) {
|
||||||
Server svr;
|
Server svr;
|
||||||
|
|||||||
Reference in new issue
Block a user