Skip to content

Commit fe2e0e4

Browse files
authored
warning: comparison of integer expressions of different signedness (#2219)
#2167 (comment) Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
1 parent 005f6ae commit fe2e0e4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

rclcpp/test/rclcpp/executors/test_executors.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ class TestIntraprocessExecutors : public ::testing::Test
738738
test_name << test_info->test_case_name() << "_" << test_info->name();
739739
node = std::make_shared<rclcpp::Node>("node", test_name.str());
740740

741-
callback_count = 0;
741+
callback_count = 0u;
742742

743743
const std::string topic_name = std::string("topic_") + test_name.str();
744744

@@ -747,7 +747,7 @@ class TestIntraprocessExecutors : public ::testing::Test
747747
publisher = node->create_publisher<test_msgs::msg::Empty>(topic_name, rclcpp::QoS(1), po);
748748

749749
auto callback = [this](test_msgs::msg::Empty::ConstSharedPtr) {
750-
this->callback_count.fetch_add(1);
750+
this->callback_count.fetch_add(1u);
751751
};
752752

753753
rclcpp::SubscriptionOptions so;
@@ -769,7 +769,7 @@ class TestIntraprocessExecutors : public ::testing::Test
769769
rclcpp::Node::SharedPtr node;
770770
rclcpp::Publisher<test_msgs::msg::Empty>::SharedPtr publisher;
771771
rclcpp::Subscription<test_msgs::msg::Empty>::SharedPtr subscription;
772-
std::atomic_int callback_count;
772+
std::atomic_size_t callback_count;
773773
};
774774

775775
TYPED_TEST_SUITE(TestIntraprocessExecutors, ExecutorTypes, ExecutorTypeNames);
@@ -785,7 +785,7 @@ TYPED_TEST(TestIntraprocessExecutors, testIntraprocessRetrigger) {
785785
ExecutorType executor;
786786
executor.add_node(this->node);
787787

788-
EXPECT_EQ(0, this->callback_count.load());
788+
EXPECT_EQ(0u, this->callback_count.load());
789789
this->publisher->publish(test_msgs::msg::Empty());
790790

791791
// Wait for up to 5 seconds for the first message to come available.
@@ -799,7 +799,7 @@ TYPED_TEST(TestIntraprocessExecutors, testIntraprocessRetrigger) {
799799
EXPECT_EQ(1u, this->callback_count.load());
800800

801801
// reset counter
802-
this->callback_count.store(0);
802+
this->callback_count.store(0u);
803803

804804
for (size_t ii = 0; ii < kNumMessages; ++ii) {
805805
this->publisher->publish(test_msgs::msg::Empty());

0 commit comments

Comments
 (0)