From 46c7b2c7bbc957020571ec76d920a27d47be5def Mon Sep 17 00:00:00 2001 From: Michel Hidalgo Date: Wed, 30 Sep 2020 14:52:39 -0300 Subject: [PATCH] Fault inject a few more locations. Signed-off-by: Michel Hidalgo --- rmw_fastrtps_shared_cpp/src/rmw_wait.cpp | 5 +++++ rmw_fastrtps_shared_cpp/src/rmw_wait_set.cpp | 3 +++ 2 files changed, 8 insertions(+) diff --git a/rmw_fastrtps_shared_cpp/src/rmw_wait.cpp b/rmw_fastrtps_shared_cpp/src/rmw_wait.cpp index 18953630c..df35f97d8 100644 --- a/rmw_fastrtps_shared_cpp/src/rmw_wait.cpp +++ b/rmw_fastrtps_shared_cpp/src/rmw_wait.cpp @@ -14,6 +14,8 @@ #include "fastrtps/subscriber/Subscriber.h" +#include "rcutils/macros.h" + #include "rmw/error_handling.h" #include "rmw/rmw.h" @@ -99,6 +101,9 @@ __rmw_wait( rmw_wait_set_t * wait_set, const rmw_time_t * wait_timeout) { + RCUTILS_CAN_RETURN_WITH_ERROR_OF(RMW_RET_INVALID_ARGUMENT); + RCUTILS_CAN_RETURN_WITH_ERROR_OF(RMW_RET_INCORRECT_RMW_IMPLEMENTATION); + RMW_CHECK_ARGUMENT_FOR_NULL(wait_set, RMW_RET_INVALID_ARGUMENT); RMW_CHECK_TYPE_IDENTIFIERS_MATCH( wait set handle, diff --git a/rmw_fastrtps_shared_cpp/src/rmw_wait_set.cpp b/rmw_fastrtps_shared_cpp/src/rmw_wait_set.cpp index 2fbfa2ac5..c29137fe2 100644 --- a/rmw_fastrtps_shared_cpp/src/rmw_wait_set.cpp +++ b/rmw_fastrtps_shared_cpp/src/rmw_wait_set.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "rcutils/macros.h" + #include "rmw/allocators.h" #include "rmw/error_handling.h" #include "rmw/rmw.h" @@ -26,6 +28,7 @@ namespace rmw_fastrtps_shared_cpp rmw_wait_set_t * __rmw_create_wait_set(const char * identifier, rmw_context_t * context, size_t max_conditions) { + RCUTILS_CAN_RETURN_WITH_ERROR_OF(nullptr); RCUTILS_CHECK_ARGUMENT_FOR_NULL(context, NULL); RMW_CHECK_TYPE_IDENTIFIERS_MATCH( init context,