1414
1515#include < gtest/gtest.h>
1616
17+ #include " rclcpp/executors/executor_notify_waitable.hpp"
1718#include " rclcpp/rclcpp.hpp"
1819#include " rclcpp/executors/executor_entities_collector.hpp"
1920
@@ -34,7 +35,8 @@ class TestExecutorEntitiesCollector : public ::testing::Test
3435};
3536
3637TEST_F (TestExecutorEntitiesCollector, add_remove_node) {
37- auto entities_collector = rclcpp::executors::ExecutorEntitiesCollector ();
38+ auto notify_waitable = std::make_shared<rclcpp::executors::ExecutorNotifyWaitable>();
39+ auto entities_collector = rclcpp::executors::ExecutorEntitiesCollector (notify_waitable);
3840
3941 auto node1 = std::make_shared<rclcpp::Node>(" node1" , " ns" );
4042 auto node2 = std::make_shared<rclcpp::Node>(" node2" , " ns" );
@@ -78,7 +80,8 @@ TEST_F(TestExecutorEntitiesCollector, add_remove_node) {
7880}
7981
8082TEST_F (TestExecutorEntitiesCollector, add_callback_group) {
81- auto entities_collector = rclcpp::executors::ExecutorEntitiesCollector ();
83+ auto notify_waitable = std::make_shared<rclcpp::executors::ExecutorNotifyWaitable>();
84+ auto entities_collector = rclcpp::executors::ExecutorEntitiesCollector (notify_waitable);
8285
8386 auto node = std::make_shared<rclcpp::Node>(" node1" , " ns" );
8487 rclcpp::CallbackGroup::SharedPtr cb_group = node->create_callback_group (
@@ -91,7 +94,8 @@ TEST_F(TestExecutorEntitiesCollector, add_callback_group) {
9194}
9295
9396TEST_F (TestExecutorEntitiesCollector, add_node_default_callback_group) {
94- auto entities_collector = rclcpp::executors::ExecutorEntitiesCollector ();
97+ auto notify_waitable = std::make_shared<rclcpp::executors::ExecutorNotifyWaitable>();
98+ auto entities_collector = rclcpp::executors::ExecutorEntitiesCollector (notify_waitable);
9599
96100 auto node = std::make_shared<rclcpp::Node>(" node1" , " ns" );
97101 entities_collector.add_node (node->get_node_base_interface ());
@@ -102,7 +106,8 @@ TEST_F(TestExecutorEntitiesCollector, add_node_default_callback_group) {
102106}
103107
104108TEST_F (TestExecutorEntitiesCollector, add_callback_group_after_add_node) {
105- auto entities_collector = rclcpp::executors::ExecutorEntitiesCollector ();
109+ auto notify_waitable = std::make_shared<rclcpp::executors::ExecutorNotifyWaitable>();
110+ auto entities_collector = rclcpp::executors::ExecutorEntitiesCollector (notify_waitable);
106111
107112 auto node = std::make_shared<rclcpp::Node>(" node1" , " ns" );
108113 rclcpp::CallbackGroup::SharedPtr cb_group = node->create_callback_group (
@@ -115,7 +120,8 @@ TEST_F(TestExecutorEntitiesCollector, add_callback_group_after_add_node) {
115120}
116121
117122TEST_F (TestExecutorEntitiesCollector, add_callback_group_twice) {
118- auto entities_collector = rclcpp::executors::ExecutorEntitiesCollector ();
123+ auto notify_waitable = std::make_shared<rclcpp::executors::ExecutorNotifyWaitable>();
124+ auto entities_collector = rclcpp::executors::ExecutorEntitiesCollector (notify_waitable);
119125
120126 auto node = std::make_shared<rclcpp::Node>(" node1" , " ns" );
121127 rclcpp::CallbackGroup::SharedPtr cb_group = node->create_callback_group (
@@ -133,7 +139,8 @@ TEST_F(TestExecutorEntitiesCollector, add_callback_group_twice) {
133139}
134140
135141TEST_F (TestExecutorEntitiesCollector, remove_callback_group_after_node) {
136- auto entities_collector = rclcpp::executors::ExecutorEntitiesCollector ();
142+ auto notify_waitable = std::make_shared<rclcpp::executors::ExecutorNotifyWaitable>();
143+ auto entities_collector = rclcpp::executors::ExecutorEntitiesCollector (notify_waitable);
137144
138145 auto node = std::make_shared<rclcpp::Node>(" node1" , " ns" );
139146 rclcpp::CallbackGroup::SharedPtr cb_group = node->create_callback_group (
@@ -154,7 +161,8 @@ TEST_F(TestExecutorEntitiesCollector, remove_callback_group_after_node) {
154161}
155162
156163TEST_F (TestExecutorEntitiesCollector, remove_callback_group_twice) {
157- auto entities_collector = rclcpp::executors::ExecutorEntitiesCollector ();
164+ auto notify_waitable = std::make_shared<rclcpp::executors::ExecutorNotifyWaitable>();
165+ auto entities_collector = rclcpp::executors::ExecutorEntitiesCollector (notify_waitable);
158166
159167 auto node = std::make_shared<rclcpp::Node>(" node1" , " ns" );
160168 rclcpp::CallbackGroup::SharedPtr cb_group = node->create_callback_group (
@@ -173,7 +181,8 @@ TEST_F(TestExecutorEntitiesCollector, remove_callback_group_twice) {
173181}
174182
175183TEST_F (TestExecutorEntitiesCollector, remove_node_opposite_order) {
176- auto entities_collector = rclcpp::executors::ExecutorEntitiesCollector ();
184+ auto notify_waitable = std::make_shared<rclcpp::executors::ExecutorNotifyWaitable>();
185+ auto entities_collector = rclcpp::executors::ExecutorEntitiesCollector (notify_waitable);
177186
178187 auto node1 = std::make_shared<rclcpp::Node>(" node1" , " ns" );
179188 EXPECT_NO_THROW (entities_collector.add_node (node1->get_node_base_interface ()));
0 commit comments