Skip to content

Commit

Permalink
Pause fault injection
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Brawner <[email protected]>
  • Loading branch information
brawner committed Sep 2, 2020
1 parent 137820b commit c4352a1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rcl_yaml_param_parser/test/test_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,14 @@ TEST(RclYamlParamParser, test_parse_file_with_bad_allocator) {
// Not verifying res is true or false here, because eventually it will come back with an ok
// result. We're just trying to make sure that bad allocations are properly handled
(void)res;

// If `rcutils_string_array_fini` fails, there will be a small memory leak here.
// Pausing fault injection so this test runs clean
int64_t count = rcutils_fault_injection_get_count();
rcutils_fault_injection_set_count(RCUTILS_FAULT_INJECTION_NEVER_FAIL);
rcl_yaml_node_struct_fini(params_hdl);
rcutils_fault_injection_set_count(count);

params_hdl = NULL;
});
}
Expand Down

0 comments on commit c4352a1

Please sign in to comment.