Skip to content

Commit

Permalink
[#3602] Add test failure on exception thrown
Browse files Browse the repository at this point in the history
  • Loading branch information
Razvan Becheriu committed Oct 28, 2024
1 parent 7f08d90 commit 7dd4146
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/bin/dhcp4/tests/http_control_socket_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,11 @@ class BaseCtrlChannelDhcpv4Test : public ::testing::Test {
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()) {
Expand Down
5 changes: 4 additions & 1 deletion src/bin/dhcp6/tests/http_control_socket_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,11 @@ class BaseCtrlChannelDhcpv6Test : public HttpCtrlDhcpv6Test {
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()) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/http/connection_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class HttpConnectionPool {
std::mutex mutex_;
};

/// @brief Pointer to the @ref HttpConnection.
/// @brief Pointer to the @ref HttpConnectionPool.
typedef std::shared_ptr<HttpConnectionPool> HttpConnectionPoolPtr;

}
Expand Down

0 comments on commit 7dd4146

Please sign in to comment.