Skip to content

Commit

Permalink
Change mock to inject on return
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Perez <[email protected]>
  • Loading branch information
Blast545 committed Aug 13, 2020
1 parent ecedb50 commit 402b106
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rcl/test/rcl/test_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ TEST_F(CLASSNAME(TestRCLFixture, RMW_IMPLEMENTATION), test_mocked_rcl_init_optio
rcl_init_options_t init_options = rcl_get_zero_initialized_init_options();
rcl_ret_t ret = rcl_init_options_init(&init_options, rcl_get_default_allocator());
ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str;
auto mock = mocking_utils::patch_and_return("lib:rcl", rmw_init_options_fini, RMW_RET_ERROR);
auto mock = mocking_utils::inject_on_return("lib:rcl", rmw_init_options_fini, RMW_RET_ERROR);
EXPECT_EQ(RCL_RET_ERROR, rcl_init_options_fini(&init_options));
rcl_reset_error();
}
Expand All @@ -488,7 +488,7 @@ TEST_F(CLASSNAME(TestRCLFixture, RMW_IMPLEMENTATION), test_rcl_init_copy_mocked_
EXPECT_EQ(RCL_RET_OK, rcl_init_options_fini(&init_options_dst)) << rcl_get_error_string().str;
});

auto mock = mocking_utils::patch_and_return("lib:rcl", rmw_init_options_fini, RMW_RET_ERROR);
auto mock = mocking_utils::inject_on_return("lib:rcl", rmw_init_options_fini, RMW_RET_ERROR);
EXPECT_EQ(RCL_RET_ERROR, rcl_init_options_copy(&init_options, &init_options_dst));
rcl_reset_error();
}
Expand Down

0 comments on commit 402b106

Please sign in to comment.