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 751c5f12060a9..96965114630c2 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 @@ -62,6 +62,7 @@ TEST_F(PublishedTimePublisherTest, PublishMsgWithHeader) // Use Published Time Publisher with a timestamp published_time_publisher_->publish(test_publisher_, header); rclcpp::spin_some(node_); + ASSERT_TRUE(published_time_ != nullptr); // Check if the published time is the same as the header EXPECT_EQ(published_time_->header.stamp, header.stamp); @@ -75,6 +76,7 @@ TEST_F(PublishedTimePublisherTest, PublishMsgWithTimestamp) // Use Published Time Publisher with a timestamp published_time_publisher_->publish(test_publisher_, header.stamp); rclcpp::spin_some(node_); + ASSERT_TRUE(published_time_ != nullptr); // Check if the published time is the same as the header EXPECT_EQ(published_time_->header.stamp, header.stamp);