Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
atsushi421 committed Feb 27, 2025
1 parent 3bae2ee commit 15a7533
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ class NodeForNoStarvation : public rclcpp::Node
const int64_t num_agnocast_sub_cbs, const int64_t num_ros2_sub_cbs,
const int64_t num_agnocast_cbs_to_be_added, const std::chrono::milliseconds pub_period);

~NodeForNoStarvation();

bool is_all_ros2_sub_cbs_called() const;
bool is_all_agnocast_sub_cbs_called() const;
void remove_mqueues();
};
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ NodeForNoStarvation::NodeForNoStarvation(
ros2_sub_cbs_called_.assign(num_ros2_sub_cbs, false);
}

void NodeForNoStarvation::remove_mqueues()
NodeForNoStarvation::~NodeForNoStarvation()
{
for (auto & mq_receiver : mq_receivers_) {
if (mq_close(mq_receiver.first) == -1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@ class MultiThreadedAgnocastExecutorNoStarvationTest
executor_->add_node(test_node_);
}

void TearDown() override
{
test_node_->remove_mqueues();
rclcpp::shutdown();
}
void TearDown() override { rclcpp::shutdown(); }

std::shared_ptr<NodeForNoStarvation> test_node_;
std::shared_ptr<agnocast::MultiThreadedAgnocastExecutor> executor_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ class SingleThreadedAgnocastExecutorNoStarvationTest : public ::testing::TestWit
executor_->add_node(test_node_);
}

void TearDown() override
{
test_node_->remove_mqueues();
rclcpp::shutdown();
}
void TearDown() override { rclcpp::shutdown(); }

std::shared_ptr<NodeForNoStarvation> test_node_;
std::shared_ptr<agnocast::SingleThreadedAgnocastExecutor> executor_;
Expand Down

0 comments on commit 15a7533

Please sign in to comment.