Skip to content

Commit

Permalink
Inject faults on __rmw_publish() and run_listener_thread() call. (#441)
Browse files Browse the repository at this point in the history
Signed-off-by: Michel Hidalgo <[email protected]>
  • Loading branch information
hidmic authored Sep 23, 2020
1 parent eea784e commit 5674f01
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rmw_fastrtps_shared_cpp/src/listener_thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ node_listener(rmw_context_t * context);
rmw_ret_t
rmw_fastrtps_shared_cpp::run_listener_thread(rmw_context_t * context)
{
RCUTILS_CAN_RETURN_WITH_ERROR_OF(RMW_RET_ERROR);

auto common_context = static_cast<rmw_dds_common::Context *>(context->impl->common);
common_context->thread_is_running.store(true);
common_context->listener_thread_gc = rmw_fastrtps_shared_cpp::__rmw_create_guard_condition(
Expand Down
8 changes: 8 additions & 0 deletions rmw_fastrtps_shared_cpp/src/rmw_publish.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ __rmw_publish(
const void * ros_message,
rmw_publisher_allocation_t * allocation)
{
RCUTILS_CAN_RETURN_WITH_ERROR_OF(RMW_RET_INVALID_ARGUMENT);
RCUTILS_CAN_RETURN_WITH_ERROR_OF(RMW_RET_INCORRECT_RMW_IMPLEMENTATION);
RCUTILS_CAN_RETURN_WITH_ERROR_OF(RMW_RET_ERROR);

(void) allocation;
RMW_CHECK_FOR_NULL_WITH_MSG(
publisher, "publisher handle is null",
Expand Down Expand Up @@ -66,6 +70,10 @@ __rmw_publish_serialized_message(
const rmw_serialized_message_t * serialized_message,
rmw_publisher_allocation_t * allocation)
{
RCUTILS_CAN_RETURN_WITH_ERROR_OF(RMW_RET_INVALID_ARGUMENT);
RCUTILS_CAN_RETURN_WITH_ERROR_OF(RMW_RET_INCORRECT_RMW_IMPLEMENTATION);
RCUTILS_CAN_RETURN_WITH_ERROR_OF(RMW_RET_ERROR);

(void) allocation;
RMW_CHECK_FOR_NULL_WITH_MSG(
publisher, "publisher handle is null",
Expand Down

0 comments on commit 5674f01

Please sign in to comment.