14
14
15
15
#include < gtest/gtest.h>
16
16
17
+ #include " rclcpp/executors/executor_notify_waitable.hpp"
17
18
#include " rclcpp/rclcpp.hpp"
18
19
#include " rclcpp/executors/executor_entities_collector.hpp"
19
20
@@ -34,7 +35,8 @@ class TestExecutorEntitiesCollector : public ::testing::Test
34
35
};
35
36
36
37
TEST_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);
38
40
39
41
auto node1 = std::make_shared<rclcpp::Node>(" node1" , " ns" );
40
42
auto node2 = std::make_shared<rclcpp::Node>(" node2" , " ns" );
@@ -78,7 +80,8 @@ TEST_F(TestExecutorEntitiesCollector, add_remove_node) {
78
80
}
79
81
80
82
TEST_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);
82
85
83
86
auto node = std::make_shared<rclcpp::Node>(" node1" , " ns" );
84
87
rclcpp::CallbackGroup::SharedPtr cb_group = node->create_callback_group (
@@ -91,7 +94,8 @@ TEST_F(TestExecutorEntitiesCollector, add_callback_group) {
91
94
}
92
95
93
96
TEST_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);
95
99
96
100
auto node = std::make_shared<rclcpp::Node>(" node1" , " ns" );
97
101
entities_collector.add_node (node->get_node_base_interface ());
@@ -102,7 +106,8 @@ TEST_F(TestExecutorEntitiesCollector, add_node_default_callback_group) {
102
106
}
103
107
104
108
TEST_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);
106
111
107
112
auto node = std::make_shared<rclcpp::Node>(" node1" , " ns" );
108
113
rclcpp::CallbackGroup::SharedPtr cb_group = node->create_callback_group (
@@ -115,7 +120,8 @@ TEST_F(TestExecutorEntitiesCollector, add_callback_group_after_add_node) {
115
120
}
116
121
117
122
TEST_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);
119
125
120
126
auto node = std::make_shared<rclcpp::Node>(" node1" , " ns" );
121
127
rclcpp::CallbackGroup::SharedPtr cb_group = node->create_callback_group (
@@ -133,7 +139,8 @@ TEST_F(TestExecutorEntitiesCollector, add_callback_group_twice) {
133
139
}
134
140
135
141
TEST_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);
137
144
138
145
auto node = std::make_shared<rclcpp::Node>(" node1" , " ns" );
139
146
rclcpp::CallbackGroup::SharedPtr cb_group = node->create_callback_group (
@@ -154,7 +161,8 @@ TEST_F(TestExecutorEntitiesCollector, remove_callback_group_after_node) {
154
161
}
155
162
156
163
TEST_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);
158
166
159
167
auto node = std::make_shared<rclcpp::Node>(" node1" , " ns" );
160
168
rclcpp::CallbackGroup::SharedPtr cb_group = node->create_callback_group (
@@ -173,7 +181,8 @@ TEST_F(TestExecutorEntitiesCollector, remove_callback_group_twice) {
173
181
}
174
182
175
183
TEST_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);
177
186
178
187
auto node1 = std::make_shared<rclcpp::Node>(" node1" , " ns" );
179
188
EXPECT_NO_THROW (entities_collector.add_node (node1->get_node_base_interface ()));
0 commit comments