From 402b1065f643576dfa7cca0ce9e5eaea2754e5a4 Mon Sep 17 00:00:00 2001 From: Jorge Perez Date: Thu, 13 Aug 2020 16:19:04 -0300 Subject: [PATCH] Change mock to inject on return Signed-off-by: Jorge Perez --- rcl/test/rcl/test_init.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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(); }