Skip to content

Commit 2813045

Browse files
authored
verify client gid uniqueness for a single service event. (#2636)
Signed-off-by: Tomoya Fujita <[email protected]>
1 parent 51dfdc3 commit 2813045

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

rclcpp/test/rclcpp/test_service_introspection.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,20 @@ TEST_F(TestServiceIntrospection, service_introspection_nominal)
124124
ASSERT_THAT(
125125
client_gid_arr,
126126
testing::Eq(event_map[ServiceEventInfo::REQUEST_SENT]->info.client_gid));
127+
// TODO(@fujitatomoya): Remove this if statement once other rmw implementations support test.
128+
// Only rmw_connextdds can pass this test requirement for now.
129+
// See more details for https://github.com/ros2/rmw/issues/357
130+
if (std::string(rmw_get_implementation_identifier()).find("rmw_connextdds") == 0) {
131+
ASSERT_THAT(
132+
client_gid_arr,
133+
testing::Eq(event_map[ServiceEventInfo::REQUEST_RECEIVED]->info.client_gid));
134+
ASSERT_THAT(
135+
client_gid_arr,
136+
testing::Eq(event_map[ServiceEventInfo::RESPONSE_SENT]->info.client_gid));
137+
}
138+
ASSERT_THAT(
139+
client_gid_arr,
140+
testing::Eq(event_map[ServiceEventInfo::RESPONSE_RECEIVED]->info.client_gid));
127141

128142
ASSERT_EQ(
129143
event_map[ServiceEventInfo::REQUEST_SENT]->info.sequence_number,

0 commit comments

Comments
 (0)