]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3602] Add test failure on exception thrown
authorRazvan Becheriu <razvan@isc.org>
Mon, 28 Oct 2024 07:47:07 +0000 (09:47 +0200)
committerRazvan Becheriu <razvan@isc.org>
Mon, 28 Oct 2024 07:47:07 +0000 (09:47 +0200)
src/bin/dhcp4/tests/http_control_socket_unittest.cc
src/bin/dhcp6/tests/http_control_socket_unittest.cc
src/lib/http/connection_pool.h

index 38880683c27dc539e02b22cf65383823a12b285c..0a26edb3ddeff208a7451647c674744d12e5a136 100644 (file)
@@ -150,8 +150,11 @@ public:
                          TEST_TIMEOUT, IntervalTimer::ONE_SHOT);
         // Run until the client stops the service or an error occurs.
         try {
-           io_service->run();
+            io_service->run();
+        } catch (const std::exception& ex) {
+            ADD_FAILURE() << "Exception thrown while running test. Error: " << ex.what();
         } catch (...) {
+            ADD_FAILURE() << "Unknown exception thrown while running test.";
         }
         test_timer.cancel();
         if (io_service->stopped()) {
index 0c72acc840e04596ee84a4901b57ddf72a1e6032..82d35f4992b839ebd53ac0c8ff617628551c5918 100644 (file)
@@ -188,8 +188,11 @@ public:
                          TEST_TIMEOUT, IntervalTimer::ONE_SHOT);
         // Run until the client stops the service or an error occurs.
         try {
-           io_service->run();
+            io_service->run();
+        } catch (const std::exception& ex) {
+            ADD_FAILURE() << "Exception thrown while running test. Error: " << ex.what();
         } catch (...) {
+            ADD_FAILURE() << "Unknown exception thrown while running test.";
         }
         test_timer.cancel();
         if (io_service->stopped()) {
index d5a995bc312e0d608ce259f0682417afdb3e9edb..8d382446ce6671b3e4bb98ec1122b5d7c308f3e0 100644 (file)
@@ -71,7 +71,7 @@ protected:
     std::mutex mutex_;
 };
 
-/// @brief Pointer to the @ref HttpConnection.
+/// @brief Pointer to the @ref HttpConnectionPool.
 typedef std::shared_ptr<HttpConnectionPool> HttpConnectionPoolPtr;
 
 }