Skip to content

Commit

Permalink
Switch to using the client_gid.
Browse files Browse the repository at this point in the history
It should not be a UUID.

Signed-off-by: Chris Lalancette <[email protected]>
  • Loading branch information
clalancette committed Jan 25, 2023
1 parent 2a9d4d5 commit 1a8d861
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
1 change: 0 additions & 1 deletion rosidl_typesupport_c/resource/srv__type_support.cpp.em
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ if len(type_supports) != 1:
header_files.append('rosidl_typesupport_interface/macros.h')
header_files.append('service_msgs/msg/service_event_info.h')
header_files.append('builtin_interfaces/msg/time.h')
header_files.append('unique_identifier_msgs/msg/uuid.h')
}@
@[for header_file in header_files]@
@[ if header_file in include_directives]@
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ TEST(test_service_typesupport, basic_types_event_message_create)
expected_info.event_type = 2;
expected_info.stamp_nanosec = 123;
expected_info.stamp_sec = 123;
auto uuid = std::array<uint8_t, 16>{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
std::copy(uuid.begin(), uuid.end(), expected_info.client_id);
auto gid = std::array<uint8_t, 16>{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
std::copy(gid.begin(), gid.end(), expected_info.client_gid);

rosidl_typesupport_tests__srv__BasicTypes_Request expected_request;
rosidl_typesupport_tests__srv__BasicTypes_Request__init(&expected_request);
Expand All @@ -83,7 +83,7 @@ TEST(test_service_typesupport, basic_types_event_message_create)
EXPECT_EQ(event->info.stamp.nanosec, expected_info.stamp_nanosec);
EXPECT_EQ(event->info.stamp.sec, expected_info.stamp_sec);
for (int i = 0; i < 16; ++i) {
EXPECT_EQ(event->info.client_id.uuid[i], expected_info.client_id[i]);
EXPECT_EQ(event->info.client_gid[i], expected_info.client_gid[i]);
}
EXPECT_EQ(event->request.size, 0U);
EXPECT_EQ(event->response.size, 0U);
Expand All @@ -105,7 +105,7 @@ TEST(test_service_typesupport, basic_types_event_message_create)
EXPECT_EQ(event->info.stamp.nanosec, expected_info.stamp_nanosec);
EXPECT_EQ(event->info.stamp.sec, expected_info.stamp_sec);
for (int i = 0; i < 16; ++i) {
EXPECT_EQ(event->info.client_id.uuid[i], expected_info.client_id[i]);
EXPECT_EQ(event->info.client_gid[i], expected_info.client_gid[i]);
}
ASSERT_EQ(event->request.size, 1U);
EXPECT_EQ(event->response.size, 0U);
Expand All @@ -129,7 +129,7 @@ TEST(test_service_typesupport, basic_types_event_message_create)
EXPECT_EQ(event->info.stamp.nanosec, expected_info.stamp_nanosec);
EXPECT_EQ(event->info.stamp.sec, expected_info.stamp_sec);
for (int i = 0; i < 16; ++i) {
EXPECT_EQ(event->info.client_id.uuid[i], expected_info.client_id[i]);
EXPECT_EQ(event->info.client_gid[i], expected_info.client_gid[i]);
}
EXPECT_EQ(event->request.size, 0U);
ASSERT_EQ(event->response.size, 1U);
Expand All @@ -155,7 +155,7 @@ TEST(test_service_typesupport, basic_types_event_message_create)
EXPECT_EQ(event->info.stamp.nanosec, expected_info.stamp_nanosec);
EXPECT_EQ(event->info.stamp.sec, expected_info.stamp_sec);
for (int i = 0; i < 16; ++i) {
EXPECT_EQ(event->info.client_id.uuid[i], expected_info.client_id[i]);
EXPECT_EQ(event->info.client_gid[i], expected_info.client_gid[i]);
}
ASSERT_EQ(event->request.size, 1U);
EXPECT_EQ(event->request.data[0].int16_value, expected_request.int16_value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ TEST(test_service_typesupport, basic_types_event_message_create)
expected_info.event_type = 2;
expected_info.stamp_nanosec = 123;
expected_info.stamp_sec = 123;
auto uuid = std::array<uint8_t, 16>{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
std::copy(uuid.begin(), uuid.end(), expected_info.client_id);
auto gid = std::array<uint8_t, 16>{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
std::copy(gid.begin(), gid.end(), expected_info.client_gid);

auto expected_request = rosidl_typesupport_tests::srv::BasicTypes_Request();
expected_request.int16_value = -1;
Expand All @@ -88,7 +88,7 @@ TEST(test_service_typesupport, basic_types_event_message_create)
EXPECT_EQ(event->info.stamp.nanosec, expected_info.stamp_nanosec);
EXPECT_EQ(event->info.stamp.sec, expected_info.stamp_sec);
for (int i = 0; i < 16; ++i) {
EXPECT_EQ(event->info.client_id.uuid[i], expected_info.client_id[i]);
EXPECT_EQ(event->info.client_gid[i], expected_info.client_gid[i]);
}
EXPECT_EQ(event->request.size(), 0U);
EXPECT_EQ(event->response.size(), 0U);
Expand All @@ -111,7 +111,7 @@ TEST(test_service_typesupport, basic_types_event_message_create)
EXPECT_EQ(event->info.stamp.nanosec, expected_info.stamp_nanosec);
EXPECT_EQ(event->info.stamp.sec, expected_info.stamp_sec);
for (int i = 0; i < 16; ++i) {
EXPECT_EQ(event->info.client_id.uuid[i], expected_info.client_id[i]);
EXPECT_EQ(event->info.client_gid[i], expected_info.client_gid[i]);
}
ASSERT_EQ(event->request.size(), 1U);
EXPECT_EQ(event->response.size(), 0U);
Expand All @@ -135,7 +135,7 @@ TEST(test_service_typesupport, basic_types_event_message_create)
EXPECT_EQ(event->info.stamp.nanosec, expected_info.stamp_nanosec);
EXPECT_EQ(event->info.stamp.sec, expected_info.stamp_sec);
for (int i = 0; i < 16; ++i) {
EXPECT_EQ(event->info.client_id.uuid[i], expected_info.client_id[i]);
EXPECT_EQ(event->info.client_gid[i], expected_info.client_gid[i]);
}
EXPECT_EQ(event->request.size(), 0U);
ASSERT_EQ(event->response.size(), 1U);
Expand All @@ -159,7 +159,7 @@ TEST(test_service_typesupport, basic_types_event_message_create)
EXPECT_EQ(event->info.stamp.nanosec, expected_info.stamp_nanosec);
EXPECT_EQ(event->info.stamp.sec, expected_info.stamp_sec);
for (int i = 0; i < 16; ++i) {
EXPECT_EQ(event->info.client_id.uuid[i], expected_info.client_id[i]);
EXPECT_EQ(event->info.client_gid[i], expected_info.client_gid[i]);
}
ASSERT_EQ(event->request.size(), 1U);
EXPECT_EQ(event->request[0].int16_value, expected_request.int16_value);
Expand Down

0 comments on commit 1a8d861

Please sign in to comment.