From 60d7038c6243612fba19d08345192755e6e2027b Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 23 Jun 2023 13:00:42 -0400 Subject: [PATCH] warning: comparison of integer expressions of different signedness (#2219) (#2222) https://github.com/ros2/rclcpp/pull/2167#issuecomment-1597197552 Signed-off-by: Tomoya Fujita (cherry picked from commit fe2e0e4c646545625ad9f82e929be651b3a5fd95) Co-authored-by: Tomoya Fujita Signed-off-by: Ignacio Vizzo --- rclcpp/test/rclcpp/executors/test_executors.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rclcpp/test/rclcpp/executors/test_executors.cpp b/rclcpp/test/rclcpp/executors/test_executors.cpp index 232baaace3..68138eb82b 100644 --- a/rclcpp/test/rclcpp/executors/test_executors.cpp +++ b/rclcpp/test/rclcpp/executors/test_executors.cpp @@ -858,7 +858,7 @@ class TestIntraprocessExecutors : public ::testing::Test test_name << test_info->test_case_name() << "_" << test_info->name(); node = std::make_shared("node", test_name.str()); - callback_count = 0; + callback_count = 0u; const std::string topic_name = std::string("topic_") + test_name.str(); @@ -867,7 +867,7 @@ class TestIntraprocessExecutors : public ::testing::Test publisher = node->create_publisher(topic_name, rclcpp::QoS(1), po); auto callback = [this](test_msgs::msg::Empty::ConstSharedPtr) { - this->callback_count.fetch_add(1); + this->callback_count.fetch_add(1u); }; rclcpp::SubscriptionOptions so; @@ -889,7 +889,7 @@ class TestIntraprocessExecutors : public ::testing::Test rclcpp::Node::SharedPtr node; rclcpp::Publisher::SharedPtr publisher; rclcpp::Subscription::SharedPtr subscription; - std::atomic_int callback_count; + std::atomic_size_t callback_count; }; TYPED_TEST_SUITE(TestIntraprocessExecutors, ExecutorTypes, ExecutorTypeNames); @@ -905,7 +905,7 @@ TYPED_TEST(TestIntraprocessExecutors, testIntraprocessRetrigger) { ExecutorType executor; executor.add_node(this->node); - EXPECT_EQ(0, this->callback_count.load()); + EXPECT_EQ(0u, this->callback_count.load()); this->publisher->publish(test_msgs::msg::Empty()); // Wait for up to 5 seconds for the first message to come available. @@ -919,7 +919,7 @@ TYPED_TEST(TestIntraprocessExecutors, testIntraprocessRetrigger) { EXPECT_EQ(1u, this->callback_count.load()); // reset counter - this->callback_count.store(0); + this->callback_count.store(0u); for (size_t ii = 0; ii < kNumMessages; ++ii) { this->publisher->publish(test_msgs::msg::Empty());