Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
Signed-off-by: M. Fatih Cırıt <[email protected]>
  • Loading branch information
M. Fatih Cırıt committed May 31, 2024
1 parent 7fa05bc commit fff3120
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <map>
#include <memory>
#include <string>
#include <tuple>
#include <unordered_map>
#include <vector>

Expand Down
11 changes: 4 additions & 7 deletions common/autoware_control_center/test/test_cc_heartbeat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,10 @@ TEST_F(ControlCenterHeartbeatTest, HeartbeatHandling)
const auto [uuid, node] = test::register_node(node_name, ns);

// Send a heartbeat and verify node status is updated
autoware_control_center_msgs::msg::NodeStatusActivity status_activity;
status_activity.status = autoware_control_center_msgs::msg::NodeStatusActivity::PROCESSING;
autoware_control_center_msgs::msg::NodeStatusOperational status_operational;
status_operational.status = autoware_control_center_msgs::msg::NodeStatusOperational::NORMAL;
auto hb_healthy_init = test::generate_hb_healthy();

RCLCPP_INFO(rclcpp::get_logger("test"), "Sending heartbeat");
auto pub_hb = test::send_first_heartbeat(node, deadline_ms_, test::generate_hb_healthy());
auto pub_hb = test::send_first_heartbeat(node, deadline_ms_, hb_healthy_init);
RCLCPP_INFO(rclcpp::get_logger("test"), "Sent heartbeat");
test::send_heartbeat(node, pub_hb, test::generate_hb_healthy());
RCLCPP_INFO(rclcpp::get_logger("test"), "Sent 2nd heartbeat");
Expand All @@ -84,8 +81,8 @@ TEST_F(ControlCenterHeartbeatTest, HeartbeatHandling)

autoware_control_center_msgs::msg::NodeReport report;
ASSERT_TRUE(test::wait_for_node_report(node->get_fully_qualified_name(), report));
ASSERT_EQ(report.status_activity.status, status_activity.status);
ASSERT_EQ(report.status_operational.status, status_operational.status);
ASSERT_EQ(report.status_activity.status, hb_healthy_init->status_activity.status);
ASSERT_EQ(report.status_operational.status, hb_healthy_init->status_operational.status);
}

TEST_F(ControlCenterHeartbeatTest, HeartbeatMissedDeadline)
Expand Down
2 changes: 2 additions & 0 deletions common/autoware_control_center/test/test_utility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include <autoware_control_center_msgs/srv/deregister.hpp>
#include <autoware_control_center_msgs/srv/register.hpp>

#include <tuple>

namespace autoware::control_center::test
{

Expand Down

0 comments on commit fff3120

Please sign in to comment.