diff --git a/rcl/test/rcl/test_init.cpp b/rcl/test/rcl/test_init.cpp index 0d4271fda..d4bd512c3 100644 --- a/rcl/test/rcl/test_init.cpp +++ b/rcl/test/rcl/test_init.cpp @@ -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(); } @@ -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(); }