From d3240d69ddb9980fa5761cfe5e2ff046589d52f4 Mon Sep 17 00:00:00 2001 From: Berkay Karaman Date: Thu, 14 Mar 2024 13:24:38 +0300 Subject: [PATCH] feat: change function name publish() -> publish_if_subscribed() Signed-off-by: Berkay Karaman --- .../src/ros/test_published_time_publisher.cpp | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/common/tier4_autoware_utils/test/src/ros/test_published_time_publisher.cpp b/common/tier4_autoware_utils/test/src/ros/test_published_time_publisher.cpp index 23d4f194f15c7..6bf3a6af7c699 100644 --- a/common/tier4_autoware_utils/test/src/ros/test_published_time_publisher.cpp +++ b/common/tier4_autoware_utils/test/src/ros/test_published_time_publisher.cpp @@ -91,8 +91,8 @@ TEST_F(PublishedTimePublisherTest, PublishMsgWithHeader) std_msgs::msg::Header header; header.stamp = rclcpp::Time(1234); - // Use Published Time Publisher .publish() with a header - published_time_publisher_->publish(first_test_publisher_, header); + // Use Published Time Publisher .publish_if_subscribed() with a header + published_time_publisher_->publish_if_subscribed(first_test_publisher_, header); rclcpp::spin_some(node_); // Check if the published_time_ is created @@ -110,8 +110,8 @@ TEST_F(PublishedTimePublisherTest, PublishMsgWithTimestamp) std_msgs::msg::Header header; header.stamp = rclcpp::Time(4321); - // Use Published Time Publisher .publish() with a timestamp - published_time_publisher_->publish(first_test_publisher_, header.stamp); + // Use Published Time Publisher .publish_if_subscribed() with a timestamp + published_time_publisher_->publish_if_subscribed(first_test_publisher_, header.stamp); rclcpp::spin_some(node_); // Check if the published_time_ is created @@ -129,9 +129,9 @@ TEST_F(PublishedTimePublisherTest, MultiplePublishMsgWithHeader) std_msgs::msg::Header header; header.stamp = rclcpp::Time(12345); - // Use Published Time Publisher .publish() with a header for multiple publishers - published_time_publisher_->publish(first_test_publisher_, header); - published_time_publisher_->publish(second_test_publisher_, header); + // Use Published Time Publisher .publish_if_subscribed() with a header for multiple publishers + published_time_publisher_->publish_if_subscribed(first_test_publisher_, header); + published_time_publisher_->publish_if_subscribed(second_test_publisher_, header); rclcpp::spin_some(node_); // Check if the published_time_ is created @@ -151,9 +151,9 @@ TEST_F(PublishedTimePublisherTest, MultiplePublishMsgWithTimestamp) std_msgs::msg::Header header; header.stamp = rclcpp::Time(12345); - // Use Published Time Publisher .publish() with a timestamp for multiple publishers - published_time_publisher_->publish(first_test_publisher_, header.stamp); - published_time_publisher_->publish(second_test_publisher_, header.stamp); + // Use Published Time Publisher .publish_if_subscribed() with a timestamp for multiple publishers + published_time_publisher_->publish_if_subscribed(first_test_publisher_, header.stamp); + published_time_publisher_->publish_if_subscribed(second_test_publisher_, header.stamp); rclcpp::spin_some(node_); // Check if the published_time_ is created