diff --git a/rclcpp_action/test/test_types.cpp b/rclcpp_action/test/test_types.cpp index 8e7677d532..f981261105 100644 --- a/rclcpp_action/test/test_types.cpp +++ b/rclcpp_action/test/test_types.cpp @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. - #include #include @@ -20,17 +19,17 @@ TEST(TestActionTypes, goal_uuid_to_string) { rclcpp_action::GoalUUID goal_id; - for (size_t i = 0; i < UUID_SIZE; ++i) { + for (uint8_t i = 0; i < UUID_SIZE; ++i) { goal_id[i] = i; } EXPECT_STREQ("0123456789abcdef", rclcpp_action::to_string(goal_id).c_str()); - for (size_t i = 0; i < UUID_SIZE; ++i) { + for (uint8_t i = 0; i < UUID_SIZE; ++i) { goal_id[i] = 16u + i; } EXPECT_STREQ("101112131415161718191a1b1c1d1e1f", rclcpp_action::to_string(goal_id).c_str()); - for (size_t i = 0; i < UUID_SIZE; ++i) { + for (uint8_t i = 0; i < UUID_SIZE; ++i) { goal_id[i] = std::numeric_limits::max() - i; } EXPECT_STREQ("fffefdfcfbfaf9f8f7f6f5f4f3f2f1f0", rclcpp_action::to_string(goal_id).c_str()); @@ -38,25 +37,25 @@ TEST(TestActionTypes, goal_uuid_to_string) { TEST(TestActionTypes, goal_uuid_to_rcl_action_goal_info) { rclcpp_action::GoalUUID goal_id; - for (size_t i = 0; i < UUID_SIZE; ++i) { + for (uint8_t i = 0; i < UUID_SIZE; ++i) { goal_id[i] = i; } rcl_action_goal_info_t goal_info = rcl_action_get_zero_initialized_goal_info(); rclcpp_action::convert(goal_id, &goal_info); - for (size_t i = 0; i < UUID_SIZE; ++i) { + for (uint8_t i = 0; i < UUID_SIZE; ++i) { EXPECT_EQ(goal_info.goal_id.uuid[i], goal_id[i]); } } TEST(TestActionTypes, rcl_action_goal_info_to_goal_uuid) { rcl_action_goal_info_t goal_info = rcl_action_get_zero_initialized_goal_info(); - for (size_t i = 0; i < UUID_SIZE; ++i) { + for (uint8_t i = 0; i < UUID_SIZE; ++i) { goal_info.goal_id.uuid[i] = i; } rclcpp_action::GoalUUID goal_id; rclcpp_action::convert(goal_id, &goal_info); - for (size_t i = 0; i < UUID_SIZE; ++i) { + for (uint8_t i = 0; i < UUID_SIZE; ++i) { EXPECT_EQ(goal_info.goal_id.uuid[i], goal_id[i]); } }