Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inject faults on __rmw_publish() and run_listener_thread() call. #441

Merged
merged 1 commit into from
Sep 23, 2020
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
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