remove deprecated SetArgumentPointee function template

This commit is contained in:
Krystian Kuzniarek 2020-01-29 11:38:08 +01:00
parent 10b1902d89
commit 9425457d28
3 changed files with 2 additions and 30 deletions

View File

@ -533,7 +533,6 @@ which must be a permanent callback.
| `SaveArgPointee<N>(pointer)` | Save the value pointed to by the `N`-th (0-based) argument to `*pointer`. | | `SaveArgPointee<N>(pointer)` | Save the value pointed to by the `N`-th (0-based) argument to `*pointer`. |
| `SetArgReferee<N>(value)` | Assign value to the variable referenced by the `N`-th (0-based) argument. | | `SetArgReferee<N>(value)` | Assign value to the variable referenced by the `N`-th (0-based) argument. |
| `SetArgPointee<N>(value)` | Assign `value` to the variable pointed by the `N`-th (0-based) argument. | | `SetArgPointee<N>(value)` | Assign `value` to the variable pointed by the `N`-th (0-based) argument. |
| `SetArgumentPointee<N>(value)` | Same as `SetArgPointee<N>(value)`. Deprecated. Will be removed in v1.7.0. |
| `SetArrayArgument<N>(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. | | `SetArrayArgument<N>(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`. | | `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. | | `Throw(exception)` | Throws the given exception, which can be any copyable value. Available since v1.1.0. |

View File

@ -513,7 +513,7 @@ class Action {
// //
// Then the user creates the polymorphic action using // Then the user creates the polymorphic action using
// MakePolymorphicAction(object) where object has type FooAction. See // MakePolymorphicAction(object) where object has type FooAction. See
// the definition of Return(void) and SetArgumentPointee<N>(value) for // the definition of Return(void) and SetArgPointee<N>(value) for
// complete examples. // complete examples.
template <typename Impl> template <typename Impl>
class PolymorphicAction { class PolymorphicAction {
@ -893,7 +893,7 @@ class SetErrnoAndReturnAction {
#endif // !GTEST_OS_WINDOWS_MOBILE #endif // !GTEST_OS_WINDOWS_MOBILE
// Implements the SetArgumentPointee<N>(x) action for any function // Implements the SetArgPointee<N>(x) action for any function
// whose N-th argument (0-based) is a pointer to x's type. // whose N-th argument (0-based) is a pointer to x's type.
template <size_t N, typename A, typename = void> template <size_t N, typename A, typename = void>
struct SetArgumentPointeeAction { struct SetArgumentPointeeAction {
@ -1197,12 +1197,6 @@ internal::SetArgumentPointeeAction<N, T> SetArgPointee(T value) {
return {std::move(value)}; return {std::move(value)};
} }
// The following version is DEPRECATED.
template <size_t N, typename T>
internal::SetArgumentPointeeAction<N, T> SetArgumentPointee(T value) {
return {std::move(value)};
}
// Creates an action that sets a pointer referent to a given value. // Creates an action that sets a pointer referent to a given value.
template <typename T1, typename T2> template <typename T1, typename T2>
PolymorphicAction<internal::AssignAction<T1, T2> > Assign(T1* ptr, T2 val) { PolymorphicAction<internal::AssignAction<T1, T2> > Assign(T1* ptr, T2 val) {

View File

@ -76,7 +76,6 @@ using testing::ReturnRef;
using testing::ReturnRefOfCopy; using testing::ReturnRefOfCopy;
using testing::ReturnRoundRobin; using testing::ReturnRoundRobin;
using testing::SetArgPointee; using testing::SetArgPointee;
using testing::SetArgumentPointee;
using testing::Unused; using testing::Unused;
using testing::WithArgs; using testing::WithArgs;
using testing::internal::BuiltInDefaultValue; using testing::internal::BuiltInDefaultValue;
@ -920,26 +919,6 @@ TEST(SetArgPointeeTest, AcceptsWideCharPointer) {
# endif # endif
} }
// Tests that SetArgumentPointee<N>(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<MyFunction> 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. // Sample functions and functors for testing Invoke() and etc.
int Nullary() { return 1; } int Nullary() { return 1; }