Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions rclcpp/test/rclcpp/test_graph_listener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ TEST_F(TestGraphListener, error_run_graph_listener_mock_wait_set_clear) {
RCLCPP_EXPECT_THROW_EQ(
graph_listener_test->run_protected(),
std::runtime_error("failed to clear wait set: error not set"));
// the wait set was initialized by hand, release it
graph_listener_test->mock_cleanup_wait_set();
}

TEST_F(TestGraphListener, error_run_graph_listener_mock_wait_set_add_guard_condition) {
Expand All @@ -174,6 +176,8 @@ TEST_F(TestGraphListener, error_run_graph_listener_mock_wait_set_add_guard_condi
RCLCPP_EXPECT_THROW_EQ(
graph_listener_test->run_protected(),
std::runtime_error("failed to add guard condition to wait set: error not set"));
// the wait set was initialized by hand, release it
graph_listener_test->mock_cleanup_wait_set();
}

TEST_F(TestGraphListener, error_run_graph_listener_mock_wait_error) {
Expand All @@ -186,6 +190,8 @@ TEST_F(TestGraphListener, error_run_graph_listener_mock_wait_error) {
RCLCPP_EXPECT_THROW_EQ(
graph_listener_test->run_protected(),
std::runtime_error("failed to wait on wait set: error not set"));
// the wait set was initialized by hand, release it
graph_listener_test->mock_cleanup_wait_set();
}

TEST_F(TestGraphListener, error_run_graph_listener_mock_wait_timeout) {
Expand All @@ -198,6 +204,8 @@ TEST_F(TestGraphListener, error_run_graph_listener_mock_wait_timeout) {
RCLCPP_EXPECT_THROW_EQ(
graph_listener_test->run_protected(),
std::runtime_error("rcl_wait unexpectedly timed out"));
// the wait set was initialized by hand, release it
graph_listener_test->mock_cleanup_wait_set();
}

/* Add/Remove node usage */
Expand Down Expand Up @@ -272,14 +280,14 @@ TEST_F(TestGraphListener, test_graph_listener_shutdown_wait_fini_error_throw) {
auto graph_listener_test =
std::make_shared<TestGraphListenerProtectedMethods>(global_context);

graph_listener()->start_if_not_started();
graph_listener_test->start_if_not_started();

{
auto mock_wait_set_fini = mocking_utils::patch_and_return(
"lib:rclcpp", rcl_wait_set_fini, RCL_RET_ERROR);

RCLCPP_EXPECT_THROW_EQ(
graph_listener()->shutdown(),
graph_listener_test->shutdown(),
std::runtime_error("failed to finalize wait set: error not set"));
}

Expand Down
1 change: 1 addition & 0 deletions rclcpp_action/test/test_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,7 @@ TEST_F(TestClient, is_ready) {
"lib:rclcpp_action", rcl_action_client_wait_set_get_entities_ready, RCL_RET_ERROR);
EXPECT_THROW(action_client->is_ready(wait_set), rclcpp::exceptions::RCLError);
}
EXPECT_EQ(RCL_RET_OK, rcl_wait_set_fini(&wait_set));
client_node.reset(); // Drop node before action client
}

Expand Down
1 change: 1 addition & 0 deletions rclcpp_action/test/test_generic_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ TEST_F(TestGenericClient, is_ready) {
"lib:rclcpp_action", rcl_action_client_wait_set_get_entities_ready, RCL_RET_ERROR);
EXPECT_THROW(action_generic_client->is_ready(wait_set), rclcpp::exceptions::RCLError);
}
EXPECT_EQ(RCL_RET_OK, rcl_wait_set_fini(&wait_set));
client_node.reset(); // Drop node before action client
}

Expand Down
Loading