Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rcl/include/rcl/logging_rosout.h
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand Down
24 changes: 24 additions & 0 deletions rcl/test/rcl/test_logging_rosout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(&not_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(&not_init_node));
rcl_reset_error();

EXPECT_EQ(RCL_RET_OK, rcl_logging_rosout_fini());
}