diff --git a/googlemock/docs/cheat_sheet.md b/googlemock/docs/cheat_sheet.md index b425e0a0..5579c7c8 100644 --- a/googlemock/docs/cheat_sheet.md +++ b/googlemock/docs/cheat_sheet.md @@ -533,7 +533,6 @@ which must be a permanent callback. | `SaveArgPointee(pointer)` | Save the value pointed to by the `N`-th (0-based) argument to `*pointer`. | | `SetArgReferee(value)` | Assign value to the variable referenced by the `N`-th (0-based) argument. | | `SetArgPointee(value)` | Assign `value` to the variable pointed by the `N`-th (0-based) argument. | -| `SetArgumentPointee(value)` | Same as `SetArgPointee(value)`. Deprecated. Will be removed in v1.7.0. | | `SetArrayArgument(first, last)` | Copies the elements in source range [`first`, `last`) to the array pointed to by the `N`-th (0-based) argument, which can be either a pointer or an iterator. The action does not take ownership of the elements in the source range. | | `SetErrnoAndReturn(error, value)` | Set `errno` to `error` and return `value`. | | `Throw(exception)` | Throws the given exception, which can be any copyable value. Available since v1.1.0. | diff --git a/googlemock/include/gmock/gmock-actions.h b/googlemock/include/gmock/gmock-actions.h index 88011798..6454e6f4 100644 --- a/googlemock/include/gmock/gmock-actions.h +++ b/googlemock/include/gmock/gmock-actions.h @@ -513,7 +513,7 @@ class Action { // // Then the user creates the polymorphic action using // MakePolymorphicAction(object) where object has type FooAction. See -// the definition of Return(void) and SetArgumentPointee(value) for +// the definition of Return(void) and SetArgPointee(value) for // complete examples. template class PolymorphicAction { @@ -893,7 +893,7 @@ class SetErrnoAndReturnAction { #endif // !GTEST_OS_WINDOWS_MOBILE -// Implements the SetArgumentPointee(x) action for any function +// Implements the SetArgPointee(x) action for any function // whose N-th argument (0-based) is a pointer to x's type. template struct SetArgumentPointeeAction { @@ -1197,12 +1197,6 @@ internal::SetArgumentPointeeAction SetArgPointee(T value) { return {std::move(value)}; } -// The following version is DEPRECATED. -template -internal::SetArgumentPointeeAction SetArgumentPointee(T value) { - return {std::move(value)}; -} - // Creates an action that sets a pointer referent to a given value. template PolymorphicAction > Assign(T1* ptr, T2 val) { diff --git a/googlemock/test/gmock-actions_test.cc b/googlemock/test/gmock-actions_test.cc index 58a2d35a..051aefcc 100644 --- a/googlemock/test/gmock-actions_test.cc +++ b/googlemock/test/gmock-actions_test.cc @@ -76,7 +76,6 @@ using testing::ReturnRef; using testing::ReturnRefOfCopy; using testing::ReturnRoundRobin; using testing::SetArgPointee; -using testing::SetArgumentPointee; using testing::Unused; using testing::WithArgs; using testing::internal::BuiltInDefaultValue; @@ -920,26 +919,6 @@ TEST(SetArgPointeeTest, AcceptsWideCharPointer) { # endif } -// Tests that SetArgumentPointee(v) sets the variable pointed to by -// the N-th (0-based) argument to v. -TEST(SetArgumentPointeeTest, SetsTheNthPointee) { - typedef void MyFunction(bool, int*, char*); - Action a = SetArgumentPointee<1>(2); - - int n = 0; - char ch = '\0'; - a.Perform(std::make_tuple(true, &n, &ch)); - EXPECT_EQ(2, n); - EXPECT_EQ('\0', ch); - - a = SetArgumentPointee<2>('a'); - n = 0; - ch = '\0'; - a.Perform(std::make_tuple(true, &n, &ch)); - EXPECT_EQ(0, n); - EXPECT_EQ('a', ch); -} - // Sample functions and functors for testing Invoke() and etc. int Nullary() { return 1; }