Skip to content

Commit

Permalink
feat: add nullpointer test
Browse files Browse the repository at this point in the history
Signed-off-by: Berkay Karaman <[email protected]>
  • Loading branch information
brkay54 authored and xmfcx committed Mar 15, 2024
1 parent 6fe9006 commit 75c683f
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 75c683f

Please sign in to comment.