Make public ini/fini rosout publisher (#704)
* Add bad param tests ini/fini rosout publisher * Make ini/fini_publisher_for_node public Signed-off-by: Jorge Perez <jjperez@ekumenlabs.com>
This commit is contained in:
parent
01927e52ac
commit
0d411f518e
2 changed files with 26 additions and 2 deletions
|
@ -98,7 +98,7 @@ rcl_logging_rosout_fini();
|
|||
* \return `RCL_RET_BAD_ALLOC` if allocating memory failed, or
|
||||
* \return `RCL_RET_ERROR` if an unspecified error occurs.
|
||||
*/
|
||||
RCL_LOCAL
|
||||
RCL_PUBLIC
|
||||
RCL_WARN_UNUSED
|
||||
rcl_ret_t
|
||||
rcl_logging_rosout_init_publisher_for_node(
|
||||
|
@ -124,7 +124,7 @@ rcl_logging_rosout_init_publisher_for_node(
|
|||
* \return `RCL_RET_BAD_ALLOC` if allocating memory failed, or
|
||||
* \return `RCL_RET_ERROR` if an unspecified error occurs.
|
||||
*/
|
||||
RCL_LOCAL
|
||||
RCL_PUBLIC
|
||||
RCL_WARN_UNUSED
|
||||
rcl_ret_t
|
||||
rcl_logging_rosout_fini_publisher_for_node(
|
||||
|
|
|
@ -290,3 +290,27 @@ TEST_F(
|
|||
|
||||
EXPECT_EQ(RCL_RET_OK, rcl_logging_rosout_fini());
|
||||
}
|
||||
|
||||
/* Bad params
|
||||
*/
|
||||
TEST_F(
|
||||
CLASSNAME(
|
||||
TestLogRosoutFixtureNotParam, RMW_IMPLEMENTATION),
|
||||
test_bad_params_init_fini_node_publisher)
|
||||
{
|
||||
rcl_allocator_t allocator = rcl_get_default_allocator();
|
||||
rcl_node_t not_init_node = rcl_get_zero_initialized_node();
|
||||
EXPECT_EQ(RCL_RET_OK, rcl_logging_rosout_init(&allocator));
|
||||
|
||||
EXPECT_EQ(RCL_RET_NODE_INVALID, rcl_logging_rosout_init_publisher_for_node(nullptr));
|
||||
rcl_reset_error();
|
||||
EXPECT_EQ(RCL_RET_ERROR, rcl_logging_rosout_init_publisher_for_node(¬_init_node));
|
||||
rcl_reset_error();
|
||||
|
||||
EXPECT_EQ(RCL_RET_NODE_INVALID, rcl_logging_rosout_fini_publisher_for_node(nullptr));
|
||||
rcl_reset_error();
|
||||
EXPECT_EQ(RCL_RET_ERROR, rcl_logging_rosout_fini_publisher_for_node(¬_init_node));
|
||||
rcl_reset_error();
|
||||
|
||||
EXPECT_EQ(RCL_RET_OK, rcl_logging_rosout_fini());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue