Skip to content

Commit f661b9a

Browse files
committed
feat: add nullpointer test
Signed-off-by: Berkay Karaman <brkay54@gmail.com>
1 parent e2f3afa commit f661b9a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

common/tier4_autoware_utils/test/src/ros/test_published_time_publisher.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ TEST_F(PublishedTimePublisherTest, PublishMsgWithHeader)
6262
// Use Published Time Publisher with a timestamp
6363
published_time_publisher_->publish(test_publisher_, header);
6464
rclcpp::spin_some(node_);
65+
ASSERT_TRUE(published_time_ != nullptr);
6566

6667
// Check if the published time is the same as the header
6768
EXPECT_EQ(published_time_->header.stamp, header.stamp);
@@ -75,6 +76,7 @@ TEST_F(PublishedTimePublisherTest, PublishMsgWithTimestamp)
7576
// Use Published Time Publisher with a timestamp
7677
published_time_publisher_->publish(test_publisher_, header.stamp);
7778
rclcpp::spin_some(node_);
79+
ASSERT_TRUE(published_time_ != nullptr);
7880

7981
// Check if the published time is the same as the header
8082
EXPECT_EQ(published_time_->header.stamp, header.stamp);

0 commit comments

Comments
 (0)