Skip to content

Commit

Permalink
Add test for publisher implementation null
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Perez <jjperez@ekumenlabs.com>
  • Loading branch information
Blast545 committed May 20, 2020
1 parent aa17929 commit c200726
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions rcl/test/rcl/test_publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,11 @@ TEST_F(CLASSNAME(TestPublisherFixture, RMW_IMPLEMENTATION), test_publisher_acces
EXPECT_TRUE(rcl_context_is_valid(pub_context));
EXPECT_EQ(rcl_context_get_instance_id(context_ptr), rcl_context_get_instance_id(pub_context));

struct rcl_publisher_impl_t * impl_pub = publisher.impl;
publisher.impl = nullptr;
EXPECT_FALSE(rcl_publisher_is_valid(&publisher));
publisher.impl = impl_pub;

EXPECT_EQ(nullptr, rcl_publisher_get_options(nullptr));
EXPECT_EQ(nullptr, rcl_publisher_get_rmw_handle(nullptr));
EXPECT_EQ(nullptr, rcl_publisher_get_context(nullptr));
Expand Down

0 comments on commit c200726

Please sign in to comment.