Skip to content

Commit

Permalink
add (failing) test for getting surrounding interval from empty cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Cakem1x committed Jul 31, 2024
1 parent 4c9392a commit 86af191
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/msg_cache_unittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ void fillCacheEasy(message_filters::Cache<Msg> & cache, unsigned int start, unsi
}
}

TEST(Cache, emptySurroundingInterval)
{
message_filters::Cache<Msg> cache(10);
const std::vector<std::shared_ptr<Msg const> > interval_data = cache.getSurroundingInterval(rclcpp::Time(5, 0), rclcpp::Time(9, 0));
EXPECT_EQ(interval_data.size(), (unsigned int) 0); // empty cache shall return empty interval
}

TEST(Cache, easyInterval)
{
message_filters::Cache<Msg> cache(10);
Expand Down

0 comments on commit 86af191

Please sign in to comment.