Add fault injection macros and unit tests to rcl_lifecycle (#731)

* Add fault injection macros and unit tests to rcl_lifecycle

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* Address feedback

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* PR Fixup

Signed-off-by: Stephen Brawner <brawner@gmail.com>
This commit is contained in:
brawner 2020-08-31 12:59:19 -07:00 committed by Alejandro Hernández Cordero
parent b62b83b5cd
commit dd62d09042
5 changed files with 96 additions and 6 deletions

View file

@ -27,6 +27,7 @@ extern "C"
#include "rcl/error_handling.h"
#include "rcutils/logging_macros.h"
#include "rcutils/macros.h"
#include "rcutils/strdup.h"
#include "rcl_lifecycle/default_state_machine.h"
@ -80,6 +81,8 @@ rcl_lifecycle_state_fini(
rcl_lifecycle_state_t * state,
const rcl_allocator_t * allocator)
{
RCUTILS_CAN_RETURN_WITH_ERROR_OF(RCL_RET_ERROR);
if (!allocator) {
RCL_SET_ERROR_MSG("can't free state, no allocator given\n");
return RCL_RET_ERROR;