aboutsummaryrefslogtreecommitdiffstats
path: root/googlemock
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2018-10-09 14:50:26 -0400
committerGennadiy Civil <misterg@google.com>2018-10-09 16:25:58 -0400
commit7d3b73c85a42811309eac26e5cbe054c40b64785 (patch)
tree589142a210a7bf1ccfd51180586a35c4a6f73b68 /googlemock
parent5434989dbd8a15f14f33cbeb9d94801247031c95 (diff)
downloadgoogletest-7d3b73c85a42811309eac26e5cbe054c40b64785.tar.gz
googletest-7d3b73c85a42811309eac26e5cbe054c40b64785.tar.bz2
googletest-7d3b73c85a42811309eac26e5cbe054c40b64785.zip
Unconditionally use std::tuple.
Remove all mention of TR1 tuple and our own implementation of tuple. PiperOrigin-RevId: 216395043
Diffstat (limited to 'googlemock')
-rw-r--r--googlemock/CMakeLists.txt25
-rw-r--r--googlemock/include/gmock/gmock-actions.h6
-rw-r--r--googlemock/include/gmock/gmock-generated-actions.h366
-rw-r--r--googlemock/include/gmock/gmock-generated-actions.h.pump34
-rw-r--r--googlemock/include/gmock/gmock-generated-function-mockers.h1035
-rw-r--r--googlemock/include/gmock/gmock-generated-function-mockers.h.pump4
-rw-r--r--googlemock/include/gmock/gmock-generated-matchers.h138
-rw-r--r--googlemock/include/gmock/gmock-generated-matchers.h.pump19
-rw-r--r--googlemock/include/gmock/gmock-matchers.h92
-rw-r--r--googlemock/include/gmock/gmock-more-actions.h16
-rw-r--r--googlemock/include/gmock/internal/gmock-generated-internal-utils.h91
-rw-r--r--googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump8
-rw-r--r--googlemock/include/gmock/internal/gmock-internal-utils.h11
-rw-r--r--googlemock/test/gmock-actions_test.cc182
-rw-r--r--googlemock/test/gmock-generated-actions_test.cc223
-rw-r--r--googlemock/test/gmock-generated-internal-utils_test.cc40
-rw-r--r--googlemock/test/gmock-generated-matchers_test.cc82
-rw-r--r--googlemock/test/gmock-internal-utils_test.cc43
-rw-r--r--googlemock/test/gmock-matchers_test.cc93
-rw-r--r--googlemock/test/gmock-more-actions_test.cc162
20 files changed, 1297 insertions, 1373 deletions
diff --git a/googlemock/CMakeLists.txt b/googlemock/CMakeLists.txt
index 78762b0c..1fd758e7 100644
--- a/googlemock/CMakeLists.txt
+++ b/googlemock/CMakeLists.txt
@@ -75,18 +75,6 @@ set(gmock_build_include_dirs
"${gtest_SOURCE_DIR}")
include_directories(${gmock_build_include_dirs})
-# Summary of tuple support for Microsoft Visual Studio:
-# Compiler version(MS) version(cmake) Support
-# ---------- ----------- -------------- -----------------------------
-# <= VS 2010 <= 10 <= 1600 Use Google Tests's own tuple.
-# VS 2012 11 1700 std::tr1::tuple + _VARIADIC_MAX=10
-# VS 2013 12 1800 std::tr1::tuple
-# VS 2015 14 1900 std::tuple
-# VS 2017 15 >= 1910 std::tuple
-if (MSVC AND MSVC_VERSION EQUAL 1700)
- add_definitions(/D _VARIADIC_MAX=10)
-endif()
-
########################################################################
#
# Defines the gmock & gmock_main libraries. User tests should link
@@ -199,25 +187,12 @@ $env:Path = \"$project_bin;$env:Path\"
cxx_library(gmock_main_no_rtti "${cxx_no_rtti}"
"${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc)
- if (MSVC_VERSION LESS 1600) # 1600 is Visual Studio 2010.
- # Visual Studio 2010, 2012, and 2013 define symbols in std::tr1 that
- # conflict with our own definitions. Therefore using our own tuple does not
- # work on those compilers.
- cxx_library(gmock_main_use_own_tuple "${cxx_use_own_tuple}"
- "${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc)
-
- cxx_test_with_flags(gmock_use_own_tuple_test "${cxx_use_own_tuple}"
- gmock_main_use_own_tuple test/gmock-spec-builders_test.cc)
- endif()
else()
cxx_library(gmock_main_no_exception "${cxx_no_exception}" src/gmock_main.cc)
target_link_libraries(gmock_main_no_exception PUBLIC gmock)
cxx_library(gmock_main_no_rtti "${cxx_no_rtti}" src/gmock_main.cc)
target_link_libraries(gmock_main_no_rtti PUBLIC gmock)
-
- cxx_library(gmock_main_use_own_tuple "${cxx_use_own_tuple}" src/gmock_main.cc)
- target_link_libraries(gmock_main_use_own_tuple PUBLIC gmock)
endif()
cxx_test_with_flags(gmock-more-actions_no_exception_test "${cxx_no_exception}"
gmock_main_no_exception test/gmock-more-actions_test.cc)
diff --git a/googlemock/include/gmock/gmock-actions.h b/googlemock/include/gmock/gmock-actions.h
index e3b3f094..8e7e0e7b 100644
--- a/googlemock/include/gmock/gmock-actions.h
+++ b/googlemock/include/gmock/gmock-actions.h
@@ -439,7 +439,7 @@ class Action {
// template <typename Result, typename ArgumentTuple>
// Result Perform(const ArgumentTuple& args) const {
// // Processes the arguments and returns a result, using
-// // tr1::get<N>(args) to get the N-th (0-based) argument in the tuple.
+// // std::get<N>(args) to get the N-th (0-based) argument in the tuple.
// }
// ...
// };
@@ -838,7 +838,7 @@ class SetArgumentPointeeAction {
template <typename Result, typename ArgumentTuple>
void Perform(const ArgumentTuple& args) const {
CompileAssertTypesEqual<void, Result>();
- *::testing::get<N>(args) = value_;
+ *::std::get<N>(args) = value_;
}
private:
@@ -861,7 +861,7 @@ class SetArgumentPointeeAction<N, Proto, true> {
template <typename Result, typename ArgumentTuple>
void Perform(const ArgumentTuple& args) const {
CompileAssertTypesEqual<void, Result>();
- ::testing::get<N>(args)->CopyFrom(*proto_);
+ ::std::get<N>(args)->CopyFrom(*proto_);
}
private:
diff --git a/googlemock/include/gmock/gmock-generated-actions.h b/googlemock/include/gmock/gmock-generated-actions.h
index 260036da..3ea14dde 100644
--- a/googlemock/include/gmock/gmock-generated-actions.h
+++ b/googlemock/include/gmock/gmock-generated-actions.h
@@ -54,164 +54,167 @@ template <typename Result, typename ArgumentTuple>
class InvokeHelper;
template <typename R>
-class InvokeHelper<R, ::testing::tuple<> > {
+class InvokeHelper<R, ::std::tuple<> > {
public:
template <typename Function>
- static R Invoke(Function function, const ::testing::tuple<>&) {
+ static R Invoke(Function function, const ::std::tuple<>&) {
return function();
}
template <class Class, typename MethodPtr>
static R InvokeMethod(Class* obj_ptr,
MethodPtr method_ptr,
- const ::testing::tuple<>&) {
+ const ::std::tuple<>&) {
return (obj_ptr->*method_ptr)();
}
template <typename CallbackType>
static R InvokeCallback(CallbackType* callback,
- const ::testing::tuple<>&) {
+ const ::std::tuple<>&) {
return callback->Run();
}
};
template <typename R, typename A1>
-class InvokeHelper<R, ::testing::tuple<A1> > {
+class InvokeHelper<R, ::std::tuple<A1> > {
public:
template <typename Function>
- static R Invoke(Function function, const ::testing::tuple<A1>& args) {
- return function(get<0>(args));
+ static R Invoke(Function function, const ::std::tuple<A1>& args) {
+ return function(std::get<0>(args));
}
template <class Class, typename MethodPtr>
static R InvokeMethod(Class* obj_ptr,
MethodPtr method_ptr,
- const ::testing::tuple<A1>& args) {
- return (obj_ptr->*method_ptr)(get<0>(args));
+ const ::std::tuple<A1>& args) {
+ return (obj_ptr->*method_ptr)(std::get<0>(args));
}
template <typename CallbackType>
static R InvokeCallback(CallbackType* callback,
- const ::testing::tuple<A1>& args) {
- return callback->Run(get<0>(args));
+ const ::std::tuple<A1>& args) {
+ return callback->Run(std::get<0>(args));
}
};
template <typename R, typename A1, typename A2>
-class InvokeHelper<R, ::testing::tuple<A1, A2> > {
+class InvokeHelper<R, ::std::tuple<A1, A2> > {
public:
template <typename Function>
- static R Invoke(Function function, const ::testing::tuple<A1, A2>& args) {
- return function(get<0>(args), get<1>(args));
+ static R Invoke(Function function, const ::std::tuple<A1, A2>& args) {
+ return function(std::get<0>(args), std::get<1>(args));
}
template <class Class, typename MethodPtr>
static R InvokeMethod(Class* obj_ptr,
MethodPtr method_ptr,
- const ::testing::tuple<A1, A2>& args) {
- return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args));
+ const ::std::tuple<A1, A2>& args) {
+ return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args));
}
template <typename CallbackType>
static R InvokeCallback(CallbackType* callback,
- const ::testing::tuple<A1, A2>& args) {
- return callback->Run(get<0>(args), get<1>(args));
+ const ::std::tuple<A1, A2>& args) {
+ return callback->Run(std::get<0>(args), std::get<1>(args));
}
};
template <typename R, typename A1, typename A2, typename A3>
-class InvokeHelper<R, ::testing::tuple<A1, A2, A3> > {
+class InvokeHelper<R, ::std::tuple<A1, A2, A3> > {
public:
template <typename Function>
- static R Invoke(Function function, const ::testing::tuple<A1, A2, A3>& args) {
- return function(get<0>(args), get<1>(args), get<2>(args));
+ static R Invoke(Function function, const ::std::tuple<A1, A2, A3>& args) {
+ return function(std::get<0>(args), std::get<1>(args),
+ std::get<2>(args));
}
template <class Class, typename MethodPtr>
static R InvokeMethod(Class* obj_ptr,
MethodPtr method_ptr,
- const ::testing::tuple<A1, A2, A3>& args) {
- return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
- get<2>(args));
+ const ::std::tuple<A1, A2, A3>& args) {
+ return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args),
+ std::get<2>(args));
}
template <typename CallbackType>
static R InvokeCallback(CallbackType* callback,
- const ::testing::tuple<A1, A2, A3>& args) {
- return callback->Run(get<0>(args), get<1>(args), get<2>(args));
+ const ::std::tuple<A1, A2, A3>& args) {
+ return callback->Run(std::get<0>(args), std::get<1>(args),
+ std::get<2>(args));
}
};
template <typename R, typename A1, typename A2, typename A3, typename A4>
-class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4> > {
+class InvokeHelper<R, ::std::tuple<A1, A2, A3, A4> > {
public:
template <typename Function>
- static R Invoke(Function function, const ::testing::tuple<A1, A2, A3,
- A4>& args) {
- return function(get<0>(args), get<1>(args), get<2>(args),
- get<3>(args));
+ static R Invoke(Function function, const ::std::tuple<A1, A2, A3, A4>& args) {
+ return function(std::get<0>(args), std::get<1>(args),
+ std::get<2>(args), std::get<3>(args));
}
template <class Class, typename MethodPtr>
static R InvokeMethod(Class* obj_ptr,
MethodPtr method_ptr,
- const ::testing::tuple<A1, A2, A3, A4>& args) {
- return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
- get<2>(args), get<3>(args));
+ const ::std::tuple<A1, A2, A3, A4>& args) {
+ return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args),
+ std::get<2>(args), std::get<3>(args));
}
template <typename CallbackType>
static R InvokeCallback(CallbackType* callback,
- const ::testing::tuple<A1, A2, A3, A4>& args) {
- return callback->Run(get<0>(args), get<1>(args), get<2>(args),
- get<3>(args));
+ const ::std::tuple<A1, A2, A3, A4>& args) {
+ return callback->Run(std::get<0>(args), std::get<1>(args),
+ std::get<2>(args), std::get<3>(args));
}
};
template <typename R, typename A1, typename A2, typename A3, typename A4,
typename A5>
-class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5> > {
+class InvokeHelper<R, ::std::tuple<A1, A2, A3, A4, A5> > {
public:
template <typename Function>
- static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4,
+ static R Invoke(Function function, const ::std::tuple<A1, A2, A3, A4,
A5>& args) {
- return function(get<0>(args), get<1>(args), get<2>(args),
- get<3>(args), get<4>(args));
+ return function(std::get<0>(args), std::get<1>(args),
+ std::get<2>(args), std::get<3>(args), std::get<4>(args));
}
template <class Class, typename MethodPtr>
static R InvokeMethod(Class* obj_ptr,
MethodPtr method_ptr,
- const ::testing::tuple<A1, A2, A3, A4, A5>& args) {
- return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
- get<2>(args), get<3>(args), get<4>(args));
+ const ::std::tuple<A1, A2, A3, A4, A5>& args) {
+ return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args),
+ std::get<2>(args), std::get<3>(args), std::get<4>(args));
}
template <typename CallbackType>
static R InvokeCallback(CallbackType* callback,
- const ::testing::tuple<A1, A2, A3, A4, A5>& args) {
- return callback->Run(get<0>(args), get<1>(args), get<2>(args),
- get<3>(args), get<4>(args));
+ const ::std::tuple<A1, A2, A3, A4, A5>& args) {
+ return callback->Run(std::get<0>(args), std::get<1>(args),
+ std::get<2>(args), std::get<3>(args), std::get<4>(args));
}
};
template <typename R, typename A1, typename A2, typename A3, typename A4,
typename A5, typename A6>
-class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6> > {
+class InvokeHelper<R, ::std::tuple<A1, A2, A3, A4, A5, A6> > {
public:
template <typename Function>
- static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5,
+ static R Invoke(Function function, const ::std::tuple<A1, A2, A3, A4, A5,
A6>& args) {
- return function(get<0>(args), get<1>(args), get<2>(args),
- get<3>(args), get<4>(args), get<5>(args));
+ return function(std::get<0>(args), std::get<1>(args),
+ std::get<2>(args), std::get<3>(args), std::get<4>(args),
+ std::get<5>(args));
}
template <class Class, typename MethodPtr>
static R InvokeMethod(Class* obj_ptr,
MethodPtr method_ptr,
- const ::testing::tuple<A1, A2, A3, A4, A5, A6>& args) {
- return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
- get<2>(args), get<3>(args), get<4>(args), get<5>(args));
+ const ::std::tuple<A1, A2, A3, A4, A5, A6>& args) {
+ return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args),
+ std::get<2>(args), std::get<3>(args), std::get<4>(args),
+ std::get<5>(args));
}
// There is no InvokeCallback() for 6-tuples
@@ -219,23 +222,23 @@ class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6> > {
template <typename R, typename A1, typename A2, typename A3, typename A4,
typename A5, typename A6, typename A7>
-class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> > {
+class InvokeHelper<R, ::std::tuple<A1, A2, A3, A4, A5, A6, A7> > {
public:
template <typename Function>
- static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5,
- A6, A7>& args) {
- return function(get<0>(args), get<1>(args), get<2>(args),
- get<3>(args), get<4>(args), get<5>(args), get<6>(args));
+ static R Invoke(Function function, const ::std::tuple<A1, A2, A3, A4, A5, A6,
+ A7>& args) {
+ return function(std::get<0>(args), std::get<1>(args),
+ std::get<2>(args), std::get<3>(args), std::get<4>(args),
+ std::get<5>(args), std::get<6>(args));
}
template <class Class, typename MethodPtr>
static R InvokeMethod(Class* obj_ptr,
MethodPtr method_ptr,
- const ::testing::tuple<A1, A2, A3, A4, A5, A6,
- A7>& args) {
- return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
- get<2>(args), get<3>(args), get<4>(args), get<5>(args),
- get<6>(args));
+ const ::std::tuple<A1, A2, A3, A4, A5, A6, A7>& args) {
+ return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args),
+ std::get<2>(args), std::get<3>(args), std::get<4>(args),
+ std::get<5>(args), std::get<6>(args));
}
// There is no InvokeCallback() for 7-tuples
@@ -243,24 +246,24 @@ class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> > {
template <typename R, typename A1, typename A2, typename A3, typename A4,
typename A5, typename A6, typename A7, typename A8>
-class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > {
+class InvokeHelper<R, ::std::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > {
public:
template <typename Function>
- static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5,
- A6, A7, A8>& args) {
- return function(get<0>(args), get<1>(args), get<2>(args),
- get<3>(args), get<4>(args), get<5>(args), get<6>(args),
- get<7>(args));
+ static R Invoke(Function function, const ::std::tuple<A1, A2, A3, A4, A5, A6,
+ A7, A8>& args) {
+ return function(std::get<0>(args), std::get<1>(args),
+ std::get<2>(args), std::get<3>(args), std::get<4>(args),
+ std::get<5>(args), std::get<6>(args), std::get<7>(args));
}
template <class Class, typename MethodPtr>
static R InvokeMethod(Class* obj_ptr,
MethodPtr method_ptr,
- const ::testing::tuple<A1, A2, A3, A4, A5, A6, A7,
+ const ::std::tuple<A1, A2, A3, A4, A5, A6, A7,
A8>& args) {
- return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
- get<2>(args), get<3>(args), get<4>(args), get<5>(args),
- get<6>(args), get<7>(args));
+ return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args),
+ std::get<2>(args), std::get<3>(args), std::get<4>(args),
+ std::get<5>(args), std::get<6>(args), std::get<7>(args));
}
// There is no InvokeCallback() for 8-tuples
@@ -268,24 +271,26 @@ class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > {
template <typename R, typename A1, typename A2, typename A3, typename A4,
typename A5, typename A6, typename A7, typename A8, typename A9>
-class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {
+class InvokeHelper<R, ::std::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {
public:
template <typename Function>
- static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5,
- A6, A7, A8, A9>& args) {
- return function(get<0>(args), get<1>(args), get<2>(args),
- get<3>(args), get<4>(args), get<5>(args), get<6>(args),
- get<7>(args), get<8>(args));
+ static R Invoke(Function function, const ::std::tuple<A1, A2, A3, A4, A5, A6,
+ A7, A8, A9>& args) {
+ return function(std::get<0>(args), std::get<1>(args),
+ std::get<2>(args), std::get<3>(args), std::get<4>(args),
+ std::get<5>(args), std::get<6>(args), std::get<7>(args),
+ std::get<8>(args));
}
template <class Class, typename MethodPtr>
static R InvokeMethod(Class* obj_ptr,
MethodPtr method_ptr,
- const ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8,
+ const ::std::tuple<A1, A2, A3, A4, A5, A6, A7, A8,
A9>& args) {
- return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
- get<2>(args), get<3>(args), get<4>(args), get<5>(args),
- get<6>(args), get<7>(args), get<8>(args));
+ return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args),
+ std::get<2>(args), std::get<3>(args), std::get<4>(args),
+ std::get<5>(args), std::get<6>(args), std::get<7>(args),
+ std::get<8>(args));
}
// There is no InvokeCallback() for 9-tuples
@@ -294,25 +299,26 @@ class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {
template <typename R, typename A1, typename A2, typename A3, typename A4,
typename A5, typename A6, typename A7, typename A8, typename A9,
typename A10>
-class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
- A10> > {
+class InvokeHelper<R, ::std::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10> > {
public:
template <typename Function>
- static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5,
- A6, A7, A8, A9, A10>& args) {
- return function(get<0>(args), get<1>(args), get<2>(args),
- get<3>(args), get<4>(args), get<5>(args), get<6>(args),
- get<7>(args), get<8>(args), get<9>(args));
+ static R Invoke(Function function, const ::std::tuple<A1, A2, A3, A4, A5, A6,
+ A7, A8, A9, A10>& args) {
+ return function(std::get<0>(args), std::get<1>(args),
+ std::get<2>(args), std::get<3>(args), std::get<4>(args),
+ std::get<5>(args), std::get<6>(args), std::get<7>(args),
+ std::get<8>(args), std::get<9>(args));
}
template <class Class, typename MethodPtr>
static R InvokeMethod(Class* obj_ptr,
MethodPtr method_ptr,
- const ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8,
- A9, A10>& args) {
- return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
- get<2>(args), get<3>(args), get<4>(args), get<5>(args),
- get<6>(args), get<7>(args), get<8>(args), get<9>(args));
+ const ::std::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
+ A10>& args) {
+ return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args),
+ std::get<2>(args), std::get<3>(args), std::get<4>(args),
+ std::get<5>(args), std::get<6>(args), std::get<7>(args),
+ std::get<8>(args), std::get<9>(args));
}
// There is no InvokeCallback() for 10-tuples
@@ -346,20 +352,20 @@ class InvokeCallbackAction {
// An INTERNAL macro for extracting the type of a tuple field. It's
// subject to change without notice - DO NOT USE IN USER CODE!
#define GMOCK_FIELD_(Tuple, N) \
- typename ::testing::tuple_element<N, Tuple>::type
+ typename ::std::tuple_element<N, Tuple>::type
// SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::type is the
// type of an n-ary function whose i-th (1-based) argument type is the
// k{i}-th (0-based) field of ArgumentTuple, which must be a tuple
// type, and whose return type is Result. For example,
-// SelectArgs<int, ::testing::tuple<bool, char, double, long>, 0, 3>::type
+// SelectArgs<int, ::std::tuple<bool, char, double, long>, 0, 3>::type
// is int(bool, long).
//
// SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::Select(args)
// returns the selected fields (k1, k2, ..., k_n) of args as a tuple.
// For example,
-// SelectArgs<int, tuple<bool, char, double>, 2, 0>::Select(
-// ::testing::make_tuple(true, 'a', 2.5))
+// SelectArgs<int, std::tuple<bool, char, double>, 2, 0>::Select(
+// ::std::make_tuple(true, 'a', 2.5))
// returns tuple (2.5, true).
//
// The numbers in list k1, k2, ..., k_n must be >= 0, where n can be
@@ -378,9 +384,10 @@ class SelectArgs {
GMOCK_FIELD_(ArgumentTuple, k10));
typedef typename Function<type>::ArgumentTuple SelectedArgs;
static SelectedArgs Select(const ArgumentTuple& args) {
- return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
- get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args),
- get<k8>(args), get<k9>(args), get<k10>(args));
+ return SelectedArgs(std::get<k1>(args), std::get<k2>(args),
+ std::get<k3>(args), std::get<k4>(args), std::get<k5>(args),
+ std::get<k6>(args), std::get<k7>(args), std::get<k8>(args),
+ std::get<k9>(args), std::get<k10>(args));
}
};
@@ -402,7 +409,7 @@ class SelectArgs<Result, ArgumentTuple,
typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1));
typedef typename Function<type>::ArgumentTuple SelectedArgs;
static SelectedArgs Select(const ArgumentTuple& args) {
- return SelectedArgs(get<k1>(args));
+ return SelectedArgs(std::get<k1>(args));
}
};
@@ -414,7 +421,7 @@ class SelectArgs<Result, ArgumentTuple,
GMOCK_FIELD_(ArgumentTuple, k2));
typedef typename Function<type>::ArgumentTuple SelectedArgs;
static SelectedArgs Select(const ArgumentTuple& args) {
- return SelectedArgs(get<k1>(args), get<k2>(args));
+ return SelectedArgs(std::get<k1>(args), std::get<k2>(args));
}
};
@@ -426,7 +433,8 @@ class SelectArgs<Result, ArgumentTuple,
GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3));
typedef typename Function<type>::ArgumentTuple SelectedArgs;
static SelectedArgs Select(const ArgumentTuple& args) {
- return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args));
+ return SelectedArgs(std::get<k1>(args), std::get<k2>(args),
+ std::get<k3>(args));
}
};
@@ -440,8 +448,8 @@ class SelectArgs<Result, ArgumentTuple,
GMOCK_FIELD_(ArgumentTuple, k4));
typedef typename Function<type>::ArgumentTuple SelectedArgs;
static SelectedArgs Select(const ArgumentTuple& args) {
- return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
- get<k4>(args));
+ return SelectedArgs(std::get<k1>(args), std::get<k2>(args),
+ std::get<k3>(args), std::get<k4>(args));
}
};
@@ -455,8 +463,8 @@ class SelectArgs<Result, ArgumentTuple,
GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5));
typedef typename Function<type>::ArgumentTuple SelectedArgs;
static SelectedArgs Select(const ArgumentTuple& args) {
- return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
- get<k4>(args), get<k5>(args));
+ return SelectedArgs(std::get<k1>(args), std::get<k2>(args),
+ std::get<k3>(args), std::get<k4>(args), std::get<k5>(args));
}
};
@@ -471,8 +479,9 @@ class SelectArgs<Result, ArgumentTuple,
GMOCK_FIELD_(ArgumentTuple, k6));
typedef typename Function<type>::ArgumentTuple SelectedArgs;
static SelectedArgs Select(const ArgumentTuple& args) {
- return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
- get<k4>(args), get<k5>(args), get<k6>(args));
+ return SelectedArgs(std::get<k1>(args), std::get<k2>(args),
+ std::get<k3>(args), std::get<k4>(args), std::get<k5>(args),
+ std::get<k6>(args));
}
};
@@ -487,8 +496,9 @@ class SelectArgs<Result, ArgumentTuple,
GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7));
typedef typename Function<type>::ArgumentTuple SelectedArgs;
static SelectedArgs Select(const ArgumentTuple& args) {
- return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
- get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args));
+ return SelectedArgs(std::get<k1>(args), std::get<k2>(args),
+ std::get<k3>(args), std::get<k4>(args), std::get<k5>(args),
+ std::get<k6>(args), std::get<k7>(args));
}
};
@@ -504,9 +514,9 @@ class SelectArgs<Result, ArgumentTuple,
GMOCK_FIELD_(ArgumentTuple, k8));
typedef typename Function<type>::ArgumentTuple SelectedArgs;
static SelectedArgs Select(const ArgumentTuple& args) {
- return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
- get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args),
- get<k8>(args));
+ return SelectedArgs(std::get<k1>(args), std::get<k2>(args),
+ std::get<k3>(args), std::get<k4>(args), std::get<k5>(args),
+ std::get<k6>(args), std::get<k7>(args), std::get<k8>(args));
}
};
@@ -522,9 +532,10 @@ class SelectArgs<Result, ArgumentTuple,
GMOCK_FIELD_(ArgumentTuple, k8), GMOCK_FIELD_(ArgumentTuple, k9));
typedef typename Function<type>::ArgumentTuple SelectedArgs;
static SelectedArgs Select(const ArgumentTuple& args) {
- return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
- get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args),
- get<k8>(args), get<k9>(args));
+ return SelectedArgs(std::get<k1>(args), std::get<k2>(args),
+ std::get<k3>(args), std::get<k4>(args), std::get<k5>(args),
+ std::get<k6>(args), std::get<k7>(args), std::get<k8>(args),
+ std::get<k9>(args));
}
};
@@ -587,7 +598,7 @@ struct ExcessiveArg {};
template <typename Result, class Impl>
class ActionHelper {
public:
- static Result Perform(Impl* impl, const ::testing::tuple<>& args) {
+ static Result Perform(Impl* impl, const ::std::tuple<>& args) {
return impl->template gmock_PerformImpl<>(args, ExcessiveArg(),
ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
@@ -595,95 +606,96 @@ class ActionHelper {
}
template <typename A0>
- static Result Perform(Impl* impl, const ::testing::tuple<A0>& args) {
- return impl->template gmock_PerformImpl<A0>(args, get<0>(args),
+ static Result Perform(Impl* impl, const ::std::tuple<A0>& args) {
+ return impl->template gmock_PerformImpl<A0>(args, std::get<0>(args),
ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
ExcessiveArg());
}
template <typename A0, typename A1>
- static Result Perform(Impl* impl, const ::testing::tuple<A0, A1>& args) {
- return impl->template gmock_PerformImpl<A0, A1>(args, get<0>(args),
- get<1>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
+ static Result Perform(Impl* impl, const ::std::tuple<A0, A1>& args) {
+ return impl->template gmock_PerformImpl<A0, A1>(args, std::get<0>(args),
+ std::get<1>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
ExcessiveArg());
}
template <typename A0, typename A1, typename A2>
- static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2>& args) {
- return impl->template gmock_PerformImpl<A0, A1, A2>(args, get<0>(args),
- get<1>(args), get<2>(args), ExcessiveArg(), ExcessiveArg(),
+ static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2>& args) {
+ return impl->template gmock_PerformImpl<A0, A1, A2>(args,
+ std::get<0>(args), std::get<1>(args), std::get<2>(args),
ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
- ExcessiveArg());
+ ExcessiveArg(), ExcessiveArg(), ExcessiveArg());
}
template <typename A0, typename A1, typename A2, typename A3>
- static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2,
- A3>& args) {
- return impl->template gmock_PerformImpl<A0, A1, A2, A3>(args, get<0>(args),
- get<1>(args), get<2>(args), get<3>(args), ExcessiveArg(),
- ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
- ExcessiveArg());
+ static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2, A3>& args) {
+ return impl->template gmock_PerformImpl<A0, A1, A2, A3>(args,
+ std::get<0>(args), std::get<1>(args), std::get<2>(args),
+ std::get<3>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
+ ExcessiveArg(), ExcessiveArg(), ExcessiveArg());
}
template <typename A0, typename A1, typename A2, typename A3, typename A4>
- static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3,
+ static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2, A3,
A4>& args) {
return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4>(args,
- get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args),
- ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
- ExcessiveArg());
+ std::get<0>(args), std::get<1>(args), std::get<2>(args),
+ std::get<3>(args), std::get<4>(args), ExcessiveArg(), ExcessiveArg(),
+ ExcessiveArg(), ExcessiveArg(), ExcessiveArg());
}
template <typename A0, typename A1, typename A2, typename A3, typename A4,
typename A5>
- static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4,
+ static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2, A3, A4,
A5>& args) {
return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5>(args,
- get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args),
- get<5>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
- ExcessiveArg());
+ std::get<0>(args), std::get<1>(args), std::get<2>(args),
+ std::get<3>(args), std::get<4>(args), std::get<5>(args),
+ ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg());
}
template <typename A0, typename A1, typename A2, typename A3, typename A4,
typename A5, typename A6>
- static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4,
- A5, A6>& args) {
+ static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2, A3, A4, A5,
+ A6>& args) {
return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6>(args,
- get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args),
- get<5>(args), get<6>(args), ExcessiveArg(), ExcessiveArg(),
- ExcessiveArg());
+ std::get<0>(args), std::get<1>(args), std::get<2>(args),
+ std::get<3>(args), std::get<4>(args), std::get<5>(args),
+ std::get<6>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg());
}
template <typename A0, typename A1, typename A2, typename A3, typename A4,
typename A5, typename A6, typename A7>
- static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4,
- A5, A6, A7>& args) {
+ static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2, A3, A4, A5,
+ A6, A7>& args) {
return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6,
- A7>(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args),
- get<4>(args), get<5>(args), get<6>(args), get<7>(args), ExcessiveArg(),
- ExcessiveArg());
+ A7>(args, std::get<0>(args), std::get<1>(args), std::get<2>(args),
+ std::get<3>(args), std::get<4>(args), std::get<5>(args),
+ std::get<6>(args), std::get<7>(args), ExcessiveArg(), ExcessiveArg());
}
template <typename A0, typename A1, typename A2, typename A3, typename A4,
typename A5, typename A6, typename A7, typename A8>
- static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4,
- A5, A6, A7, A8>& args) {
+ static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2, A3, A4, A5,
+ A6, A7, A8>& args) {
return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, A7,
- A8>(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args),
- get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args),
+ A8>(args, std::get<0>(args), std::get<1>(args), std::get<2>(args),
+ std::get<3>(args), std::get<4>(args), std::get<5>(args),
+ std::get<6>(args), std::get<7>(args), std::get<8>(args),
ExcessiveArg());
}
template <typename A0, typename A1, typename A2, typename A3, typename A4,
typename A5, typename A6, typename A7, typename A8, typename A9>
- static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4,
- A5, A6, A7, A8, A9>& args) {
+ static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2, A3, A4, A5,
+ A6, A7, A8, A9>& args) {
return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, A7, A8,
- A9>(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args),
- get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args),
- get<9>(args));
+ A9>(args, std::get<0>(args), std::get<1>(args), std::get<2>(args),
+ std::get<3>(args), std::get<4>(args), std::get<5>(args),
+ std::get<6>(args), std::get<7>(args), std::get<8>(args),
+ std::get<9>(args));
}
};
@@ -950,8 +962,8 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
//
// MORE INFORMATION:
//
-// To learn more about using these macros, please search for 'ACTION'
-// on https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md
+// To learn more about using these macros, please search for 'ACTION' on
+// https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md
// An internal macro needed for implementing ACTION*().
#define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_\
@@ -991,7 +1003,7 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
// ACTION_TEMPLATE(DuplicateArg,
// HAS_2_TEMPLATE_PARAMS(int, k, typename, T),
// AND_1_VALUE_PARAMS(output)) {
-// *output = T(::testing::get<k>(args));
+// *output = T(::std::get<k>(args));
// }
// ...
// int n;
@@ -2389,7 +2401,7 @@ ACTION_TEMPLATE(InvokeArgument,
using internal::invoke_argument::InvokeArgumentAdl;
return InvokeArgumentAdl<return_type>(
internal::invoke_argument::AdlTag(),
- ::testing::get<k>(args));
+ ::std::get<k>(args));
}
ACTION_TEMPLATE(InvokeArgument,
@@ -2398,7 +2410,7 @@ ACTION_TEMPLATE(InvokeArgument,
using internal::invoke_argument::InvokeArgumentAdl;
return InvokeArgumentAdl<return_type>(
internal::invoke_argument::AdlTag(),
- ::testing::get<k>(args), p0);
+ ::std::get<k>(args), p0);
}
ACTION_TEMPLATE(InvokeArgument,
@@ -2407,7 +2419,7 @@ ACTION_TEMPLATE(InvokeArgument,
using internal::invoke_argument::InvokeArgumentAdl;
return InvokeArgumentAdl<return_type>(
internal::invoke_argument::AdlTag(),
- ::testing::get<k>(args), p0, p1);
+ ::std::get<k>(args), p0, p1);
}
ACTION_TEMPLATE(InvokeArgument,
@@ -2416,7 +2428,7 @@ ACTION_TEMPLATE(InvokeArgument,
using internal::invoke_argument::InvokeArgumentAdl;
return InvokeArgumentAdl<return_type>(
internal::invoke_argument::AdlTag(),
- ::testing::get<k>(args), p0, p1, p2);
+ ::std::get<k>(args), p0, p1, p2);
}
ACTION_TEMPLATE(InvokeArgument,
@@ -2425,7 +2437,7 @@ ACTION_TEMPLATE(InvokeArgument,
using internal::invoke_argument::InvokeArgumentAdl;
return InvokeArgumentAdl<return_type>(
internal::invoke_argument::AdlTag(),
- ::testing::get<k>(args), p0, p1, p2, p3);
+ ::std::get<k>(args), p0, p1, p2, p3);
}
ACTION_TEMPLATE(InvokeArgument,
@@ -2434,7 +2446,7 @@ ACTION_TEMPLATE(InvokeArgument,
using internal::invoke_argument::InvokeArgumentAdl;
return InvokeArgumentAdl<return_type>(
internal::invoke_argument::AdlTag(),
- ::testing::get<k>(args), p0, p1, p2, p3, p4);
+ ::std::get<k>(args), p0, p1, p2, p3, p4);
}
ACTION_TEMPLATE(InvokeArgument,
@@ -2443,7 +2455,7 @@ ACTION_TEMPLATE(InvokeArgument,
using internal::invoke_argument::InvokeArgumentAdl;
return InvokeArgumentAdl<return_type>(
internal::invoke_argument::AdlTag(),
- ::testing::get<k>(args), p0, p1, p2, p3, p4, p5);
+ ::std::get<k>(args), p0, p1, p2, p3, p4, p5);
}
ACTION_TEMPLATE(InvokeArgument,
@@ -2452,7 +2464,7 @@ ACTION_TEMPLATE(InvokeArgument,
using internal::invoke_argument::InvokeArgumentAdl;
return InvokeArgumentAdl<return_type>(
internal::invoke_argument::AdlTag(),
- ::testing::get<k>(args), p0, p1, p2, p3, p4, p5, p6);
+ ::std::get<k>(args), p0, p1, p2, p3, p4, p5, p6);
}
ACTION_TEMPLATE(InvokeArgument,
@@ -2461,7 +2473,7 @@ ACTION_TEMPLATE(InvokeArgument,
using internal::invoke_argument::InvokeArgumentAdl;
return InvokeArgumentAdl<return_type>(
internal::invoke_argument::AdlTag(),
- ::testing::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7);
+ ::std::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7);
}
ACTION_TEMPLATE(InvokeArgument,
@@ -2470,7 +2482,7 @@ ACTION_TEMPLATE(InvokeArgument,
using internal::invoke_argument::InvokeArgumentAdl;
return InvokeArgumentAdl<return_type>(
internal::invoke_argument::AdlTag(),
- ::testing::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7, p8);
+ ::std::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7, p8);
}
ACTION_TEMPLATE(InvokeArgument,
@@ -2479,7 +2491,7 @@ ACTION_TEMPLATE(InvokeArgument,
using internal::invoke_argument::InvokeArgumentAdl;
return InvokeArgumentAdl<return_type>(
internal::invoke_argument::AdlTag(),
- ::testing::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
+ ::std::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
}
// Various overloads for ReturnNew<T>().
diff --git a/googlemock/include/gmock/gmock-generated-actions.h.pump b/googlemock/include/gmock/gmock-generated-actions.h.pump
index f1ee4a61..2794ebb7 100644
--- a/googlemock/include/gmock/gmock-generated-actions.h.pump
+++ b/googlemock/include/gmock/gmock-generated-actions.h.pump
@@ -63,19 +63,19 @@ $range j 1..i
$var types = [[$for j [[, typename A$j]]]]
$var as = [[$for j, [[A$j]]]]
$var args = [[$if i==0 [[]] $else [[ args]]]]
-$var gets = [[$for j, [[get<$(j - 1)>(args)]]]]
+$var gets = [[$for j, [[std::get<$(j - 1)>(args)]]]]
template <typename R$types>
-class InvokeHelper<R, ::testing::tuple<$as> > {
+class InvokeHelper<R, ::std::tuple<$as> > {
public:
template <typename Function>
- static R Invoke(Function function, const ::testing::tuple<$as>&$args) {
+ static R Invoke(Function function, const ::std::tuple<$as>&$args) {
return function($gets);
}
template <class Class, typename MethodPtr>
static R InvokeMethod(Class* obj_ptr,
MethodPtr method_ptr,
- const ::testing::tuple<$as>&$args) {
+ const ::std::tuple<$as>&$args) {
return (obj_ptr->*method_ptr)($gets);
}
@@ -83,7 +83,7 @@ class InvokeHelper<R, ::testing::tuple<$as> > {
$if i <= max_callback_arity [[
template <typename CallbackType>
static R InvokeCallback(CallbackType* callback,
- const ::testing::tuple<$as>&$args) {
+ const ::std::tuple<$as>&$args) {
return callback->Run($gets);
}
]] $else [[
@@ -122,7 +122,7 @@ class InvokeCallbackAction {
// An INTERNAL macro for extracting the type of a tuple field. It's
// subject to change without notice - DO NOT USE IN USER CODE!
#define GMOCK_FIELD_(Tuple, N) \
- typename ::testing::tuple_element<N, Tuple>::type
+ typename ::std::tuple_element<N, Tuple>::type
$range i 1..n
@@ -130,14 +130,14 @@ $range i 1..n
// type of an n-ary function whose i-th (1-based) argument type is the
// k{i}-th (0-based) field of ArgumentTuple, which must be a tuple
// type, and whose return type is Result. For example,
-// SelectArgs<int, ::testing::tuple<bool, char, double, long>, 0, 3>::type
+// SelectArgs<int, ::std::tuple<bool, char, double, long>, 0, 3>::type
// is int(bool, long).
//
// SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::Select(args)
// returns the selected fields (k1, k2, ..., k_n) of args as a tuple.
// For example,
-// SelectArgs<int, tuple<bool, char, double>, 2, 0>::Select(
-// ::testing::make_tuple(true, 'a', 2.5))
+// SelectArgs<int, std::tuple<bool, char, double>, 2, 0>::Select(
+// ::std::make_tuple(true, 'a', 2.5))
// returns tuple (2.5, true).
//
// The numbers in list k1, k2, ..., k_n must be >= 0, where n can be
@@ -150,7 +150,7 @@ class SelectArgs {
typedef Result type($for i, [[GMOCK_FIELD_(ArgumentTuple, k$i)]]);
typedef typename Function<type>::ArgumentTuple SelectedArgs;
static SelectedArgs Select(const ArgumentTuple& args) {
- return SelectedArgs($for i, [[get<k$i>(args)]]);
+ return SelectedArgs($for i, [[std::get<k$i>(args)]]);
}
};
@@ -166,7 +166,7 @@ class SelectArgs<Result, ArgumentTuple,
typedef typename Function<type>::ArgumentTuple SelectedArgs;
static SelectedArgs Select(const ArgumentTuple& [[]]
$if i == 1 [[/* args */]] $else [[args]]) {
- return SelectedArgs($for j1, [[get<k$j1>(args)]]);
+ return SelectedArgs($for j1, [[std::get<k$j1>(args)]]);
}
};
@@ -240,12 +240,12 @@ $range j 0..i-1
]]]]
$range j 0..i-1
$var As = [[$for j, [[A$j]]]]
-$var as = [[$for j, [[get<$j>(args)]]]]
+$var as = [[$for j, [[std::get<$j>(args)]]]]
$range k 1..n-i
$var eas = [[$for k, [[ExcessiveArg()]]]]
$var arg_list = [[$if (i==0) | (i==n) [[$as$eas]] $else [[$as, $eas]]]]
$template
- static Result Perform(Impl* impl, const ::testing::tuple<$As>& args) {
+ static Result Perform(Impl* impl, const ::std::tuple<$As>& args) {
return impl->template gmock_PerformImpl<$As>(args, $arg_list);
}
@@ -395,8 +395,8 @@ $range j2 2..i
//
// MORE INFORMATION:
//
-// To learn more about using these macros, please search for 'ACTION'
-// on https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md
+// To learn more about using these macros, please search for 'ACTION' on
+// https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md
$range i 0..n
$range k 0..n-1
@@ -432,7 +432,7 @@ $for k [[, \
// ACTION_TEMPLATE(DuplicateArg,
// HAS_2_TEMPLATE_PARAMS(int, k, typename, T),
// AND_1_VALUE_PARAMS(output)) {
-// *output = T(::testing::get<k>(args));
+// *output = T(::std::get<k>(args));
// }
// ...
// int n;
@@ -796,7 +796,7 @@ ACTION_TEMPLATE(InvokeArgument,
using internal::invoke_argument::InvokeArgumentAdl;
return InvokeArgumentAdl<return_type>(
internal::invoke_argument::AdlTag(),
- ::testing::get<k>(args)$for j [[, p$j]]);
+ ::std::get<k>(args)$for j [[, p$j]]);
}
]]
diff --git a/googlemock/include/gmock/gmock-generated-function-mockers.h b/googlemock/include/gmock/gmock-generated-function-mockers.h
index aab45820..98861156 100644
--- a/googlemock/include/gmock/gmock-generated-function-mockers.h
+++ b/googlemock/include/gmock/gmock-generated-function-mockers.h
@@ -70,7 +70,7 @@ class FunctionMocker<R()> : public
typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
MockSpec<F> With() {
- return MockSpec<F>(this, ::testing::make_tuple());
+ return MockSpec<F>(this, ::std::make_tuple());
}
R Invoke() {
@@ -90,7 +90,7 @@ class FunctionMocker<R(A1)> : public
typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
MockSpec<F> With(const Matcher<A1>& m1) {
- return MockSpec<F>(this, ::testing::make_tuple(m1));
+ return MockSpec<F>(this, ::std::make_tuple(m1));
}
R Invoke(A1 a1) {
@@ -110,7 +110,7 @@ class FunctionMocker<R(A1, A2)> : public
typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
MockSpec<F> With(const Matcher<A1>& m1, const Matcher<A2>& m2) {
- return MockSpec<F>(this, ::testing::make_tuple(m1, m2));
+ return MockSpec<F>(this, ::std::make_tuple(m1, m2));
}
R Invoke(A1 a1, A2 a2) {
@@ -132,7 +132,7 @@ class FunctionMocker<R(A1, A2, A3)> : public
MockSpec<F> With(const Matcher<A1>& m1, const Matcher<A2>& m2,
const Matcher<A3>& m3) {
- return MockSpec<F>(this, ::testing::make_tuple(m1, m2, m3));
+ return MockSpec<F>(this, ::std::make_tuple(m1, m2, m3));
}
R Invoke(A1 a1, A2 a2, A3 a3) {
@@ -154,7 +154,7 @@ class FunctionMocker<R(A1, A2, A3, A4)> : public
MockSpec<F> With(const Matcher<A1>& m1, const Matcher<A2>& m2,
const Matcher<A3>& m3, const Matcher<A4>& m4) {
- return MockSpec<F>(this, ::testing::make_tuple(m1, m2, m3, m4));
+ return MockSpec<F>(this, ::std::make_tuple(m1, m2, m3, m4));
}
R Invoke(A1 a1, A2 a2, A3 a3, A4 a4) {
@@ -178,7 +178,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5)> : public
MockSpec<F> With(const Matcher<A1>& m1, const Matcher<A2>& m2,
const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5) {
- return MockSpec<F>(this, ::testing::make_tuple(m1, m2, m3, m4, m5));
+ return MockSpec<F>(this, ::std::make_tuple(m1, m2, m3, m4, m5));
}
R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) {
@@ -203,7 +203,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6)> : public
MockSpec<F> With(const Matcher<A1>& m1, const Matcher<A2>& m2,
const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
const Matcher<A6>& m6) {
- return MockSpec<F>(this, ::testing::make_tuple(m1, m2, m3, m4, m5, m6));
+ return MockSpec<F>(this, ::std::make_tuple(m1, m2, m3, m4, m5, m6));
}
R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) {
@@ -229,7 +229,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7)> : public
MockSpec<F> With(const Matcher<A1>& m1, const Matcher<A2>& m2,
const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
const Matcher<A6>& m6, const Matcher<A7>& m7) {
- return MockSpec<F>(this, ::testing::make_tuple(m1, m2, m3, m4, m5, m6, m7));
+ return MockSpec<F>(this, ::std::make_tuple(m1, m2, m3, m4, m5, m6, m7));
}
R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) {
@@ -255,8 +255,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8)> : public
MockSpec<F> With(const Matcher<A1>& m1, const Matcher<A2>& m2,
const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8) {
- return MockSpec<F>(this, ::testing::make_tuple(m1, m2, m3, m4, m5, m6, m7,
- m8));
+ return MockSpec<F>(this, ::std::make_tuple(m1, m2, m3, m4, m5, m6, m7, m8));
}
R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) {
@@ -284,8 +283,8 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> : public
const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8,
const Matcher<A9>& m9) {
- return MockSpec<F>(this, ::testing::make_tuple(m1, m2, m3, m4, m5, m6, m7,
- m8, m9));
+ return MockSpec<F>(this, ::std::make_tuple(m1, m2, m3, m4, m5, m6, m7, m8,
+ m9));
}
R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) {
@@ -314,8 +313,8 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> : public
const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8,
const Matcher<A9>& m9, const Matcher<A10>& m10) {
- return MockSpec<F>(this, ::testing::make_tuple(m1, m2, m3, m4, m5, m6, m7,
- m8, m9, m10));
+ return MockSpec<F>(this, ::std::make_tuple(m1, m2, m3, m4, m5, m6, m7, m8,
+ m9, m10));
}
R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9,
@@ -418,534 +417,478 @@ using internal::FunctionMocker;
GTEST_CONCAT_TOKEN_(gmock##constness##arity##_##Method##_, __LINE__)
// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
-#define GMOCK_METHOD0_(tn, constness, ct, Method, ...) \
- GMOCK_RESULT_(tn, __VA_ARGS__) ct Method() constness { \
- GTEST_COMPILE_ASSERT_( \
- (::testing::tuple_size<tn ::testing::internal::Function< \
- __VA_ARGS__>::ArgumentTuple>::value == 0), \
- this_method_does_not_take_0_arguments); \
- GMOCK_MOCKER_(0, constness, Method).SetOwnerAndName(this, #Method); \
- return GMOCK_MOCKER_(0, constness, Method).Invoke(); \
- } \
- ::testing::MockSpec<__VA_ARGS__> gmock_##Method() constness { \
- GMOCK_MOCKER_(0, constness, Method).RegisterOwner(this); \
- return GMOCK_MOCKER_(0, constness, Method).With(); \
- } \
- ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
- const ::testing::internal::WithoutMatchers&, \
- constness ::testing::internal::Function<__VA_ARGS__>*) const { \
- return ::testing::internal::AdjustConstness_##constness(this) \
- ->gmock_##Method(); \
- } \
+#define GMOCK_METHOD0_(tn, constness, ct, Method, ...) \
+ GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+ ) constness { \
+ GTEST_COMPILE_ASSERT_((::std::tuple_size< \
+ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+ == 0), \
+ this_method_does_not_take_0_arguments); \
+ GMOCK_MOCKER_(0, constness, Method).SetOwnerAndName(this, #Method); \
+ return GMOCK_MOCKER_(0, constness, Method).Invoke(); \
+ } \
+ ::testing::MockSpec<__VA_ARGS__> \
+ gmock_##Method() constness { \
+ GMOCK_MOCKER_(0, constness, Method).RegisterOwner(this); \
+ return GMOCK_MOCKER_(0, constness, Method).With(); \
+ } \
+ ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
+ const ::testing::internal::WithoutMatchers&, \
+ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \
+ return ::testing::internal::AdjustConstness_##constness(this)-> \
+ gmock_##Method(); \
+ } \
mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(0, constness, \
- Method)
+ Method)
// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
-#define GMOCK_METHOD1_(tn, constness, ct, Method, ...) \
- GMOCK_RESULT_(tn, __VA_ARGS__) \
- ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1) constness { \
- GTEST_COMPILE_ASSERT_( \
- (::testing::tuple_size<tn ::testing::internal::Function< \
- __VA_ARGS__>::ArgumentTuple>::value == 1), \
- this_method_does_not_take_1_argument); \
- GMOCK_MOCKER_(1, constness, Method).SetOwnerAndName(this, #Method); \
- return GMOCK_MOCKER_(1, constness, Method) \
- .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \
- gmock_a1)); \
- } \
- ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
- GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1) constness { \
- GMOCK_MOCKER_(1, constness, Method).RegisterOwner(this); \
- return GMOCK_MOCKER_(1, constness, Method).With(gmock_a1); \
- } \
- ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
- const ::testing::internal::WithoutMatchers&, \
- constness ::testing::internal::Function<__VA_ARGS__>*) const { \
- return ::testing::internal::AdjustConstness_##constness(this) \
- ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>()); \
- } \
- mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(1, constness, \
- Method)
+#define GMOCK_METHOD1_(tn, constness, ct, Method, ...) \
+ GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+ GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1) constness { \
+ GTEST_COMPILE_ASSERT_((::std::tuple_size< \
+ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+ == 1), \
+ this_method_does_not_take_1_argument); \
+ GMOCK_MOCKER_(1, constness, Method).SetOwnerAndName(this, #Method); \
+ return GMOCK_MOCKER_(1, constness, \
+ Method).Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, \
+ __VA_ARGS__)>(gmock_a1)); \
+ } \
+ ::testing::MockSpec<__VA_ARGS__> \
+ gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1) constness { \
+ GMOCK_MOCKER_(1, constness, Method).RegisterOwner(this); \
+ return GMOCK_MOCKER_(1, constness, Method).With(gmock_a1); \
+ } \
+ ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
+ const ::testing::internal::WithoutMatchers&, \
+ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \
+ return ::testing::internal::AdjustConstness_##constness(this)-> \
+ gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>()); \
+ } \
+ mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(1, constness, \
+ Method)
// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
-#define GMOCK_METHOD2_(tn, constness, ct, Method, ...) \
- GMOCK_RESULT_(tn, __VA_ARGS__) \
- ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
- GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2) constness { \
- GTEST_COMPILE_ASSERT_( \
- (::testing::tuple_size<tn ::testing::internal::Function< \
- __VA_ARGS__>::ArgumentTuple>::value == 2), \
- this_method_does_not_take_2_arguments); \
- GMOCK_MOCKER_(2, constness, Method).SetOwnerAndName(this, #Method); \
- return GMOCK_MOCKER_(2, constness, Method) \
- .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \
- gmock_a1), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \
- gmock_a2)); \
- } \
- ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
- GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
- GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2) constness { \
- GMOCK_MOCKER_(2, constness, Method).RegisterOwner(this); \
- return GMOCK_MOCKER_(2, constness, Method).With(gmock_a1, gmock_a2); \
- } \
- ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
- const ::testing::internal::WithoutMatchers&, \
- constness ::testing::internal::Function<__VA_ARGS__>*) const { \
- return ::testing::internal::AdjustConstness_##constness(this) \
- ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>()); \
- } \
- mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(2, constness, \
- Method)
+#define GMOCK_METHOD2_(tn, constness, ct, Method, ...) \
+ GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+ GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \
+ __VA_ARGS__) gmock_a2) constness { \
+ GTEST_COMPILE_ASSERT_((::std::tuple_size< \
+ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+ == 2), \
+ this_method_does_not_take_2_arguments); \
+ GMOCK_MOCKER_(2, constness, Method).SetOwnerAndName(this, #Method); \
+ return GMOCK_MOCKER_(2, constness, \
+ Method).Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, \
+ __VA_ARGS__)>(gmock_a1), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2)); \
+ } \
+ ::testing::MockSpec<__VA_ARGS__> \
+ gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
+ GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2) constness { \
+ GMOCK_MOCKER_(2, constness, Method).RegisterOwner(this); \
+ return GMOCK_MOCKER_(2, constness, Method).With(gmock_a1, gmock_a2); \
+ } \
+ ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
+ const ::testing::internal::WithoutMatchers&, \
+ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \
+ return ::testing::internal::AdjustConstness_##constness(this)-> \
+ gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>()); \
+ } \
+ mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(2, constness, \
+ Method)
// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
-#define GMOCK_METHOD3_(tn, constness, ct, Method, ...) \
- GMOCK_RESULT_(tn, __VA_ARGS__) \
- ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
- GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
- GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3) constness { \
- GTEST_COMPILE_ASSERT_( \
- (::testing::tuple_size<tn ::testing::internal::Function< \
- __VA_ARGS__>::ArgumentTuple>::value == 3), \
- this_method_does_not_take_3_arguments); \
- GMOCK_MOCKER_(3, constness, Method).SetOwnerAndName(this, #Method); \
- return GMOCK_MOCKER_(3, constness, Method) \
- .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \
- gmock_a1), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \
- gmock_a2), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \
- gmock_a3)); \
- } \
- ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
- GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
- GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
- GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3) constness { \
- GMOCK_MOCKER_(3, constness, Method).RegisterOwner(this); \
- return GMOCK_MOCKER_(3, constness, Method) \
- .With(gmock_a1, gmock_a2, gmock_a3); \
- } \
- ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
- const ::testing::internal::WithoutMatchers&, \
- constness ::testing::internal::Function<__VA_ARGS__>*) const { \
- return ::testing::internal::AdjustConstness_##constness(this) \
- ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>()); \
- } \
- mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(3, constness, \
- Method)
+#define GMOCK_METHOD3_(tn, constness, ct, Method, ...) \
+ GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+ GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \
+ __VA_ARGS__) gmock_a2, GMOCK_ARG_(tn, 3, \
+ __VA_ARGS__) gmock_a3) constness { \
+ GTEST_COMPILE_ASSERT_((::std::tuple_size< \
+ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+ == 3), \
+ this_method_does_not_take_3_arguments); \
+ GMOCK_MOCKER_(3, constness, Method).SetOwnerAndName(this, #Method); \
+ return GMOCK_MOCKER_(3, constness, \
+ Method).Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, \
+ __VA_ARGS__)>(gmock_a1), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3)); \
+ } \
+ ::testing::MockSpec<__VA_ARGS__> \
+ gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
+ GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
+ GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3) constness { \
+ GMOCK_MOCKER_(3, constness, Method).RegisterOwner(this); \
+ return GMOCK_MOCKER_(3, constness, Method).With(gmock_a1, gmock_a2, \
+ gmock_a3); \
+ } \
+ ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
+ const ::testing::internal::WithoutMatchers&, \
+ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \
+ return ::testing::internal::AdjustConstness_##constness(this)-> \
+ gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>()); \
+ } \
+ mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(3, constness, \
+ Method)
// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
-#define GMOCK_METHOD4_(tn, constness, ct, Method, ...) \
- GMOCK_RESULT_(tn, __VA_ARGS__) \
- ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
- GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
- GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
- GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4) constness { \
- GTEST_COMPILE_ASSERT_( \
- (::testing::tuple_size<tn ::testing::internal::Function< \
- __VA_ARGS__>::ArgumentTuple>::value == 4), \
- this_method_does_not_take_4_arguments); \
- GMOCK_MOCKER_(4, constness, Method).SetOwnerAndName(this, #Method); \
- return GMOCK_MOCKER_(4, constness, Method) \
- .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \
- gmock_a1), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \
- gmock_a2), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \
- gmock_a3), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \
- gmock_a4)); \
- } \
- ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
- GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
- GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
- GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
- GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4) constness { \
- GMOCK_MOCKER_(4, constness, Method).RegisterOwner(this); \
- return GMOCK_MOCKER_(4, constness, Method) \
- .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4); \
- } \
- ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
- const ::testing::internal::WithoutMatchers&, \
- constness ::testing::internal::Function<__VA_ARGS__>*) const { \
- return ::testing::internal::AdjustConstness_##constness(this) \
- ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>()); \
- } \
- mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(4, constness, \
- Method)
+#define GMOCK_METHOD4_(tn, constness, ct, Method, ...) \
+ GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+ GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \
+ __VA_ARGS__) gmock_a2, GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
+ GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4) constness { \
+ GTEST_COMPILE_ASSERT_((::std::tuple_size< \
+ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+ == 4), \
+ this_method_does_not_take_4_arguments); \
+ GMOCK_MOCKER_(4, constness, Method).SetOwnerAndName(this, #Method); \
+ return GMOCK_MOCKER_(4, constness, \
+ Method).Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, \
+ __VA_ARGS__)>(gmock_a1), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(gmock_a4)); \
+ } \
+ ::testing::MockSpec<__VA_ARGS__> \
+ gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
+ GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
+ GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
+ GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4) constness { \
+ GMOCK_MOCKER_(4, constness, Method).RegisterOwner(this); \
+ return GMOCK_MOCKER_(4, constness, Method).With(gmock_a1, gmock_a2, \
+ gmock_a3, gmock_a4); \
+ } \
+ ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
+ const ::testing::internal::WithoutMatchers&, \
+ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \
+ return ::testing::internal::AdjustConstness_##constness(this)-> \
+ gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>()); \
+ } \
+ mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(4, constness, \
+ Method)
// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
-#define GMOCK_METHOD5_(tn, constness, ct, Method, ...) \
- GMOCK_RESULT_(tn, __VA_ARGS__) \
- ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
- GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
- GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
- GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
- GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5) constness { \
- GTEST_COMPILE_ASSERT_( \
- (::testing::tuple_size<tn ::testing::internal::Function< \
- __VA_ARGS__>::ArgumentTuple>::value == 5), \
- this_method_does_not_take_5_arguments); \
- GMOCK_MOCKER_(5, constness, Method).SetOwnerAndName(this, #Method); \
- return GMOCK_MOCKER_(5, constness, Method) \
- .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \
- gmock_a1), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \
- gmock_a2), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \
- gmock_a3), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \
- gmock_a4), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>( \
- gmock_a5)); \
- } \
- ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
- GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
- GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
- GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
- GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
- GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5) constness { \
- GMOCK_MOCKER_(5, constness, Method).RegisterOwner(this); \
- return GMOCK_MOCKER_(5, constness, Method) \
- .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5); \
- } \
- ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
- const ::testing::internal::WithoutMatchers&, \
- constness ::testing::internal::Function<__VA_ARGS__>*) const { \
- return ::testing::internal::AdjustConstness_##constness(this) \
- ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>()); \
- } \
- mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(5, constness, \
- Method)
+#define GMOCK_METHOD5_(tn, constness, ct, Method, ...) \
+ GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+ GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \
+ __VA_ARGS__) gmock_a2, GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
+ GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, GMOCK_ARG_(tn, 5, \
+ __VA_ARGS__) gmock_a5) constness { \
+ GTEST_COMPILE_ASSERT_((::std::tuple_size< \
+ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+ == 5), \
+ this_method_does_not_take_5_arguments); \
+ GMOCK_MOCKER_(5, constness, Method).SetOwnerAndName(this, #Method); \
+ return GMOCK_MOCKER_(5, constness, \
+ Method).Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, \
+ __VA_ARGS__)>(gmock_a1), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(gmock_a4), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(gmock_a5)); \
+ } \
+ ::testing::MockSpec<__VA_ARGS__> \
+ gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
+ GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
+ GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
+ GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
+ GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5) constness { \
+ GMOCK_MOCKER_(5, constness, Method).RegisterOwner(this); \
+ return GMOCK_MOCKER_(5, constness, Method).With(gmock_a1, gmock_a2, \
+ gmock_a3, gmock_a4, gmock_a5); \
+ } \
+ ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
+ const ::testing::internal::WithoutMatchers&, \
+ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \
+ return ::testing::internal::AdjustConstness_##constness(this)-> \
+ gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>()); \
+ } \
+ mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(5, constness, \
+ Method)
// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
-#define GMOCK_METHOD6_(tn, constness, ct, Method, ...) \
- GMOCK_RESULT_(tn, __VA_ARGS__) \
- ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
- GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
- GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
- GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
- GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
- GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6) constness { \
- GTEST_COMPILE_ASSERT_( \
- (::testing::tuple_size<tn ::testing::internal::Function< \
- __VA_ARGS__>::ArgumentTuple>::value == 6), \
- this_method_does_not_take_6_arguments); \
- GMOCK_MOCKER_(6, constness, Method).SetOwnerAndName(this, #Method); \
- return GMOCK_MOCKER_(6, constness, Method) \
- .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \
- gmock_a1), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \
- gmock_a2), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \
- gmock_a3), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \
- gmock_a4), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>( \
- gmock_a5), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>( \
- gmock_a6)); \
- } \
- ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
- GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
- GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
- GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
- GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
- GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
- GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6) constness { \
- GMOCK_MOCKER_(6, constness, Method).RegisterOwner(this); \
- return GMOCK_MOCKER_(6, constness, Method) \
- .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5, gmock_a6); \
- } \
- ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
- const ::testing::internal::WithoutMatchers&, \
- constness ::testing::internal::Function<__VA_ARGS__>*) const { \
- return ::testing::internal::AdjustConstness_##constness(this) \
- ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>()); \
- } \
- mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(6, constness, \
- Method)
+#define GMOCK_METHOD6_(tn, constness, ct, Method, ...) \
+ GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+ GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \
+ __VA_ARGS__) gmock_a2, GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
+ GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, GMOCK_ARG_(tn, 5, \
+ __VA_ARGS__) gmock_a5, GMOCK_ARG_(tn, 6, \
+ __VA_ARGS__) gmock_a6) constness { \
+ GTEST_COMPILE_ASSERT_((::std::tuple_size< \
+ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+ == 6), \
+ this_method_does_not_take_6_arguments); \
+ GMOCK_MOCKER_(6, constness, Method).SetOwnerAndName(this, #Method); \
+ return GMOCK_MOCKER_(6, constness, \
+ Method).Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, \
+ __VA_ARGS__)>(gmock_a1), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(gmock_a4), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(gmock_a5), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(gmock_a6)); \
+ } \
+ ::testing::MockSpec<__VA_ARGS__> \
+ gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
+ GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
+ GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
+ GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
+ GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
+ GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6) constness { \
+ GMOCK_MOCKER_(6, constness, Method).RegisterOwner(this); \
+ return GMOCK_MOCKER_(6, constness, Method).With(gmock_a1, gmock_a2, \
+ gmock_a3, gmock_a4, gmock_a5, gmock_a6); \
+ } \
+ ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
+ const ::testing::internal::WithoutMatchers&, \
+ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \
+ return ::testing::internal::AdjustConstness_##constness(this)-> \
+ gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>()); \
+ } \
+ mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(6, constness, \
+ Method)
// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
-#define GMOCK_METHOD7_(tn, constness, ct, Method, ...) \
- GMOCK_RESULT_(tn, __VA_ARGS__) \
- ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
- GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
- GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
- GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
- GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
- GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
- GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7) constness { \
- GTEST_COMPILE_ASSERT_( \
- (::testing::tuple_size<tn ::testing::internal::Function< \
- __VA_ARGS__>::ArgumentTuple>::value == 7), \
- this_method_does_not_take_7_arguments); \
- GMOCK_MOCKER_(7, constness, Method).SetOwnerAndName(this, #Method); \
- return GMOCK_MOCKER_(7, constness, Method) \
- .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \
- gmock_a1), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \
- gmock_a2), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \
- gmock_a3), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \
- gmock_a4), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>( \
- gmock_a5), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>( \
- gmock_a6), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>( \
- gmock_a7)); \
- } \
- ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
- GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
- GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
- GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
- GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
- GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
- GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
- GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7) constness { \
- GMOCK_MOCKER_(7, constness, Method).RegisterOwner(this); \
- return GMOCK_MOCKER_(7, constness, Method) \
- .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5, gmock_a6, \
- gmock_a7); \
- } \
- ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
- const ::testing::internal::WithoutMatchers&, \
- constness ::testing::internal::Function<__VA_ARGS__>*) const { \
- return ::testing::internal::AdjustConstness_##constness(this) \
- ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>()); \
- } \
- mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(7, constness, \
- Method)
+#define GMOCK_METHOD7_(tn, constness, ct, Method, ...) \
+ GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+ GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \
+ __VA_ARGS__) gmock_a2, GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
+ GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, GMOCK_ARG_(tn, 5, \
+ __VA_ARGS__) gmock_a5, GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
+ GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7) constness { \
+ GTEST_COMPILE_ASSERT_((::std::tuple_size< \
+ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+ == 7), \
+ this_method_does_not_take_7_arguments); \
+ GMOCK_MOCKER_(7, constness, Method).SetOwnerAndName(this, #Method); \
+ return GMOCK_MOCKER_(7, constness, \
+ Method).Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, \
+ __VA_ARGS__)>(gmock_a1), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(gmock_a4), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(gmock_a5), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(gmock_a6), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(gmock_a7)); \
+ } \
+ ::testing::MockSpec<__VA_ARGS__> \
+ gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
+ GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
+ GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
+ GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
+ GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
+ GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
+ GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7) constness { \
+ GMOCK_MOCKER_(7, constness, Method).RegisterOwner(this); \
+ return GMOCK_MOCKER_(7, constness, Method).With(gmock_a1, gmock_a2, \
+ gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7); \
+ } \
+ ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
+ const ::testing::internal::WithoutMatchers&, \
+ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \
+ return ::testing::internal::AdjustConstness_##constness(this)-> \
+ gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>()); \
+ } \
+ mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(7, constness, \
+ Method)
// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
-#define GMOCK_METHOD8_(tn, constness, ct, Method, ...) \
- GMOCK_RESULT_(tn, __VA_ARGS__) \
- ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
- GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
- GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
- GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
- GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
- GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
- GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \
- GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8) constness { \
- GTEST_COMPILE_ASSERT_( \
- (::testing::tuple_size<tn ::testing::internal::Function< \
- __VA_ARGS__>::ArgumentTuple>::value == 8), \
- this_method_does_not_take_8_arguments); \
- GMOCK_MOCKER_(8, constness, Method).SetOwnerAndName(this, #Method); \
- return GMOCK_MOCKER_(8, constness, Method) \
- .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \
- gmock_a1), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \
- gmock_a2), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \
- gmock_a3), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \
- gmock_a4), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>( \
- gmock_a5), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>( \
- gmock_a6), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>( \
- gmock_a7), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 8, __VA_ARGS__)>( \
- gmock_a8)); \
- } \
- ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
- GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
- GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
- GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
- GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
- GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
- GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
- GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \
- GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8) constness { \
- GMOCK_MOCKER_(8, constness, Method).RegisterOwner(this); \
- return GMOCK_MOCKER_(8, constness, Method) \
- .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5, gmock_a6, \
- gmock_a7, gmock_a8); \
- } \
- ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
- const ::testing::internal::WithoutMatchers&, \
- constness ::testing::internal::Function<__VA_ARGS__>*) const { \
- return ::testing::internal::AdjustConstness_##constness(this) \
- ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 8, __VA_ARGS__)>()); \
- } \
- mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(8, constness, \
- Method)
+#define GMOCK_METHOD8_(tn, constness, ct, Method, ...) \
+ GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+ GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \
+ __VA_ARGS__) gmock_a2, GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
+ GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, GMOCK_ARG_(tn, 5, \
+ __VA_ARGS__) gmock_a5, GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
+ GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, GMOCK_ARG_(tn, 8, \
+ __VA_ARGS__) gmock_a8) constness { \
+ GTEST_COMPILE_ASSERT_((::std::tuple_size< \
+ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+ == 8), \
+ this_method_does_not_take_8_arguments); \
+ GMOCK_MOCKER_(8, constness, Method).SetOwnerAndName(this, #Method); \
+ return GMOCK_MOCKER_(8, constness, \
+ Method).Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, \
+ __VA_ARGS__)>(gmock_a1), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(gmock_a4), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(gmock_a5), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(gmock_a6), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(gmock_a7), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 8, __VA_ARGS__)>(gmock_a8)); \
+ } \
+ ::testing::MockSpec<__VA_ARGS__> \
+ gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
+ GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
+ GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
+ GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
+ GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
+ GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
+ GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \
+ GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8) constness { \
+ GMOCK_MOCKER_(8, constness, Method).RegisterOwner(this); \
+ return GMOCK_MOCKER_(8, constness, Method).With(gmock_a1, gmock_a2, \
+ gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8); \
+ } \
+ ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
+ const ::testing::internal::WithoutMatchers&, \
+ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \
+ return ::testing::internal::AdjustConstness_##constness(this)-> \
+ gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 8, __VA_ARGS__)>()); \
+ } \
+ mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(8, constness, \
+ Method)
// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
-#define GMOCK_METHOD9_(tn, constness, ct, Method, ...) \
- GMOCK_RESULT_(tn, __VA_ARGS__) \
- ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
- GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
- GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
- GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
- GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
- GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
- GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \
- GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \
- GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9) constness { \
- GTEST_COMPILE_ASSERT_( \
- (::testing::tuple_size<tn ::testing::internal::Function< \
- __VA_ARGS__>::ArgumentTuple>::value == 9), \
- this_method_does_not_take_9_arguments); \
- GMOCK_MOCKER_(9, constness, Method).SetOwnerAndName(this, #Method); \
- return GMOCK_MOCKER_(9, constness, Method) \
- .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \
- gmock_a1), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \
- gmock_a2), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \
- gmock_a3), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \
- gmock_a4), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>( \
- gmock_a5), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>( \
- gmock_a6), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>( \
- gmock_a7), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 8, __VA_ARGS__)>( \
- gmock_a8), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 9, __VA_ARGS__)>( \
- gmock_a9)); \
- } \
- ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
- GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
- GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
- GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
- GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
- GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
- GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
- GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \
- GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \
- GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9) constness { \
- GMOCK_MOCKER_(9, constness, Method).RegisterOwner(this); \
- return GMOCK_MOCKER_(9, constness, Method) \
- .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5, gmock_a6, \
- gmock_a7, gmock_a8, gmock_a9); \
- } \
- ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
- const ::testing::internal::WithoutMatchers&, \
- constness ::testing::internal::Function<__VA_ARGS__>*) const { \
- return ::testing::internal::AdjustConstness_##constness(this) \
- ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 8, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 9, __VA_ARGS__)>()); \
- } \
- mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(9, constness, \
- Method)
+#define GMOCK_METHOD9_(tn, constness, ct, Method, ...) \
+ GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+ GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \
+ __VA_ARGS__) gmock_a2, GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
+ GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, GMOCK_ARG_(tn, 5, \
+ __VA_ARGS__) gmock_a5, GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
+ GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, GMOCK_ARG_(tn, 8, \
+ __VA_ARGS__) gmock_a8, GMOCK_ARG_(tn, 9, \
+ __VA_ARGS__) gmock_a9) constness { \
+ GTEST_COMPILE_ASSERT_((::std::tuple_size< \
+ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+ == 9), \
+ this_method_does_not_take_9_arguments); \
+ GMOCK_MOCKER_(9, constness, Method).SetOwnerAndName(this, #Method); \
+ return GMOCK_MOCKER_(9, constness, \
+ Method).Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, \
+ __VA_ARGS__)>(gmock_a1), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(gmock_a4), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(gmock_a5), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(gmock_a6), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(gmock_a7), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 8, __VA_ARGS__)>(gmock_a8), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 9, __VA_ARGS__)>(gmock_a9)); \
+ } \
+ ::testing::MockSpec<__VA_ARGS__> \
+ gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
+ GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
+ GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
+ GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
+ GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
+ GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
+ GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \
+ GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \
+ GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9) constness { \
+ GMOCK_MOCKER_(9, constness, Method).RegisterOwner(this); \
+ return GMOCK_MOCKER_(9, constness, Method).With(gmock_a1, gmock_a2, \
+ gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, \
+ gmock_a9); \
+ } \
+ ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
+ const ::testing::internal::WithoutMatchers&, \
+ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \
+ return ::testing::internal::AdjustConstness_##constness(this)-> \
+ gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 8, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 9, __VA_ARGS__)>()); \
+ } \
+ mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(9, constness, \
+ Method)
// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
-#define GMOCK_METHOD10_(tn, constness, ct, Method, ...) \
- GMOCK_RESULT_(tn, __VA_ARGS__) \
- ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
- GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
- GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
- GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
- GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
- GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
- GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \
- GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \
- GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9, \
- GMOCK_ARG_(tn, 10, __VA_ARGS__) gmock_a10) constness { \
- GTEST_COMPILE_ASSERT_( \
- (::testing::tuple_size<tn ::testing::internal::Function< \
- __VA_ARGS__>::ArgumentTuple>::value == 10), \
- this_method_does_not_take_10_arguments); \
- GMOCK_MOCKER_(10, constness, Method).SetOwnerAndName(this, #Method); \
- return GMOCK_MOCKER_(10, constness, Method) \
- .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \
- gmock_a1), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \
- gmock_a2), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \
- gmock_a3), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \
- gmock_a4), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>( \
- gmock_a5), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>( \
- gmock_a6), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>( \
- gmock_a7), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 8, __VA_ARGS__)>( \
- gmock_a8), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 9, __VA_ARGS__)>( \
- gmock_a9), \
- ::testing::internal::forward<GMOCK_ARG_(tn, 10, __VA_ARGS__)>( \
- gmock_a10)); \
- } \
- ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
- GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
- GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
- GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
- GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
- GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
- GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
- GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \
- GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \
- GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9, \
- GMOCK_MATCHER_(tn, 10, __VA_ARGS__) gmock_a10) constness { \
- GMOCK_MOCKER_(10, constness, Method).RegisterOwner(this); \
- return GMOCK_MOCKER_(10, constness, Method) \
- .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5, gmock_a6, \
- gmock_a7, gmock_a8, gmock_a9, gmock_a10); \
- } \
- ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
- const ::testing::internal::WithoutMatchers&, \
- constness ::testing::internal::Function<__VA_ARGS__>*) const { \
- return ::testing::internal::AdjustConstness_##constness(this) \
- ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 8, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 9, __VA_ARGS__)>(), \
- ::testing::A<GMOCK_ARG_(tn, 10, __VA_ARGS__)>()); \
- } \
- mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(10, constness, \
- Method)
+#define GMOCK_METHOD10_(tn, constness, ct, Method, ...) \
+ GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+ GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \
+ __VA_ARGS__) gmock_a2, GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
+ GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, GMOCK_ARG_(tn, 5, \
+ __VA_ARGS__) gmock_a5, GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
+ GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, GMOCK_ARG_(tn, 8, \
+ __VA_ARGS__) gmock_a8, GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9, \
+ GMOCK_ARG_(tn, 10, __VA_ARGS__) gmock_a10) constness { \
+ GTEST_COMPILE_ASSERT_((::std::tuple_size< \
+ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+ == 10), \
+ this_method_does_not_take_10_arguments); \
+ GMOCK_MOCKER_(10, constness, Method).SetOwnerAndName(this, #Method); \
+ return GMOCK_MOCKER_(10, constness, \
+ Method).Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, \
+ __VA_ARGS__)>(gmock_a1), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(gmock_a4), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(gmock_a5), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(gmock_a6), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(gmock_a7), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 8, __VA_ARGS__)>(gmock_a8), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 9, __VA_ARGS__)>(gmock_a9), \
+ ::testing::internal::forward<GMOCK_ARG_(tn, 10, __VA_ARGS__)>(gmock_a10)); \
+ } \
+ ::testing::MockSpec<__VA_ARGS__> \
+ gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
+ GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
+ GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
+ GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
+ GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
+ GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
+ GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \
+ GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \
+ GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9, \
+ GMOCK_MATCHER_(tn, 10, \
+ __VA_ARGS__) gmock_a10) constness { \
+ GMOCK_MOCKER_(10, constness, Method).RegisterOwner(this); \
+ return GMOCK_MOCKER_(10, constness, Method).With(gmock_a1, gmock_a2, \
+ gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, gmock_a9, \
+ gmock_a10); \
+ } \
+ ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
+ const ::testing::internal::WithoutMatchers&, \
+ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \
+ return ::testing::internal::AdjustConstness_##constness(this)-> \
+ gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 8, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 9, __VA_ARGS__)>(), \
+ ::testing::A<GMOCK_ARG_(tn, 10, __VA_ARGS__)>()); \
+ } \
+ mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(10, constness, \
+ Method)
#define MOCK_METHOD0(m, ...) GMOCK_METHOD0_(, , , m, __VA_ARGS__)
#define MOCK_METHOD1(m, ...) GMOCK_METHOD1_(, , , m, __VA_ARGS__)
@@ -1175,7 +1118,9 @@ class MockFunction<R(A0)> {
#if GTEST_HAS_STD_FUNCTION_
::std::function<R(A0)> AsStdFunction() {
- return [this](A0 a0) -> R { return this->Call(::std::forward<A0>(a0)); };
+ return [this](A0 a0) -> R {
+ return this->Call(::std::forward<A0>(a0));
+ };
}
#endif // GTEST_HAS_STD_FUNCTION_
@@ -1213,7 +1158,7 @@ class MockFunction<R(A0, A1, A2)> {
::std::function<R(A0, A1, A2)> AsStdFunction() {
return [this](A0 a0, A1 a1, A2 a2) -> R {
return this->Call(::std::forward<A0>(a0), ::std::forward<A1>(a1),
- ::std::forward<A2>(a2));
+ ::std::forward<A2>(a2));
};
}
#endif // GTEST_HAS_STD_FUNCTION_
@@ -1233,7 +1178,7 @@ class MockFunction<R(A0, A1, A2, A3)> {
::std::function<R(A0, A1, A2, A3)> AsStdFunction() {
return [this](A0 a0, A1 a1, A2 a2, A3 a3) -> R {
return this->Call(::std::forward<A0>(a0), ::std::forward<A1>(a1),
- ::std::forward<A2>(a2), ::std::forward<A3>(a3));
+ ::std::forward<A2>(a2), ::std::forward<A3>(a3));
};
}
#endif // GTEST_HAS_STD_FUNCTION_
@@ -1254,8 +1199,8 @@ class MockFunction<R(A0, A1, A2, A3, A4)> {
::std::function<R(A0, A1, A2, A3, A4)> AsStdFunction() {
return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) -> R {
return this->Call(::std::forward<A0>(a0), ::std::forward<A1>(a1),
- ::std::forward<A2>(a2), ::std::forward<A3>(a3),
- ::std::forward<A4>(a4));
+ ::std::forward<A2>(a2), ::std::forward<A3>(a3),
+ ::std::forward<A4>(a4));
};
}
#endif // GTEST_HAS_STD_FUNCTION_
@@ -1276,8 +1221,8 @@ class MockFunction<R(A0, A1, A2, A3, A4, A5)> {
::std::function<R(A0, A1, A2, A3, A4, A5)> AsStdFunction() {
return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) -> R {
return this->Call(::std::forward<A0>(a0), ::std::forward<A1>(a1),
- ::std::forward<A2>(a2), ::std::forward<A3>(a3),
- ::std::forward<A4>(a4), ::std::forward<A5>(a5));
+ ::std::forward<A2>(a2), ::std::forward<A3>(a3),
+ ::std::forward<A4>(a4), ::std::forward<A5>(a5));
};
}
#endif // GTEST_HAS_STD_FUNCTION_
@@ -1298,9 +1243,9 @@ class MockFunction<R(A0, A1, A2, A3, A4, A5, A6)> {
::std::function<R(A0, A1, A2, A3, A4, A5, A6)> AsStdFunction() {
return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) -> R {
return this->Call(::std::forward<A0>(a0), ::std::forward<A1>(a1),
- ::std::forward<A2>(a2), ::std::forward<A3>(a3),
- ::std::forward<A4>(a4), ::std::forward<A5>(a5),
- ::std::forward<A6>(a6));
+ ::std::forward<A2>(a2), ::std::forward<A3>(a3),
+ ::std::forward<A4>(a4), ::std::forward<A5>(a5),
+ ::std::forward<A6>(a6));
};
}
#endif // GTEST_HAS_STD_FUNCTION_
@@ -1321,9 +1266,9 @@ class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7)> {
::std::function<R(A0, A1, A2, A3, A4, A5, A6, A7)> AsStdFunction() {
return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) -> R {
return this->Call(::std::forward<A0>(a0), ::std::forward<A1>(a1),
- ::std::forward<A2>(a2), ::std::forward<A3>(a3),
- ::std::forward<A4>(a4), ::std::forward<A5>(a5),
- ::std::forward<A6>(a6), ::std::forward<A7>(a7));
+ ::std::forward<A2>(a2), ::std::forward<A3>(a3),
+ ::std::forward<A4>(a4), ::std::forward<A5>(a5),
+ ::std::forward<A6>(a6), ::std::forward<A7>(a7));
};
}
#endif // GTEST_HAS_STD_FUNCTION_
@@ -1343,12 +1288,12 @@ class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8)> {
#if GTEST_HAS_STD_FUNCTION_
::std::function<R(A0, A1, A2, A3, A4, A5, A6, A7, A8)> AsStdFunction() {
return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7,
- A8 a8) -> R {
+ A8 a8) -> R {
return this->Call(::std::forward<A0>(a0), ::std::forward<A1>(a1),
- ::std::forward<A2>(a2), ::std::forward<A3>(a3),
- ::std::forward<A4>(a4), ::std::forward<A5>(a5),
- ::std::forward<A6>(a6), ::std::forward<A7>(a7),
- ::std::forward<A8>(a8));
+ ::std::forward<A2>(a2), ::std::forward<A3>(a3),
+ ::std::forward<A4>(a4), ::std::forward<A5>(a5),
+ ::std::forward<A6>(a6), ::std::forward<A7>(a7),
+ ::std::forward<A8>(a8));
};
}
#endif // GTEST_HAS_STD_FUNCTION_
@@ -1368,13 +1313,13 @@ class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
#if GTEST_HAS_STD_FUNCTION_
::std::function<R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)> AsStdFunction() {
- return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8,
- A9 a9) -> R {
+ return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7,
+ A8 a8, A9 a9) -> R {
return this->Call(::std::forward<A0>(a0), ::std::forward<A1>(a1),
- ::std::forward<A2>(a2), ::std::forward<A3>(a3),
- ::std::forward<A4>(a4), ::std::forward<A5>(a5),
- ::std::forward<A6>(a6), ::std::forward<A7>(a7),
- ::std::forward<A8>(a8), ::std::forward<A9>(a9));
+ ::std::forward<A2>(a2), ::std::forward<A3>(a3),
+ ::std::forward<A4>(a4), ::std::forward<A5>(a5),
+ ::std::forward<A6>(a6), ::std::forward<A7>(a7),
+ ::std::forward<A8>(a8), ::std::forward<A9>(a9));
};
}
#endif // GTEST_HAS_STD_FUNCTION_
diff --git a/googlemock/include/gmock/gmock-generated-function-mockers.h.pump b/googlemock/include/gmock/gmock-generated-function-mockers.h.pump
index 106abe84..e05b18db 100644
--- a/googlemock/include/gmock/gmock-generated-function-mockers.h.pump
+++ b/googlemock/include/gmock/gmock-generated-function-mockers.h.pump
@@ -81,7 +81,7 @@ class FunctionMocker<R($As)> : public
typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
MockSpec<F> With($matchers) {
- return MockSpec<F>(this, ::testing::make_tuple($ms));
+ return MockSpec<F>(this, ::std::make_tuple($ms));
}
R Invoke($Aas) {
@@ -194,7 +194,7 @@ $var anything_matchers = [[$for j, \
#define GMOCK_METHOD$i[[]]_(tn, constness, ct, Method, ...) \
GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
$arg_as) constness { \
- GTEST_COMPILE_ASSERT_((::testing::tuple_size< \
+ GTEST_COMPILE_ASSERT_((::std::tuple_size< \
tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value == $i), \
this_method_does_not_take_$i[[]]_argument[[$if i != 1 [[s]]]]); \
GMOCK_MOCKER_($i, constness, Method).SetOwnerAndName(this, #Method); \
diff --git a/googlemock/include/gmock/gmock-generated-matchers.h b/googlemock/include/gmock/gmock-generated-matchers.h
index 61fe66ad..745ee331 100644
--- a/googlemock/include/gmock/gmock-generated-matchers.h
+++ b/googlemock/include/gmock/gmock-generated-matchers.h
@@ -51,7 +51,7 @@ namespace internal {
// The type of the i-th (0-based) field of Tuple.
#define GMOCK_FIELD_TYPE_(Tuple, i) \
- typename ::testing::tuple_element<i, Tuple>::type
+ typename ::std::tuple_element<i, Tuple>::type
// TupleFields<Tuple, k0, ..., kn> is for selecting fields from a
// tuple of type Tuple. It has two members:
@@ -59,10 +59,11 @@ namespace internal {
// type: a tuple type whose i-th field is the ki-th field of Tuple.
// GetSelectedFields(t): returns fields k0, ..., and kn of t as a tuple.
//
-// For example, in class TupleFields<tuple<bool, char, int>, 2, 0>, we have:
+// For example, in class TupleFields<std::tuple<bool, char, int>, 2, 0>,
+// we have:
//
-// type is tuple<int, bool>, and
-// GetSelectedFields(make_tuple(true, 'a', 42)) is (42, true).
+// type is std::tuple<int, bool>, and
+// GetSelectedFields(std::make_tuple(true, 'a', 42)) is (42, true).
template <class Tuple, int k0 = -1, int k1 = -1, int k2 = -1, int k3 = -1,
int k4 = -1, int k5 = -1, int k6 = -1, int k7 = -1, int k8 = -1,
@@ -74,15 +75,15 @@ template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,
int k7, int k8, int k9>
class TupleFields {
public:
- typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
- GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
- GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
- GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6),
- GMOCK_FIELD_TYPE_(Tuple, k7), GMOCK_FIELD_TYPE_(Tuple, k8),
- GMOCK_FIELD_TYPE_(Tuple, k9)> type;
+ typedef ::std::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), GMOCK_FIELD_TYPE_(Tuple,
+ k1), GMOCK_FIELD_TYPE_(Tuple, k2), GMOCK_FIELD_TYPE_(Tuple, k3),
+ GMOCK_FIELD_TYPE_(Tuple, k4), GMOCK_FIELD_TYPE_(Tuple, k5),
+ GMOCK_FIELD_TYPE_(Tuple, k6), GMOCK_FIELD_TYPE_(Tuple, k7),
+ GMOCK_FIELD_TYPE_(Tuple, k8), GMOCK_FIELD_TYPE_(Tuple, k9)> type;
static type GetSelectedFields(const Tuple& t) {
- return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
- get<k5>(t), get<k6>(t), get<k7>(t), get<k8>(t), get<k9>(t));
+ return type(std::get<k0>(t), std::get<k1>(t), std::get<k2>(t),
+ std::get<k3>(t), std::get<k4>(t), std::get<k5>(t), std::get<k6>(t),
+ std::get<k7>(t), std::get<k8>(t), std::get<k9>(t));
}
};
@@ -91,7 +92,7 @@ class TupleFields {
template <class Tuple>
class TupleFields<Tuple, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
public:
- typedef ::testing::tuple<> type;
+ typedef ::std::tuple<> type;
static type GetSelectedFields(const Tuple& /* t */) {
return type();
}
@@ -100,77 +101,77 @@ class TupleFields<Tuple, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
template <class Tuple, int k0>
class TupleFields<Tuple, k0, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
public:
- typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0)> type;
+ typedef ::std::tuple<GMOCK_FIELD_TYPE_(Tuple, k0)> type;
static type GetSelectedFields(const Tuple& t) {
- return type(get<k0>(t));
+ return type(std::get<k0>(t));
}
};
template <class Tuple, int k0, int k1>
class TupleFields<Tuple, k0, k1, -1, -1, -1, -1, -1, -1, -1, -1> {
public:
- typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
- GMOCK_FIELD_TYPE_(Tuple, k1)> type;
+ typedef ::std::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), GMOCK_FIELD_TYPE_(Tuple,
+ k1)> type;
static type GetSelectedFields(const Tuple& t) {
- return type(get<k0>(t), get<k1>(t));
+ return type(std::get<k0>(t), std::get<k1>(t));
}
};
template <class Tuple, int k0, int k1, int k2>
class TupleFields<Tuple, k0, k1, k2, -1, -1, -1, -1, -1, -1, -1> {
public:
- typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
- GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2)> type;
+ typedef ::std::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), GMOCK_FIELD_TYPE_(Tuple,
+ k1), GMOCK_FIELD_TYPE_(Tuple, k2)> type;
static type GetSelectedFields(const Tuple& t) {
- return type(get<k0>(t), get<k1>(t), get<k2>(t));
+ return type(std::get<k0>(t), std::get<k1>(t), std::get<k2>(t));
}
};
template <class Tuple, int k0, int k1, int k2, int k3>
class TupleFields<Tuple, k0, k1, k2, k3, -1, -1, -1, -1, -1, -1> {
public:
- typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
- GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
- GMOCK_FIELD_TYPE_(Tuple, k3)> type;
+ typedef ::std::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), GMOCK_FIELD_TYPE_(Tuple,
+ k1), GMOCK_FIELD_TYPE_(Tuple, k2), GMOCK_FIELD_TYPE_(Tuple, k3)> type;
static type GetSelectedFields(const Tuple& t) {
- return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t));
+ return type(std::get<k0>(t), std::get<k1>(t), std::get<k2>(t),
+ std::get<k3>(t));
}
};
template <class Tuple, int k0, int k1, int k2, int k3, int k4>
class TupleFields<Tuple, k0, k1, k2, k3, k4, -1, -1, -1, -1, -1> {
public:
- typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
- GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
- GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4)> type;
+ typedef ::std::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), GMOCK_FIELD_TYPE_(Tuple,
+ k1), GMOCK_FIELD_TYPE_(Tuple, k2), GMOCK_FIELD_TYPE_(Tuple, k3),
+ GMOCK_FIELD_TYPE_(Tuple, k4)> type;
static type GetSelectedFields(const Tuple& t) {
- return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t));
+ return type(std::get<k0>(t), std::get<k1>(t), std::get<k2>(t),
+ std::get<k3>(t), std::get<k4>(t));
}
};
template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5>
class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, -1, -1, -1, -1> {
public:
- typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
- GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
- GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
- GMOCK_FIELD_TYPE_(Tuple, k5)> type;
+ typedef ::std::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), GMOCK_FIELD_TYPE_(Tuple,
+ k1), GMOCK_FIELD_TYPE_(Tuple, k2), GMOCK_FIELD_TYPE_(Tuple, k3),
+ GMOCK_FIELD_TYPE_(Tuple, k4), GMOCK_FIELD_TYPE_(Tuple, k5)> type;
static type GetSelectedFields(const Tuple& t) {
- return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
- get<k5>(t));
+ return type(std::get<k0>(t), std::get<k1>(t), std::get<k2>(t),
+ std::get<k3>(t), std::get<k4>(t), std::get<k5>(t));
}
};
template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6>
class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, -1, -1, -1> {
public:
- typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
- GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
- GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
- GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6)> type;
+ typedef ::std::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), GMOCK_FIELD_TYPE_(Tuple,
+ k1), GMOCK_FIELD_TYPE_(Tuple, k2), GMOCK_FIELD_TYPE_(Tuple, k3),
+ GMOCK_FIELD_TYPE_(Tuple, k4), GMOCK_FIELD_TYPE_(Tuple, k5),
+ GMOCK_FIELD_TYPE_(Tuple, k6)> type;
static type GetSelectedFields(const Tuple& t) {
- return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
- get<k5>(t), get<k6>(t));
+ return type(std::get<k0>(t), std::get<k1>(t), std::get<k2>(t),
+ std::get<k3>(t), std::get<k4>(t), std::get<k5>(t), std::get<k6>(t));
}
};
@@ -178,14 +179,14 @@ template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,
int k7>
class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, k7, -1, -1> {
public:
- typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
- GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
- GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
- GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6),
- GMOCK_FIELD_TYPE_(Tuple, k7)> type;
+ typedef ::std::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), GMOCK_FIELD_TYPE_(Tuple,
+ k1), GMOCK_FIELD_TYPE_(Tuple, k2), GMOCK_FIELD_TYPE_(Tuple, k3),
+ GMOCK_FIELD_TYPE_(Tuple, k4), GMOCK_FIELD_TYPE_(Tuple, k5),
+ GMOCK_FIELD_TYPE_(Tuple, k6), GMOCK_FIELD_TYPE_(Tuple, k7)> type;
static type GetSelectedFields(const Tuple& t) {
- return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
- get<k5>(t), get<k6>(t), get<k7>(t));
+ return type(std::get<k0>(t), std::get<k1>(t), std::get<k2>(t),
+ std::get<k3>(t), std::get<k4>(t), std::get<k5>(t), std::get<k6>(t),
+ std::get<k7>(t));
}
};
@@ -193,14 +194,15 @@ template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,
int k7, int k8>
class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, k7, k8, -1> {
public:
- typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
- GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
- GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
- GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6),
- GMOCK_FIELD_TYPE_(Tuple, k7), GMOCK_FIELD_TYPE_(Tuple, k8)> type;
+ typedef ::std::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), GMOCK_FIELD_TYPE_(Tuple,
+ k1), GMOCK_FIELD_TYPE_(Tuple, k2), GMOCK_FIELD_TYPE_(Tuple, k3),
+ GMOCK_FIELD_TYPE_(Tuple, k4), GMOCK_FIELD_TYPE_(Tuple, k5),
+ GMOCK_FIELD_TYPE_(Tuple, k6), GMOCK_FIELD_TYPE_(Tuple, k7),
+ GMOCK_FIELD_TYPE_(Tuple, k8)> type;
static type GetSelectedFields(const Tuple& t) {
- return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
- get<k5>(t), get<k6>(t), get<k7>(t), get<k8>(t));
+ return type(std::get<k0>(t), std::get<k1>(t), std::get<k2>(t),
+ std::get<k3>(t), std::get<k4>(t), std::get<k5>(t), std::get<k6>(t),
+ std::get<k7>(t), std::get<k8>(t));
}
};
@@ -466,6 +468,7 @@ Args(const InnerMatcher& matcher) {
}
+
// AnyOf(m1, m2, ..., mk) matches any value that matches any of the given
// sub-matchers. AnyOf is called fully qualified to prevent ADL from firing.
@@ -795,7 +798,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
return ::testing::internal::FormatMatcherDescription(\
negation, #name, \
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
- ::testing::tuple<>()));\
+ ::std::tuple<>()));\
}\
};\
template <typename arg_type>\
@@ -845,7 +848,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
return ::testing::internal::FormatMatcherDescription(\
negation, #name, \
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
- ::testing::tuple<p0##_type>(p0)));\
+ ::std::tuple<p0##_type>(p0)));\
}\
};\
template <typename arg_type>\
@@ -901,7 +904,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
return ::testing::internal::FormatMatcherDescription(\
negation, #name, \
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
- ::testing::tuple<p0##_type, p1##_type>(p0, p1)));\
+ ::std::tuple<p0##_type, p1##_type>(p0, p1)));\
}\
};\
template <typename arg_type>\
@@ -963,8 +966,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
return ::testing::internal::FormatMatcherDescription(\
negation, #name, \
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
- ::testing::tuple<p0##_type, p1##_type, p2##_type>(p0, p1, \
- p2)));\
+ ::std::tuple<p0##_type, p1##_type, p2##_type>(p0, p1, p2)));\
}\
};\
template <typename arg_type>\
@@ -1032,8 +1034,8 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
return ::testing::internal::FormatMatcherDescription(\
negation, #name, \
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
- ::testing::tuple<p0##_type, p1##_type, p2##_type, \
- p3##_type>(p0, p1, p2, p3)));\
+ ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type>(p0, \
+ p1, p2, p3)));\
}\
};\
template <typename arg_type>\
@@ -1110,7 +1112,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
return ::testing::internal::FormatMatcherDescription(\
negation, #name, \
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
- ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
+ ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
p4##_type>(p0, p1, p2, p3, p4)));\
}\
};\
@@ -1192,7 +1194,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
return ::testing::internal::FormatMatcherDescription(\
negation, #name, \
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
- ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
+ ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5)));\
}\
};\
@@ -1280,7 +1282,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
return ::testing::internal::FormatMatcherDescription(\
negation, #name, \
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
- ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
+ ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, \
p6)));\
}\
@@ -1377,7 +1379,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
return ::testing::internal::FormatMatcherDescription(\
negation, #name, \
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
- ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
+ ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, \
p3, p4, p5, p6, p7)));\
}\
@@ -1480,7 +1482,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
return ::testing::internal::FormatMatcherDescription(\
negation, #name, \
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
- ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
+ ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
p4##_type, p5##_type, p6##_type, p7##_type, \
p8##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8)));\
}\
@@ -1590,7 +1592,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
return ::testing::internal::FormatMatcherDescription(\
negation, #name, \
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
- ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
+ ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
p9##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)));\
}\
diff --git a/googlemock/include/gmock/gmock-generated-matchers.h.pump b/googlemock/include/gmock/gmock-generated-matchers.h.pump
index ad02ea7f..311e1273 100644
--- a/googlemock/include/gmock/gmock-generated-matchers.h.pump
+++ b/googlemock/include/gmock/gmock-generated-matchers.h.pump
@@ -55,7 +55,7 @@ $range i 0..n-1
// The type of the i-th (0-based) field of Tuple.
#define GMOCK_FIELD_TYPE_(Tuple, i) \
- typename ::testing::tuple_element<i, Tuple>::type
+ typename ::std::tuple_element<i, Tuple>::type
// TupleFields<Tuple, k0, ..., kn> is for selecting fields from a
// tuple of type Tuple. It has two members:
@@ -63,10 +63,11 @@ $range i 0..n-1
// type: a tuple type whose i-th field is the ki-th field of Tuple.
// GetSelectedFields(t): returns fields k0, ..., and kn of t as a tuple.
//
-// For example, in class TupleFields<tuple<bool, char, int>, 2, 0>, we have:
+// For example, in class TupleFields<std::tuple<bool, char, int>, 2, 0>,
+// we have:
//
-// type is tuple<int, bool>, and
-// GetSelectedFields(make_tuple(true, 'a', 42)) is (42, true).
+// type is std::tuple<int, bool>, and
+// GetSelectedFields(std::make_tuple(true, 'a', 42)) is (42, true).
template <class Tuple$for i [[, int k$i = -1]]>
class TupleFields;
@@ -75,9 +76,9 @@ class TupleFields;
template <class Tuple$for i [[, int k$i]]>
class TupleFields {
public:
- typedef ::testing::tuple<$for i, [[GMOCK_FIELD_TYPE_(Tuple, k$i)]]> type;
+ typedef ::std::tuple<$for i, [[GMOCK_FIELD_TYPE_(Tuple, k$i)]]> type;
static type GetSelectedFields(const Tuple& t) {
- return type($for i, [[get<k$i>(t)]]);
+ return type($for i, [[std::get<k$i>(t)]]);
}
};
@@ -91,9 +92,9 @@ $range k 0..n-1
template <class Tuple$for j [[, int k$j]]>
class TupleFields<Tuple, $for k, [[$if k < i [[k$k]] $else [[-1]]]]> {
public:
- typedef ::testing::tuple<$for j, [[GMOCK_FIELD_TYPE_(Tuple, k$j)]]> type;
+ typedef ::std::tuple<$for j, [[GMOCK_FIELD_TYPE_(Tuple, k$j)]]> type;
static type GetSelectedFields(const Tuple& $if i==0 [[/* t */]] $else [[t]]) {
- return type($for j, [[get<k$j>(t)]]);
+ return type($for j, [[std::get<k$j>(t)]]);
}
};
@@ -534,7 +535,7 @@ $var param_field_decls2 = [[$for j
return ::testing::internal::FormatMatcherDescription(\
negation, #name, \
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
- ::testing::tuple<$for j, [[p$j##_type]]>($for j, [[p$j]])));\
+ ::std::tuple<$for j, [[p$j##_type]]>($for j, [[p$j]])));\
}\
};\
template <typename arg_type>\
diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h
index 9d31e5d1..08371f1b 100644
--- a/googlemock/include/gmock/gmock-matchers.h
+++ b/googlemock/include/gmock/gmock-matchers.h
@@ -905,8 +905,8 @@ class TuplePrefix {
template <typename MatcherTuple, typename ValueTuple>
static bool Matches(const MatcherTuple& matcher_tuple,
const ValueTuple& value_tuple) {
- return TuplePrefix<N - 1>::Matches(matcher_tuple, value_tuple)
- && get<N - 1>(matcher_tuple).Matches(get<N - 1>(value_tuple));
+ return TuplePrefix<N - 1>::Matches(matcher_tuple, value_tuple) &&
+ std::get<N - 1>(matcher_tuple).Matches(std::get<N - 1>(value_tuple));
}
// TuplePrefix<N>::ExplainMatchFailuresTo(matchers, values, os)
@@ -922,16 +922,16 @@ class TuplePrefix {
// Then describes the failure (if any) in the (N - 1)-th (0-based)
// field.
- typename tuple_element<N - 1, MatcherTuple>::type matcher =
- get<N - 1>(matchers);
- typedef typename tuple_element<N - 1, ValueTuple>::type Value;
- GTEST_REFERENCE_TO_CONST_(Value) value = get<N - 1>(values);
+ typename std::tuple_element<N - 1, MatcherTuple>::type matcher =
+ std::get<N - 1>(matchers);
+ typedef typename std::tuple_element<N - 1, ValueTuple>::type Value;
+ GTEST_REFERENCE_TO_CONST_(Value) value = std::get<N - 1>(values);
StringMatchResultListener listener;
if (!matcher.MatchAndExplain(value, &listener)) {
// FIXME: include in the message the name of the parameter
// as used in MOCK_METHOD*() when possible.
*os << " Expected arg #" << N - 1 << ": ";
- get<N - 1>(matchers).DescribeTo(os);
+ std::get<N - 1>(matchers).DescribeTo(os);
*os << "\n Actual: ";
// We remove the reference in type Value to prevent the
// universal printer from printing the address of value, which
@@ -971,11 +971,11 @@ bool TupleMatches(const MatcherTuple& matcher_tuple,
const ValueTuple& value_tuple) {
// Makes sure that matcher_tuple and value_tuple have the same
// number of fields.
- GTEST_COMPILE_ASSERT_(tuple_size<MatcherTuple>::value ==
- tuple_size<ValueTuple>::value,
+ GTEST_COMPILE_ASSERT_(std::tuple_size<MatcherTuple>::value ==
+ std::tuple_size<ValueTuple>::value,
matcher_and_value_have_different_numbers_of_fields);
- return TuplePrefix<tuple_size<ValueTuple>::value>::
- Matches(matcher_tuple, value_tuple);
+ return TuplePrefix<std::tuple_size<ValueTuple>::value>::Matches(matcher_tuple,
+ value_tuple);
}
// Describes failures in matching matchers against values. If there
@@ -984,7 +984,7 @@ template <typename MatcherTuple, typename ValueTuple>
void ExplainMatchFailureTupleTo(const MatcherTuple& matchers,
const ValueTuple& values,
::std::ostream* os) {
- TuplePrefix<tuple_size<MatcherTuple>::value>::ExplainMatchFailuresTo(
+ TuplePrefix<std::tuple_size<MatcherTuple>::value>::ExplainMatchFailuresTo(
matchers, values, os);
}
@@ -995,7 +995,7 @@ void ExplainMatchFailureTupleTo(const MatcherTuple& matchers,
template <typename Tuple, typename Func, typename OutIter>
class TransformTupleValuesHelper {
private:
- typedef ::testing::tuple_size<Tuple> TupleSize;
+ typedef ::std::tuple_size<Tuple> TupleSize;
public:
// For each member of tuple 't', taken in order, evaluates '*out++ = f(t)'.
@@ -1008,7 +1008,7 @@ class TransformTupleValuesHelper {
template <typename Tup, size_t kRemainingSize>
struct IterateOverTuple {
OutIter operator() (Func f, const Tup& t, OutIter out) const {
- *out++ = f(::testing::get<TupleSize::value - kRemainingSize>(t));
+ *out++ = f(::std::get<TupleSize::value - kRemainingSize>(t));
return IterateOverTuple<Tup, kRemainingSize - 1>()(f, t, out);
}
};
@@ -1597,19 +1597,19 @@ class MatchesRegexMatcher {
// compared don't have to have the same type.
//
// The matcher defined here is polymorphic (for example, Eq() can be
-// used to match a tuple<int, short>, a tuple<const long&, double>,
+// used to match a std::tuple<int, short>, a std::tuple<const long&, double>,
// etc). Therefore we use a template type conversion operator in the
// implementation.
template <typename D, typename Op>
class PairMatchBase {
public:
template <typename T1, typename T2>
- operator Matcher< ::testing::tuple<T1, T2> >() const {
- return MakeMatcher(new Impl< ::testing::tuple<T1, T2> >);
+ operator Matcher<::std::tuple<T1, T2>>() const {
+ return MakeMatcher(new Impl<::std::tuple<T1, T2>>);
}
template <typename T1, typename T2>
- operator Matcher<const ::testing::tuple<T1, T2>&>() const {
- return MakeMatcher(new Impl<const ::testing::tuple<T1, T2>&>);
+ operator Matcher<const ::std::tuple<T1, T2>&>() const {
+ return MakeMatcher(new Impl<const ::std::tuple<T1, T2>&>);
}
private:
@@ -1623,7 +1623,7 @@ class PairMatchBase {
virtual bool MatchAndExplain(
Tuple args,
MatchResultListener* /* listener */) const {
- return Op()(::testing::get<0>(args), ::testing::get<1>(args));
+ return Op()(::std::get<0>(args), ::std::get<1>(args));
}
virtual void DescribeTo(::std::ostream* os) const {
*os << "are " << GetDesc;
@@ -1807,7 +1807,7 @@ class VariadicMatcher {
std::vector<Matcher<T> >*,
std::integral_constant<size_t, sizeof...(Args)>) const {}
- tuple<Args...> matchers_;
+ std::tuple<Args...> matchers_;
GTEST_DISALLOW_ASSIGN_(VariadicMatcher);
};
@@ -2220,14 +2220,14 @@ class FloatingEq2Matcher {
}
template <typename T1, typename T2>
- operator Matcher< ::testing::tuple<T1, T2> >() const {
+ operator Matcher<::std::tuple<T1, T2>>() const {
return MakeMatcher(
- new Impl< ::testing::tuple<T1, T2> >(max_abs_error_, nan_eq_nan_));
+ new Impl<::std::tuple<T1, T2>>(max_abs_error_, nan_eq_nan_));
}
template <typename T1, typename T2>
- operator Matcher<const ::testing::tuple<T1, T2>&>() const {
+ operator Matcher<const ::std::tuple<T1, T2>&>() const {
return MakeMatcher(
- new Impl<const ::testing::tuple<T1, T2>&>(max_abs_error_, nan_eq_nan_));
+ new Impl<const ::std::tuple<T1, T2>&>(max_abs_error_, nan_eq_nan_));
}
private:
@@ -2245,14 +2245,14 @@ class FloatingEq2Matcher {
virtual bool MatchAndExplain(Tuple args,
MatchResultListener* listener) const {
if (max_abs_error_ == -1) {
- FloatingEqMatcher<FloatType> fm(::testing::get<0>(args), nan_eq_nan_);
- return static_cast<Matcher<FloatType> >(fm).MatchAndExplain(
- ::testing::get<1>(args), listener);
+ FloatingEqMatcher<FloatType> fm(::std::get<0>(args), nan_eq_nan_);
+ return static_cast<Matcher<FloatType>>(fm).MatchAndExplain(
+ ::std::get<1>(args), listener);
} else {
- FloatingEqMatcher<FloatType> fm(::testing::get<0>(args), nan_eq_nan_,
+ FloatingEqMatcher<FloatType> fm(::std::get<0>(args), nan_eq_nan_,
max_abs_error_);
- return static_cast<Matcher<FloatType> >(fm).MatchAndExplain(
- ::testing::get<1>(args), listener);
+ return static_cast<Matcher<FloatType>>(fm).MatchAndExplain(
+ ::std::get<1>(args), listener);
}
}
virtual void DescribeTo(::std::ostream* os) const {
@@ -2956,7 +2956,7 @@ class WhenSortedByMatcher {
};
// Implements Pointwise(tuple_matcher, rhs_container). tuple_matcher
-// must be able to be safely cast to Matcher<tuple<const T1&, const
+// must be able to be safely cast to Matcher<std::tuple<const T1&, const
// T2&> >, where T1 and T2 are the types of elements in the LHS
// container and the RHS container respectively.
template <typename TupleMatcher, typename RhsContainer>
@@ -3001,7 +3001,7 @@ class PointwiseMatcher {
// reference, as they may be expensive to copy. We must use tuple
// instead of pair here, as a pair cannot hold references (C++ 98,
// 20.2.2 [lib.pairs]).
- typedef ::testing::tuple<const LhsValue&, const RhsValue&> InnerMatcherArg;
+ typedef ::std::tuple<const LhsValue&, const RhsValue&> InnerMatcherArg;
Impl(const TupleMatcher& tuple_matcher, const RhsStlContainer& rhs)
// mono_tuple_matcher_ holds a monomorphic version of the tuple matcher.
@@ -3800,7 +3800,7 @@ class UnorderedElementsAreMatcher {
typedef typename View::value_type Element;
typedef ::std::vector<Matcher<const Element&> > MatcherVec;
MatcherVec matchers;
- matchers.reserve(::testing::tuple_size<MatcherTuple>::value);
+ matchers.reserve(::std::tuple_size<MatcherTuple>::value);
TransformTupleValues(CastAndAppendTransform<const Element&>(), matchers_,
::std::back_inserter(matchers));
return MakeMatcher(new UnorderedElementsAreMatcherImpl<Container>(
@@ -3822,7 +3822,7 @@ class ElementsAreMatcher {
operator Matcher<Container>() const {
GTEST_COMPILE_ASSERT_(
!IsHashTable<GTEST_REMOVE_REFERENCE_AND_CONST_(Container)>::value ||
- ::testing::tuple_size<MatcherTuple>::value < 2,
+ ::std::tuple_size<MatcherTuple>::value < 2,
use_UnorderedElementsAre_with_hash_tables);
typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
@@ -3830,7 +3830,7 @@ class ElementsAreMatcher {
typedef typename View::value_type Element;
typedef ::std::vector<Matcher<const Element&> > MatcherVec;
MatcherVec matchers;
- matchers.reserve(::testing::tuple_size<MatcherTuple>::value);
+ matchers.reserve(::std::tuple_size<MatcherTuple>::value);
TransformTupleValues(CastAndAppendTransform<const Element&>(), matchers_,
::std::back_inserter(matchers));
return MakeMatcher(new ElementsAreMatcherImpl<Container>(
@@ -3923,7 +3923,7 @@ class BoundSecondMatcher {
template <typename T>
class Impl : public MatcherInterface<T> {
public:
- typedef ::testing::tuple<T, Second> ArgTuple;
+ typedef ::std::tuple<T, Second> ArgTuple;
Impl(const Tuple2Matcher& tm, const Second& second)
: mono_tuple2_matcher_(SafeMatcherCast<const ArgTuple&>(tm)),
@@ -4043,6 +4043,7 @@ class VariantMatcher {
template <typename Variant>
bool MatchAndExplain(const Variant& value,
::testing::MatchResultListener* listener) const {
+ using std::get;
if (!listener->IsInterested()) {
return holds_alternative<T>(value) && matcher_.Matches(get<T>(value));
}
@@ -4817,7 +4818,7 @@ WhenSorted(const ContainerMatcher& container_matcher) {
// Matches an STL-style container or a native array that contains the
// same number of elements as in rhs, where its i-th element and rhs's
// i-th element (as a pair) satisfy the given pair matcher, for all i.
-// TupleMatcher must be able to be safely cast to Matcher<tuple<const
+// TupleMatcher must be able to be safely cast to Matcher<std::tuple<const
// T1&, const T2&> >, where T1 and T2 are the types of elements in the
// LHS container and the RHS container respectively.
template <typename TupleMatcher, typename Container>
@@ -4848,7 +4849,7 @@ inline internal::PointwiseMatcher<TupleMatcher, std::vector<T> > Pointwise(
// elements as in rhs, where in some permutation of the container, its
// i-th element and rhs's i-th element (as a pair) satisfy the given
// pair matcher, for all i. Tuple2Matcher must be able to be safely
-// cast to Matcher<tuple<const T1&, const T2&> >, where T1 and T2 are
+// cast to Matcher<std::tuple<const T1&, const T2&> >, where T1 and T2 are
// the types of elements in the LHS container and the RHS container
// respectively.
//
@@ -5140,20 +5141,21 @@ std::string DescribeMatcher(const M& matcher, bool negation = false) {
}
template <typename... Args>
-internal::ElementsAreMatcher<tuple<typename std::decay<const Args&>::type...>>
+internal::ElementsAreMatcher<
+ std::tuple<typename std::decay<const Args&>::type...>>
ElementsAre(const Args&... matchers) {
return internal::ElementsAreMatcher<
- tuple<typename std::decay<const Args&>::type...>>(
- make_tuple(matchers...));
+ std::tuple<typename std::decay<const Args&>::type...>>(
+ std::make_tuple(matchers...));
}
template <typename... Args>
internal::UnorderedElementsAreMatcher<
- tuple<typename std::decay<const Args&>::type...>>
+ std::tuple<typename std::decay<const Args&>::type...>>
UnorderedElementsAre(const Args&... matchers) {
return internal::UnorderedElementsAreMatcher<
- tuple<typename std::decay<const Args&>::type...>>(
- make_tuple(matchers...));
+ std::tuple<typename std::decay<const Args&>::type...>>(
+ std::make_tuple(matchers...));
}
// Define variadic matcher versions.
diff --git a/googlemock/include/gmock/gmock-more-actions.h b/googlemock/include/gmock/gmock-more-actions.h
index 4d9a28ea..5c6dc8bb 100644
--- a/googlemock/include/gmock/gmock-more-actions.h
+++ b/googlemock/include/gmock/gmock-more-actions.h
@@ -162,7 +162,7 @@ WithArg(const InnerAction& action) {
ACTION_TEMPLATE(ReturnArg,
HAS_1_TEMPLATE_PARAMS(int, k),
AND_0_VALUE_PARAMS()) {
- return ::testing::get<k>(args);
+ return ::std::get<k>(args);
}
// Action SaveArg<k>(pointer) saves the k-th (0-based) argument of the
@@ -170,7 +170,7 @@ ACTION_TEMPLATE(ReturnArg,
ACTION_TEMPLATE(SaveArg,
HAS_1_TEMPLATE_PARAMS(int, k),
AND_1_VALUE_PARAMS(pointer)) {
- *pointer = ::testing::get<k>(args);
+ *pointer = ::std::get<k>(args);
}
// Action SaveArgPointee<k>(pointer) saves the value pointed to
@@ -178,7 +178,7 @@ ACTION_TEMPLATE(SaveArg,
ACTION_TEMPLATE(SaveArgPointee,
HAS_1_TEMPLATE_PARAMS(int, k),
AND_1_VALUE_PARAMS(pointer)) {
- *pointer = *::testing::get<k>(args);
+ *pointer = *::std::get<k>(args);
}
// Action SetArgReferee<k>(value) assigns 'value' to the variable
@@ -186,13 +186,13 @@ ACTION_TEMPLATE(SaveArgPointee,
ACTION_TEMPLATE(SetArgReferee,
HAS_1_TEMPLATE_PARAMS(int, k),
AND_1_VALUE_PARAMS(value)) {
- typedef typename ::testing::tuple_element<k, args_type>::type argk_type;
+ typedef typename ::std::tuple_element<k, args_type>::type argk_type;
// Ensures that argument #k is a reference. If you get a compiler
// error on the next line, you are using SetArgReferee<k>(value) in
// a mock function whose k-th (0-based) argument is not a reference.
GTEST_COMPILE_ASSERT_(internal::is_reference<argk_type>::value,
SetArgReferee_must_be_used_with_a_reference_argument);
- ::testing::get<k>(args) = value;
+ ::std::get<k>(args) = value;
}
// Action SetArrayArgument<k>(first, last) copies the elements in
@@ -205,9 +205,9 @@ ACTION_TEMPLATE(SetArrayArgument,
AND_2_VALUE_PARAMS(first, last)) {
// Visual Studio deprecates ::std::copy, so we use our own copy in that case.
#ifdef _MSC_VER
- internal::CopyElements(first, last, ::testing::get<k>(args));
+ internal::CopyElements(first, last, ::std::get<k>(args));
#else
- ::std::copy(first, last, ::testing::get<k>(args));
+ ::std::copy(first, last, ::std::get<k>(args));
#endif
}
@@ -216,7 +216,7 @@ ACTION_TEMPLATE(SetArrayArgument,
ACTION_TEMPLATE(DeleteArg,
HAS_1_TEMPLATE_PARAMS(int, k),
AND_0_VALUE_PARAMS()) {
- delete ::testing::get<k>(args);
+ delete ::std::get<k>(args);
}
// This action returns the value pointed to by 'pointer'.
diff --git a/googlemock/include/gmock/internal/gmock-generated-internal-utils.h b/googlemock/include/gmock/internal/gmock-generated-internal-utils.h
index eaa56be9..efa04629 100644
--- a/googlemock/include/gmock/internal/gmock-generated-internal-utils.h
+++ b/googlemock/include/gmock/internal/gmock-generated-internal-utils.h
@@ -70,79 +70,71 @@ template <typename Tuple>
struct MatcherTuple;
template <>
-struct MatcherTuple< ::testing::tuple<> > {
- typedef ::testing::tuple< > type;
+struct MatcherTuple< ::std::tuple<> > {
+ typedef ::std::tuple< > type;
};
template <typename A1>
-struct MatcherTuple< ::testing::tuple<A1> > {
- typedef ::testing::tuple<Matcher<A1> > type;
+struct MatcherTuple< ::std::tuple<A1> > {
+ typedef ::std::tuple<Matcher<A1> > type;
};
template <typename A1, typename A2>
-struct MatcherTuple< ::testing::tuple<A1, A2> > {
- typedef ::testing::tuple<Matcher<A1>, Matcher<A2> > type;
+struct MatcherTuple< ::std::tuple<A1, A2> > {
+ typedef ::std::tuple<Matcher<A1>, Matcher<A2> > type;
};
template <typename A1, typename A2, typename A3>
-struct MatcherTuple< ::testing::tuple<A1, A2, A3> > {
- typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3> > type;
+struct MatcherTuple< ::std::tuple<A1, A2, A3> > {
+ typedef ::std::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3> > type;
};
template <typename A1, typename A2, typename A3, typename A4>
-struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4> > {
- typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4> >
- type;
+struct MatcherTuple< ::std::tuple<A1, A2, A3, A4> > {
+ typedef ::std::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>,
+ Matcher<A4> > type;
};
template <typename A1, typename A2, typename A3, typename A4, typename A5>
-struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5> > {
- typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
- Matcher<A5> >
- type;
+struct MatcherTuple< ::std::tuple<A1, A2, A3, A4, A5> > {
+ typedef ::std::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
+ Matcher<A5> > type;
};
template <typename A1, typename A2, typename A3, typename A4, typename A5,
typename A6>
-struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6> > {
- typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
- Matcher<A5>, Matcher<A6> >
- type;
+struct MatcherTuple< ::std::tuple<A1, A2, A3, A4, A5, A6> > {
+ typedef ::std::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
+ Matcher<A5>, Matcher<A6> > type;
};
template <typename A1, typename A2, typename A3, typename A4, typename A5,
typename A6, typename A7>
-struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> > {
- typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
- Matcher<A5>, Matcher<A6>, Matcher<A7> >
- type;
+struct MatcherTuple< ::std::tuple<A1, A2, A3, A4, A5, A6, A7> > {
+ typedef ::std::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
+ Matcher<A5>, Matcher<A6>, Matcher<A7> > type;
};
template <typename A1, typename A2, typename A3, typename A4, typename A5,
typename A6, typename A7, typename A8>
-struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > {
- typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
- Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8> >
- type;
+struct MatcherTuple< ::std::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > {
+ typedef ::std::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
+ Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8> > type;
};
template <typename A1, typename A2, typename A3, typename A4, typename A5,
typename A6, typename A7, typename A8, typename A9>
-struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {
- typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
- Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8>,
- Matcher<A9> >
- type;
+struct MatcherTuple< ::std::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {
+ typedef ::std::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
+ Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8>, Matcher<A9> > type;
};
template <typename A1, typename A2, typename A3, typename A4, typename A5,
typename A6, typename A7, typename A8, typename A9, typename A10>
-struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
- A10> > {
- typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
- Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8>,
- Matcher<A9>, Matcher<A10> >
- type;
+struct MatcherTuple< ::std::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10> > {
+ typedef ::std::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
+ Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8>, Matcher<A9>,
+ Matcher<A10> > type;
};
// Template struct Function<F>, where F must be a function type, contains
@@ -164,7 +156,7 @@ struct Function;
template <typename R>
struct Function<R()> {
typedef R Result;
- typedef ::testing::tuple<> ArgumentTuple;
+ typedef ::std::tuple<> ArgumentTuple;
typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
typedef void MakeResultVoid();
typedef IgnoredValue MakeResultIgnoredValue();
@@ -174,7 +166,7 @@ template <typename R, typename A1>
struct Function<R(A1)>
: Function<R()> {
typedef A1 Argument1;
- typedef ::testing::tuple<A1> ArgumentTuple;
+ typedef ::std::tuple<A1> ArgumentTuple;
typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
typedef void MakeResultVoid(A1);
typedef IgnoredValue MakeResultIgnoredValue(A1);
@@ -184,7 +176,7 @@ template <typename R, typename A1, typename A2>
struct Function<R(A1, A2)>
: Function<R(A1)> {
typedef A2 Argument2;
- typedef ::testing::tuple<A1, A2> ArgumentTuple;
+ typedef ::std::tuple<A1, A2> ArgumentTuple;
typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
typedef void MakeResultVoid(A1, A2);
typedef IgnoredValue MakeResultIgnoredValue(A1, A2);
@@ -194,7 +186,7 @@ template <typename R, typename A1, typename A2, typename A3>
struct Function<R(A1, A2, A3)>
: Function<R(A1, A2)> {
typedef A3 Argument3;
- typedef ::testing::tuple<A1, A2, A3> ArgumentTuple;
+ typedef ::std::tuple<A1, A2, A3> ArgumentTuple;
typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
typedef void MakeResultVoid(A1, A2, A3);
typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3);
@@ -204,7 +196,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4>
struct Function<R(A1, A2, A3, A4)>
: Function<R(A1, A2, A3)> {
typedef A4 Argument4;
- typedef ::testing::tuple<A1, A2, A3, A4> ArgumentTuple;
+ typedef ::std::tuple<A1, A2, A3, A4> ArgumentTuple;
typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
typedef void MakeResultVoid(A1, A2, A3, A4);
typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4);
@@ -215,7 +207,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4,
struct Function<R(A1, A2, A3, A4, A5)>
: Function<R(A1, A2, A3, A4)> {
typedef A5 Argument5;
- typedef ::testing::tuple<A1, A2, A3, A4, A5> ArgumentTuple;
+ typedef ::std::tuple<A1, A2, A3, A4, A5> ArgumentTuple;
typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
typedef void MakeResultVoid(A1, A2, A3, A4, A5);
typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5);
@@ -226,7 +218,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4,
struct Function<R(A1, A2, A3, A4, A5, A6)>
: Function<R(A1, A2, A3, A4, A5)> {
typedef A6 Argument6;
- typedef ::testing::tuple<A1, A2, A3, A4, A5, A6> ArgumentTuple;
+ typedef ::std::tuple<A1, A2, A3, A4, A5, A6> ArgumentTuple;
typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6);
typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6);
@@ -237,7 +229,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4,
struct Function<R(A1, A2, A3, A4, A5, A6, A7)>
: Function<R(A1, A2, A3, A4, A5, A6)> {
typedef A7 Argument7;
- typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> ArgumentTuple;
+ typedef ::std::tuple<A1, A2, A3, A4, A5, A6, A7> ArgumentTuple;
typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7);
typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7);
@@ -248,7 +240,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4,
struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8)>
: Function<R(A1, A2, A3, A4, A5, A6, A7)> {
typedef A8 Argument8;
- typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> ArgumentTuple;
+ typedef ::std::tuple<A1, A2, A3, A4, A5, A6, A7, A8> ArgumentTuple;
typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8);
typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8);
@@ -259,7 +251,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4,
struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)>
: Function<R(A1, A2, A3, A4, A5, A6, A7, A8)> {
typedef A9 Argument9;
- typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> ArgumentTuple;
+ typedef ::std::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> ArgumentTuple;
typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8, A9);
typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8,
@@ -272,8 +264,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4,
struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>
: Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
typedef A10 Argument10;
- typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
- A10> ArgumentTuple;
+ typedef ::std::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10> ArgumentTuple;
typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10);
typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8,
diff --git a/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump b/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump
index c1032798..9962f6b3 100644
--- a/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump
+++ b/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump
@@ -78,8 +78,8 @@ $var typename_As = [[$for j, [[typename A$j]]]]
$var As = [[$for j, [[A$j]]]]
$var matcher_As = [[$for j, [[Matcher<A$j>]]]]
template <$typename_As>
-struct MatcherTuple< ::testing::tuple<$As> > {
- typedef ::testing::tuple<$matcher_As > type;
+struct MatcherTuple< ::std::tuple<$As> > {
+ typedef ::std::tuple<$matcher_As > type;
};
@@ -103,7 +103,7 @@ struct Function;
template <typename R>
struct Function<R()> {
typedef R Result;
- typedef ::testing::tuple<> ArgumentTuple;
+ typedef ::std::tuple<> ArgumentTuple;
typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
typedef void MakeResultVoid();
typedef IgnoredValue MakeResultIgnoredValue();
@@ -122,7 +122,7 @@ template <typename R$typename_As>
struct Function<R($As)>
: Function<R($prev_As)> {
typedef A$i Argument$i;
- typedef ::testing::tuple<$As> ArgumentTuple;
+ typedef ::std::tuple<$As> ArgumentTuple;
typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
typedef void MakeResultVoid($As);
typedef IgnoredValue MakeResultIgnoredValue($As);
diff --git a/googlemock/include/gmock/internal/gmock-internal-utils.h b/googlemock/include/gmock/internal/gmock-internal-utils.h
index db64c65c..fd33c004 100644
--- a/googlemock/include/gmock/internal/gmock-internal-utils.h
+++ b/googlemock/include/gmock/internal/gmock-internal-utils.h
@@ -493,7 +493,7 @@ class StlContainerView<Element[N]> {
// This specialization is used when RawContainer is a native array
// represented as a (pointer, size) tuple.
template <typename ElementPointer, typename Size>
-class StlContainerView< ::testing::tuple<ElementPointer, Size> > {
+class StlContainerView< ::std::tuple<ElementPointer, Size> > {
public:
typedef GTEST_REMOVE_CONST_(
typename internal::PointeeOf<ElementPointer>::type) RawElement;
@@ -501,11 +501,12 @@ class StlContainerView< ::testing::tuple<ElementPointer, Size> > {
typedef const type const_reference;
static const_reference ConstReference(
- const ::testing::tuple<ElementPointer, Size>& array) {
- return type(get<0>(array), get<1>(array), RelationToSourceReference());
+ const ::std::tuple<ElementPointer, Size>& array) {
+ return type(std::get<0>(array), std::get<1>(array),
+ RelationToSourceReference());
}
- static type Copy(const ::testing::tuple<ElementPointer, Size>& array) {
- return type(get<0>(array), get<1>(array), RelationToSourceCopy());
+ static type Copy(const ::std::tuple<ElementPointer, Size>& array) {
+ return type(std::get<0>(array), std::get<1>(array), RelationToSourceCopy());
}
};
diff --git a/googlemock/test/gmock-actions_test.cc b/googlemock/test/gmock-actions_test.cc
index 7db5d3cb..0de84811 100644
--- a/googlemock/test/gmock-actions_test.cc
+++ b/googlemock/test/gmock-actions_test.cc
@@ -75,13 +75,9 @@ using testing::SetArgPointee;
using testing::SetArgumentPointee;
using testing::Unused;
using testing::_;
-using testing::get;
using testing::internal::BuiltInDefaultValue;
using testing::internal::Int64;
using testing::internal::UInt64;
-using testing::make_tuple;
-using testing::tuple;
-using testing::tuple_element;
#if !GTEST_OS_WINDOWS_MOBILE
using testing::SetErrnoAndReturn;
@@ -382,8 +378,8 @@ typedef int MyGlobalFunction(bool, int);
class MyActionImpl : public ActionInterface<MyGlobalFunction> {
public:
- virtual int Perform(const tuple<bool, int>& args) {
- return get<0>(args) ? get<1>(args) : 0;
+ virtual int Perform(const std::tuple<bool, int>& args) {
+ return std::get<0>(args) ? std::get<1>(args) : 0;
}
};
@@ -399,8 +395,8 @@ TEST(ActionInterfaceTest, MakeAction) {
// it a tuple whose size and type are compatible with F's argument
// types. For example, if F is int(), then Perform() takes a
// 0-tuple; if F is void(bool, int), then Perform() takes a
- // tuple<bool, int>, and so on.
- EXPECT_EQ(5, action.Perform(make_tuple(true, 5)));
+ // std::tuple<bool, int>, and so on.
+ EXPECT_EQ(5, action.Perform(std::make_tuple(true, 5)));
}
// Tests that Action<F> can be contructed from a pointer to
@@ -413,8 +409,8 @@ TEST(ActionTest, CanBeConstructedFromActionInterface) {
TEST(ActionTest, DelegatesWorkToActionInterface) {
const Action<MyGlobalFunction> action(new MyActionImpl);
- EXPECT_EQ(5, action.Perform(make_tuple(true, 5)));
- EXPECT_EQ(0, action.Perform(make_tuple(false, 1)));
+ EXPECT_EQ(5, action.Perform(std::make_tuple(true, 5)));
+ EXPECT_EQ(0, action.Perform(std::make_tuple(false, 1)));
}
// Tests that Action<F> can be copied.
@@ -423,22 +419,22 @@ TEST(ActionTest, IsCopyable) {
Action<MyGlobalFunction> a2(a1); // Tests the copy constructor.
// a1 should continue to work after being copied from.
- EXPECT_EQ(5, a1.Perform(make_tuple(true, 5)));
- EXPECT_EQ(0, a1.Perform(make_tuple(false, 1)));
+ EXPECT_EQ(5, a1.Perform(std::make_tuple(true, 5)));
+ EXPECT_EQ(0, a1.Perform(std::make_tuple(false, 1)));
// a2 should work like the action it was copied from.
- EXPECT_EQ(5, a2.Perform(make_tuple(true, 5)));
- EXPECT_EQ(0, a2.Perform(make_tuple(false, 1)));
+ EXPECT_EQ(5, a2.Perform(std::make_tuple(true, 5)));
+ EXPECT_EQ(0, a2.Perform(std::make_tuple(false, 1)));
a2 = a1; // Tests the assignment operator.
// a1 should continue to work after being copied from.
- EXPECT_EQ(5, a1.Perform(make_tuple(true, 5)));
- EXPECT_EQ(0, a1.Perform(make_tuple(false, 1)));
+ EXPECT_EQ(5, a1.Perform(std::make_tuple(true, 5)));
+ EXPECT_EQ(0, a1.Perform(std::make_tuple(false, 1)));
// a2 should work like the action it was copied from.
- EXPECT_EQ(5, a2.Perform(make_tuple(true, 5)));
- EXPECT_EQ(0, a2.Perform(make_tuple(false, 1)));
+ EXPECT_EQ(5, a2.Perform(std::make_tuple(true, 5)));
+ EXPECT_EQ(0, a2.Perform(std::make_tuple(false, 1)));
}
// Tests that an Action<From> object can be converted to a
@@ -446,8 +442,8 @@ TEST(ActionTest, IsCopyable) {
class IsNotZero : public ActionInterface<bool(int)> { // NOLINT
public:
- virtual bool Perform(const tuple<int>& arg) {
- return get<0>(arg) != 0;
+ virtual bool Perform(const std::tuple<int>& arg) {
+ return std::get<0>(arg) != 0;
}
};
@@ -460,8 +456,8 @@ class IsNotZero : public ActionInterface<bool(int)> { // NOLINT
TEST(ActionTest, CanBeConvertedToOtherActionType) {
const Action<bool(int)> a1(new IsNotZero); // NOLINT
const Action<int(char)> a2 = Action<int(char)>(a1); // NOLINT
- EXPECT_EQ(1, a2.Perform(make_tuple('a')));
- EXPECT_EQ(0, a2.Perform(make_tuple('\0')));
+ EXPECT_EQ(1, a2.Perform(std::make_tuple('a')));
+ EXPECT_EQ(0, a2.Perform(std::make_tuple('\0')));
}
#endif // !GTEST_OS_SYMBIAN
@@ -475,7 +471,9 @@ class ReturnSecondArgumentAction {
// polymorphic action whose Perform() method template is either
// const or not. This lets us verify the non-const case.
template <typename Result, typename ArgumentTuple>
- Result Perform(const ArgumentTuple& args) { return get<1>(args); }
+ Result Perform(const ArgumentTuple& args) {
+ return std::get<1>(args);
+ }
};
// Implements a polymorphic action that can be used in a nullary
@@ -490,7 +488,9 @@ class ReturnZeroFromNullaryFunctionAction {
// polymorphic action whose Perform() method template is either
// const or not. This lets us verify the const case.
template <typename Result>
- Result Perform(const tuple<>&) const { return 0; }
+ Result Perform(const std::tuple<>&) const {
+ return 0;
+ }
};
// These functions verify that MakePolymorphicAction() returns a
@@ -509,42 +509,42 @@ ReturnZeroFromNullaryFunction() {
// implementation class into a polymorphic action.
TEST(MakePolymorphicActionTest, ConstructsActionFromImpl) {
Action<int(bool, int, double)> a1 = ReturnSecondArgument(); // NOLINT
- EXPECT_EQ(5, a1.Perform(make_tuple(false, 5, 2.0)));
+ EXPECT_EQ(5, a1.Perform(std::make_tuple(false, 5, 2.0)));
}
// Tests that MakePolymorphicAction() works when the implementation
// class' Perform() method template has only one template parameter.
TEST(MakePolymorphicActionTest, WorksWhenPerformHasOneTemplateParameter) {
Action<int()> a1 = ReturnZeroFromNullaryFunction();
- EXPECT_EQ(0, a1.Perform(make_tuple()));
+ EXPECT_EQ(0, a1.Perform(std::make_tuple()));
Action<void*()> a2 = ReturnZeroFromNullaryFunction();
- EXPECT_TRUE(a2.Perform(make_tuple()) == nullptr);
+ EXPECT_TRUE(a2.Perform(std::make_tuple()) == nullptr);
}
// Tests that Return() works as an action for void-returning
// functions.
TEST(ReturnTest, WorksForVoid) {
const Action<void(int)> ret = Return(); // NOLINT
- return ret.Perform(make_tuple(1));
+ return ret.Perform(std::make_tuple(1));
}
// Tests that Return(v) returns v.
TEST(ReturnTest, ReturnsGivenValue) {
Action<int()> ret = Return(1); // NOLINT
- EXPECT_EQ(1, ret.Perform(make_tuple()));
+ EXPECT_EQ(1, ret.Perform(std::make_tuple()));
ret = Return(-5);
- EXPECT_EQ(-5, ret.Perform(make_tuple()));
+ EXPECT_EQ(-5, ret.Perform(std::make_tuple()));
}
// Tests that Return("string literal") works.
TEST(ReturnTest, AcceptsStringLiteral) {
Action<const char*()> a1 = Return("Hello");
- EXPECT_STREQ("Hello", a1.Perform(make_tuple()));
+ EXPECT_STREQ("Hello", a1.Perform(std::make_tuple()));
Action<std::string()> a2 = Return("world");
- EXPECT_EQ("world", a2.Perform(make_tuple()));
+ EXPECT_EQ("world", a2.Perform(std::make_tuple()));
}
// Test struct which wraps a vector of integers. Used in
@@ -563,7 +563,7 @@ TEST(ReturnTest, SupportsWrapperReturnType) {
// Return() called with 'v' as argument. The Action will return the same data
// as 'v' (copy) but it will be wrapped in an IntegerVectorWrapper.
Action<IntegerVectorWrapper()> a = Return(v);
- const std::vector<int>& result = *(a.Perform(make_tuple()).v);
+ const std::vector<int>& result = *(a.Perform(std::make_tuple()).v);
EXPECT_THAT(result, ::testing::ElementsAre(0, 1, 2, 3, 4));
}
@@ -581,10 +581,10 @@ TEST(ReturnTest, IsCovariant) {
Base base;
Derived derived;
Action<Base*()> ret = Return(&base);
- EXPECT_EQ(&base, ret.Perform(make_tuple()));
+ EXPECT_EQ(&base, ret.Perform(std::make_tuple()));
ret = Return(&derived);
- EXPECT_EQ(&derived, ret.Perform(make_tuple()));
+ EXPECT_EQ(&derived, ret.Perform(std::make_tuple()));
}
// Tests that the type of the value passed into Return is converted into T
@@ -615,7 +615,7 @@ TEST(ReturnTest, ConvertsArgumentWhenConverted) {
EXPECT_TRUE(converted) << "Return must convert its argument in its own "
<< "conversion operator.";
converted = false;
- action.Perform(tuple<>());
+ action.Perform(std::tuple<>());
EXPECT_FALSE(converted) << "Action must NOT convert its argument "
<< "when performed.";
}
@@ -636,10 +636,10 @@ TEST(ReturnTest, CanConvertArgumentUsingNonConstTypeCastOperator) {
// Tests that ReturnNull() returns NULL in a pointer-returning function.
TEST(ReturnNullTest, WorksInPointerReturningFunction) {
const Action<int*()> a1 = ReturnNull();
- EXPECT_TRUE(a1.Perform(make_tuple()) == nullptr);
+ EXPECT_TRUE(a1.Perform(std::make_tuple()) == nullptr);
const Action<const char*(bool)> a2 = ReturnNull(); // NOLINT
- EXPECT_TRUE(a2.Perform(make_tuple(true)) == nullptr);
+ EXPECT_TRUE(a2.Perform(std::make_tuple(true)) == nullptr);
}
#if GTEST_HAS_STD_UNIQUE_PTR_
@@ -647,10 +647,10 @@ TEST(ReturnNullTest, WorksInPointerReturningFunction) {
// functions.
TEST(ReturnNullTest, WorksInSmartPointerReturningFunction) {
const Action<std::unique_ptr<const int>()> a1 = ReturnNull();
- EXPECT_TRUE(a1.Perform(make_tuple()) == nullptr);
+ EXPECT_TRUE(a1.Perform(std::make_tuple()) == nullptr);
const Action<std::shared_ptr<int>(std::string)> a2 = ReturnNull();
- EXPECT_TRUE(a2.Perform(make_tuple("foo")) == nullptr);
+ EXPECT_TRUE(a2.Perform(std::make_tuple("foo")) == nullptr);
}
#endif // GTEST_HAS_STD_UNIQUE_PTR_
@@ -659,7 +659,7 @@ TEST(ReturnRefTest, WorksForReference) {
const int n = 0;
const Action<const int&(bool)> ret = ReturnRef(n); // NOLINT
- EXPECT_EQ(&n, &ret.Perform(make_tuple(true)));
+ EXPECT_EQ(&n, &ret.Perform(std::make_tuple(true)));
}
// Tests that ReturnRef(v) is covariant.
@@ -667,10 +667,10 @@ TEST(ReturnRefTest, IsCovariant) {
Base base;
Derived derived;
Action<Base&()> a = ReturnRef(base);
- EXPECT_EQ(&base, &a.Perform(make_tuple()));
+ EXPECT_EQ(&base, &a.Perform(std::make_tuple()));
a = ReturnRef(derived);
- EXPECT_EQ(&derived, &a.Perform(make_tuple()));
+ EXPECT_EQ(&derived, &a.Perform(std::make_tuple()));
}
// Tests that ReturnRefOfCopy(v) works for reference types.
@@ -678,12 +678,12 @@ TEST(ReturnRefOfCopyTest, WorksForReference) {
int n = 42;
const Action<const int&()> ret = ReturnRefOfCopy(n);
- EXPECT_NE(&n, &ret.Perform(make_tuple()));
- EXPECT_EQ(42, ret.Perform(make_tuple()));
+ EXPECT_NE(&n, &ret.Perform(std::make_tuple()));
+ EXPECT_EQ(42, ret.Perform(std::make_tuple()));
n = 43;
- EXPECT_NE(&n, &ret.Perform(make_tuple()));
- EXPECT_EQ(42, ret.Perform(make_tuple()));
+ EXPECT_NE(&n, &ret.Perform(std::make_tuple()));
+ EXPECT_EQ(42, ret.Perform(std::make_tuple()));
}
// Tests that ReturnRefOfCopy(v) is covariant.
@@ -691,10 +691,10 @@ TEST(ReturnRefOfCopyTest, IsCovariant) {
Base base;
Derived derived;
Action<Base&()> a = ReturnRefOfCopy(base);
- EXPECT_NE(&base, &a.Perform(make_tuple()));
+ EXPECT_NE(&base, &a.Perform(std::make_tuple()));
a = ReturnRefOfCopy(derived);
- EXPECT_NE(&derived, &a.Perform(make_tuple()));
+ EXPECT_NE(&derived, &a.Perform(std::make_tuple()));
}
// Tests that DoDefault() does the default action for the mock method.
@@ -800,14 +800,14 @@ TEST(SetArgPointeeTest, SetsTheNthPointee) {
int n = 0;
char ch = '\0';
- a.Perform(make_tuple(true, &n, &ch));
+ a.Perform(std::make_tuple(true, &n, &ch));
EXPECT_EQ(2, n);
EXPECT_EQ('\0', ch);
a = SetArgPointee<2>('a');
n = 0;
ch = '\0';
- a.Perform(make_tuple(true, &n, &ch));
+ a.Perform(std::make_tuple(true, &n, &ch));
EXPECT_EQ(0, n);
EXPECT_EQ('a', ch);
}
@@ -820,13 +820,13 @@ TEST(SetArgPointeeTest, AcceptsStringLiteral) {
Action<MyFunction> a = SetArgPointee<0>("hi");
std::string str;
const char* ptr = nullptr;
- a.Perform(make_tuple(&str, &ptr));
+ a.Perform(std::make_tuple(&str, &ptr));
EXPECT_EQ("hi", str);
EXPECT_TRUE(ptr == nullptr);
a = SetArgPointee<1>("world");
str = "";
- a.Perform(make_tuple(&str, &ptr));
+ a.Perform(std::make_tuple(&str, &ptr));
EXPECT_EQ("", str);
EXPECT_STREQ("world", ptr);
}
@@ -835,7 +835,7 @@ TEST(SetArgPointeeTest, AcceptsWideStringLiteral) {
typedef void MyFunction(const wchar_t**);
Action<MyFunction> a = SetArgPointee<0>(L"world");
const wchar_t* ptr = nullptr;
- a.Perform(make_tuple(&ptr));
+ a.Perform(std::make_tuple(&ptr));
EXPECT_STREQ(L"world", ptr);
# if GTEST_HAS_STD_WSTRING
@@ -843,7 +843,7 @@ TEST(SetArgPointeeTest, AcceptsWideStringLiteral) {
typedef void MyStringFunction(std::wstring*);
Action<MyStringFunction> a2 = SetArgPointee<0>(L"world");
std::wstring str = L"";
- a2.Perform(make_tuple(&str));
+ a2.Perform(std::make_tuple(&str));
EXPECT_EQ(L"world", str);
# endif
@@ -857,7 +857,7 @@ TEST(SetArgPointeeTest, AcceptsCharPointer) {
Action<MyFunction> a = SetArgPointee<1>(hi);
std::string str;
const char* ptr = nullptr;
- a.Perform(make_tuple(true, &str, &ptr));
+ a.Perform(std::make_tuple(true, &str, &ptr));
EXPECT_EQ("hi", str);
EXPECT_TRUE(ptr == nullptr);
@@ -865,7 +865,7 @@ TEST(SetArgPointeeTest, AcceptsCharPointer) {
char* const world = world_array;
a = SetArgPointee<2>(world);
str = "";
- a.Perform(make_tuple(true, &str, &ptr));
+ a.Perform(std::make_tuple(true, &str, &ptr));
EXPECT_EQ("", str);
EXPECT_EQ(world, ptr);
}
@@ -875,7 +875,7 @@ TEST(SetArgPointeeTest, AcceptsWideCharPointer) {
const wchar_t* const hi = L"hi";
Action<MyFunction> a = SetArgPointee<1>(hi);
const wchar_t* ptr = nullptr;
- a.Perform(make_tuple(true, &ptr));
+ a.Perform(std::make_tuple(true, &ptr));
EXPECT_EQ(hi, ptr);
# if GTEST_HAS_STD_WSTRING
@@ -885,7 +885,7 @@ TEST(SetArgPointeeTest, AcceptsWideCharPointer) {
wchar_t* const world = world_array;
Action<MyStringFunction> a2 = SetArgPointee<1>(world);
std::wstring str;
- a2.Perform(make_tuple(true, &str));
+ a2.Perform(std::make_tuple(true, &str));
EXPECT_EQ(world_array, str);
# endif
}
@@ -898,14 +898,14 @@ TEST(SetArgumentPointeeTest, SetsTheNthPointee) {
int n = 0;
char ch = '\0';
- a.Perform(make_tuple(true, &n, &ch));
+ 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(make_tuple(true, &n, &ch));
+ a.Perform(std::make_tuple(true, &n, &ch));
EXPECT_EQ(0, n);
EXPECT_EQ('a', ch);
}
@@ -940,16 +940,16 @@ class Foo {
TEST(InvokeWithoutArgsTest, Function) {
// As an action that takes one argument.
Action<int(int)> a = InvokeWithoutArgs(Nullary); // NOLINT
- EXPECT_EQ(1, a.Perform(make_tuple(2)));
+ EXPECT_EQ(1, a.Perform(std::make_tuple(2)));
// As an action that takes two arguments.
Action<int(int, double)> a2 = InvokeWithoutArgs(Nullary); // NOLINT
- EXPECT_EQ(1, a2.Perform(make_tuple(2, 3.5)));
+ EXPECT_EQ(1, a2.Perform(std::make_tuple(2, 3.5)));
// As an action that returns void.
Action<void(int)> a3 = InvokeWithoutArgs(VoidNullary); // NOLINT
g_done = false;
- a3.Perform(make_tuple(1));
+ a3.Perform(std::make_tuple(1));
EXPECT_TRUE(g_done);
}
@@ -957,17 +957,17 @@ TEST(InvokeWithoutArgsTest, Function) {
TEST(InvokeWithoutArgsTest, Functor) {
// As an action that takes no argument.
Action<int()> a = InvokeWithoutArgs(NullaryFunctor()); // NOLINT
- EXPECT_EQ(2, a.Perform(make_tuple()));
+ EXPECT_EQ(2, a.Perform(std::make_tuple()));
// As an action that takes three arguments.
Action<int(int, double, char)> a2 = // NOLINT
InvokeWithoutArgs(NullaryFunctor());
- EXPECT_EQ(2, a2.Perform(make_tuple(3, 3.5, 'a')));
+ EXPECT_EQ(2, a2.Perform(std::make_tuple(3, 3.5, 'a')));
// As an action that returns void.
Action<void()> a3 = InvokeWithoutArgs(VoidNullaryFunctor());
g_done = false;
- a3.Perform(make_tuple());
+ a3.Perform(std::make_tuple());
EXPECT_TRUE(g_done);
}
@@ -976,13 +976,13 @@ TEST(InvokeWithoutArgsTest, Method) {
Foo foo;
Action<int(bool, char)> a = // NOLINT
InvokeWithoutArgs(&foo, &Foo::Nullary);
- EXPECT_EQ(123, a.Perform(make_tuple(true, 'a')));
+ EXPECT_EQ(123, a.Perform(std::make_tuple(true, 'a')));
}
// Tests using IgnoreResult() on a polymorphic action.
TEST(IgnoreResultTest, PolymorphicAction) {
Action<void(int)> a = IgnoreResult(Return(5)); // NOLINT
- a.Perform(make_tuple(1));
+ a.Perform(std::make_tuple(1));
}
// Tests using IgnoreResult() on a monomorphic action.
@@ -995,7 +995,7 @@ int ReturnOne() {
TEST(IgnoreResultTest, MonomorphicAction) {
g_done = false;
Action<void()> a = IgnoreResult(Invoke(ReturnOne));
- a.Perform(make_tuple());
+ a.Perform(std::make_tuple());
EXPECT_TRUE(g_done);
}
@@ -1010,28 +1010,28 @@ TEST(IgnoreResultTest, ActionReturningClass) {
g_done = false;
Action<void(int)> a =
IgnoreResult(Invoke(ReturnMyNonDefaultConstructible)); // NOLINT
- a.Perform(make_tuple(2));
+ a.Perform(std::make_tuple(2));
EXPECT_TRUE(g_done);
}
TEST(AssignTest, Int) {
int x = 0;
Action<void(int)> a = Assign(&x, 5);
- a.Perform(make_tuple(0));
+ a.Perform(std::make_tuple(0));
EXPECT_EQ(5, x);
}
TEST(AssignTest, String) {
::std::string x;
Action<void(void)> a = Assign(&x, "Hello, world");
- a.Perform(make_tuple());
+ a.Perform(std::make_tuple());
EXPECT_EQ("Hello, world", x);
}
TEST(AssignTest, CompatibleTypes) {
double x = 0;
Action<void(int)> a = Assign(&x, 5);
- a.Perform(make_tuple(0));
+ a.Perform(std::make_tuple(0));
EXPECT_DOUBLE_EQ(5, x);
}
@@ -1045,20 +1045,20 @@ class SetErrnoAndReturnTest : public testing::Test {
TEST_F(SetErrnoAndReturnTest, Int) {
Action<int(void)> a = SetErrnoAndReturn(ENOTTY, -5);
- EXPECT_EQ(-5, a.Perform(make_tuple()));
+ EXPECT_EQ(-5, a.Perform(std::make_tuple()));
EXPECT_EQ(ENOTTY, errno);
}
TEST_F(SetErrnoAndReturnTest, Ptr) {
int x;
Action<int*(void)> a = SetErrnoAndReturn(ENOTTY, &x);
- EXPECT_EQ(&x, a.Perform(make_tuple()));
+ EXPECT_EQ(&x, a.Perform(std::make_tuple()));
EXPECT_EQ(ENOTTY, errno);
}
TEST_F(SetErrnoAndReturnTest, CompatibleTypes) {
Action<double()> a = SetErrnoAndReturn(EINVAL, 5);
- EXPECT_DOUBLE_EQ(5.0, a.Perform(make_tuple()));
+ EXPECT_DOUBLE_EQ(5.0, a.Perform(std::make_tuple()));
EXPECT_EQ(EINVAL, errno);
}
@@ -1298,47 +1298,47 @@ TEST(FunctorActionTest, ActionFromFunction) {
TEST(FunctorActionTest, ActionFromLambda) {
Action<int(bool, int)> a1 = [](bool b, int i) { return b ? i : 0; };
- EXPECT_EQ(5, a1.Perform(make_tuple(true, 5)));
- EXPECT_EQ(0, a1.Perform(make_tuple(false, 5)));
+ EXPECT_EQ(5, a1.Perform(std::make_tuple(true, 5)));
+ EXPECT_EQ(0, a1.Perform(std::make_tuple(false, 5)));
std::unique_ptr<int> saved;
Action<void(std::unique_ptr<int>)> a2 = [&saved](std::unique_ptr<int> p) {
saved = std::move(p);
};
- a2.Perform(make_tuple(UniqueInt(5)));
+ a2.Perform(std::make_tuple(UniqueInt(5)));
EXPECT_EQ(5, *saved);
}
TEST(FunctorActionTest, PolymorphicFunctor) {
Action<int(int)> ai = Double();
- EXPECT_EQ(2, ai.Perform(make_tuple(1)));
+ EXPECT_EQ(2, ai.Perform(std::make_tuple(1)));
Action<double(double)> ad = Double(); // Double? Double double!
- EXPECT_EQ(3.0, ad.Perform(make_tuple(1.5)));
+ EXPECT_EQ(3.0, ad.Perform(std::make_tuple(1.5)));
}
TEST(FunctorActionTest, TypeConversion) {
// Numeric promotions are allowed.
const Action<bool(int)> a1 = [](int i) { return i > 1; };
const Action<int(bool)> a2 = Action<int(bool)>(a1);
- EXPECT_EQ(1, a1.Perform(make_tuple(42)));
- EXPECT_EQ(0, a2.Perform(make_tuple(42)));
+ EXPECT_EQ(1, a1.Perform(std::make_tuple(42)));
+ EXPECT_EQ(0, a2.Perform(std::make_tuple(42)));
// Implicit constructors are allowed.
const Action<bool(std::string)> s1 = [](std::string s) { return !s.empty(); };
const Action<int(const char*)> s2 = Action<int(const char*)>(s1);
- EXPECT_EQ(0, s2.Perform(make_tuple("")));
- EXPECT_EQ(1, s2.Perform(make_tuple("hello")));
+ EXPECT_EQ(0, s2.Perform(std::make_tuple("")));
+ EXPECT_EQ(1, s2.Perform(std::make_tuple("hello")));
// Also between the lambda and the action itself.
const Action<bool(std::string)> x = [](Unused) { return 42; };
- EXPECT_TRUE(x.Perform(make_tuple("hello")));
+ EXPECT_TRUE(x.Perform(std::make_tuple("hello")));
}
TEST(FunctorActionTest, UnusedArguments) {
// Verify that users can ignore uninteresting arguments.
Action<int(int, double y, double z)> a =
[](int i, Unused, Unused) { return 2 * i; };
- tuple<int, double, double> dummy = make_tuple(3, 7.3, 9.44);
+ std::tuple<int, double, double> dummy = std::make_tuple(3, 7.3, 9.44);
EXPECT_EQ(6, a.Perform(dummy));
}
@@ -1349,14 +1349,14 @@ TEST(FunctorActionTest, UnusedArguments) {
// so maybe it's better to make users use lambdas instead.
TEST(MoveOnlyArgumentsTest, ReturningActions) {
Action<int(std::unique_ptr<int>)> a = Return(1);
- EXPECT_EQ(1, a.Perform(make_tuple(nullptr)));
+ EXPECT_EQ(1, a.Perform(std::make_tuple(nullptr)));
a = testing::WithoutArgs([]() { return 7; });
- EXPECT_EQ(7, a.Perform(make_tuple(nullptr)));
+ EXPECT_EQ(7, a.Perform(std::make_tuple(nullptr)));
Action<void(std::unique_ptr<int>, int*)> a2 = testing::SetArgPointee<1>(3);
int x = 0;
- a2.Perform(make_tuple(nullptr, &x));
+ a2.Perform(std::make_tuple(nullptr, &x));
EXPECT_EQ(x, 3);
}
diff --git a/googlemock/test/gmock-generated-actions_test.cc b/googlemock/test/gmock-generated-actions_test.cc
index a4602806..2d663a5e 100644
--- a/googlemock/test/gmock-generated-actions_test.cc
+++ b/googlemock/test/gmock-generated-actions_test.cc
@@ -45,10 +45,6 @@ namespace gmock_generated_actions_test {
using ::std::plus;
using ::std::string;
-using testing::get;
-using testing::make_tuple;
-using testing::tuple;
-using testing::tuple_element;
using testing::_;
using testing::Action;
using testing::ActionInterface;
@@ -168,41 +164,41 @@ inline const char* CharPtr(const char* s) { return s; }
// Tests using InvokeArgument with a nullary function.
TEST(InvokeArgumentTest, Function0) {
Action<int(int, int(*)())> a = InvokeArgument<1>(); // NOLINT
- EXPECT_EQ(1, a.Perform(make_tuple(2, &Nullary)));
+ EXPECT_EQ(1, a.Perform(std::make_tuple(2, &Nullary)));
}
// Tests using InvokeArgument with a unary function.
TEST(InvokeArgumentTest, Functor1) {
Action<int(UnaryFunctor)> a = InvokeArgument<0>(true); // NOLINT
- EXPECT_EQ(1, a.Perform(make_tuple(UnaryFunctor())));
+ EXPECT_EQ(1, a.Perform(std::make_tuple(UnaryFunctor())));
}
// Tests using InvokeArgument with a 5-ary function.
TEST(InvokeArgumentTest, Function5) {
Action<int(int(*)(int, int, int, int, int))> a = // NOLINT
InvokeArgument<0>(10000, 2000, 300, 40, 5);
- EXPECT_EQ(12345, a.Perform(make_tuple(&SumOf5)));
+ EXPECT_EQ(12345, a.Perform(std::make_tuple(&SumOf5)));
}
// Tests using InvokeArgument with a 5-ary functor.
TEST(InvokeArgumentTest, Functor5) {
Action<int(SumOf5Functor)> a = // NOLINT
InvokeArgument<0>(10000, 2000, 300, 40, 5);
- EXPECT_EQ(12345, a.Perform(make_tuple(SumOf5Functor())));
+ EXPECT_EQ(12345, a.Perform(std::make_tuple(SumOf5Functor())));
}
// Tests using InvokeArgument with a 6-ary function.
TEST(InvokeArgumentTest, Function6) {
Action<int(int(*)(int, int, int, int, int, int))> a = // NOLINT
InvokeArgument<0>(100000, 20000, 3000, 400, 50, 6);
- EXPECT_EQ(123456, a.Perform(make_tuple(&SumOf6)));
+ EXPECT_EQ(123456, a.Perform(std::make_tuple(&SumOf6)));
}
// Tests using InvokeArgument with a 6-ary functor.
TEST(InvokeArgumentTest, Functor6) {
Action<int(SumOf6Functor)> a = // NOLINT
InvokeArgument<0>(100000, 20000, 3000, 400, 50, 6);
- EXPECT_EQ(123456, a.Perform(make_tuple(SumOf6Functor())));
+ EXPECT_EQ(123456, a.Perform(std::make_tuple(SumOf6Functor())));
}
// Tests using InvokeArgument with a 7-ary function.
@@ -211,7 +207,7 @@ TEST(InvokeArgumentTest, Function7) {
const char*, const char*, const char*,
const char*))>
a = InvokeArgument<0>("1", "2", "3", "4", "5", "6", "7");
- EXPECT_EQ("1234567", a.Perform(make_tuple(&Concat7)));
+ EXPECT_EQ("1234567", a.Perform(std::make_tuple(&Concat7)));
}
// Tests using InvokeArgument with a 8-ary function.
@@ -220,7 +216,7 @@ TEST(InvokeArgumentTest, Function8) {
const char*, const char*, const char*,
const char*, const char*))>
a = InvokeArgument<0>("1", "2", "3", "4", "5", "6", "7", "8");
- EXPECT_EQ("12345678", a.Perform(make_tuple(&Concat8)));
+ EXPECT_EQ("12345678", a.Perform(std::make_tuple(&Concat8)));
}
// Tests using InvokeArgument with a 9-ary function.
@@ -229,7 +225,7 @@ TEST(InvokeArgumentTest, Function9) {
const char*, const char*, const char*,
const char*, const char*, const char*))>
a = InvokeArgument<0>("1", "2", "3", "4", "5", "6", "7", "8", "9");
- EXPECT_EQ("123456789", a.Perform(make_tuple(&Concat9)));
+ EXPECT_EQ("123456789", a.Perform(std::make_tuple(&Concat9)));
}
// Tests using InvokeArgument with a 10-ary function.
@@ -238,14 +234,14 @@ TEST(InvokeArgumentTest, Function10) {
const char*, const char*, const char*, const char*, const char*,
const char*, const char*, const char*, const char*, const char*))>
a = InvokeArgument<0>("1", "2", "3", "4", "5", "6", "7", "8", "9", "0");
- EXPECT_EQ("1234567890", a.Perform(make_tuple(&Concat10)));
+ EXPECT_EQ("1234567890", a.Perform(std::make_tuple(&Concat10)));
}
// Tests using InvokeArgument with a function that takes a pointer argument.
TEST(InvokeArgumentTest, ByPointerFunction) {
Action<const char*(const char*(*)(const char* input, short n))> a = // NOLINT
InvokeArgument<0>(static_cast<const char*>("Hi"), Short(1));
- EXPECT_STREQ("i", a.Perform(make_tuple(&Binary)));
+ EXPECT_STREQ("i", a.Perform(std::make_tuple(&Binary)));
}
// Tests using InvokeArgument with a function that takes a const char*
@@ -253,7 +249,7 @@ TEST(InvokeArgumentTest, ByPointerFunction) {
TEST(InvokeArgumentTest, FunctionWithCStringLiteral) {
Action<const char*(const char*(*)(const char* input, short n))> a = // NOLINT
InvokeArgument<0>("Hi", Short(1));
- EXPECT_STREQ("i", a.Perform(make_tuple(&Binary)));
+ EXPECT_STREQ("i", a.Perform(std::make_tuple(&Binary)));
}
// Tests using InvokeArgument with a function that takes a const reference.
@@ -263,7 +259,7 @@ TEST(InvokeArgumentTest, ByConstReferenceFunction) {
// When action 'a' is constructed, it makes a copy of the temporary
// string object passed to it, so it's OK to use 'a' later, when the
// temporary object has already died.
- EXPECT_TRUE(a.Perform(make_tuple(&ByConstRef)));
+ EXPECT_TRUE(a.Perform(std::make_tuple(&ByConstRef)));
}
// Tests using InvokeArgument with ByRef() and a function that takes a
@@ -272,18 +268,18 @@ TEST(InvokeArgumentTest, ByExplicitConstReferenceFunction) {
Action<bool(bool(*)(const double& x))> a = // NOLINT
InvokeArgument<0>(ByRef(g_double));
// The above line calls ByRef() on a const value.
- EXPECT_TRUE(a.Perform(make_tuple(&ReferencesGlobalDouble)));
+ EXPECT_TRUE(a.Perform(std::make_tuple(&ReferencesGlobalDouble)));
double x = 0;
a = InvokeArgument<0>(ByRef(x)); // This calls ByRef() on a non-const.
- EXPECT_FALSE(a.Perform(make_tuple(&ReferencesGlobalDouble)));
+ EXPECT_FALSE(a.Perform(std::make_tuple(&ReferencesGlobalDouble)));
}
// Tests using WithArgs and with an action that takes 1 argument.
TEST(WithArgsTest, OneArg) {
Action<bool(double x, int n)> a = WithArgs<1>(Invoke(Unary)); // NOLINT
- EXPECT_TRUE(a.Perform(make_tuple(1.5, -1)));
- EXPECT_FALSE(a.Perform(make_tuple(1.5, 1)));
+ EXPECT_TRUE(a.Perform(std::make_tuple(1.5, -1)));
+ EXPECT_FALSE(a.Perform(std::make_tuple(1.5, 1)));
}
// Tests using WithArgs with an action that takes 2 arguments.
@@ -291,14 +287,14 @@ TEST(WithArgsTest, TwoArgs) {
Action<const char*(const char* s, double x, short n)> a =
WithArgs<0, 2>(Invoke(Binary));
const char s[] = "Hello";
- EXPECT_EQ(s + 2, a.Perform(make_tuple(CharPtr(s), 0.5, Short(2))));
+ EXPECT_EQ(s + 2, a.Perform(std::make_tuple(CharPtr(s), 0.5, Short(2))));
}
// Tests using WithArgs with an action that takes 3 arguments.
TEST(WithArgsTest, ThreeArgs) {
Action<int(int, double, char, short)> a = // NOLINT
WithArgs<0, 2, 3>(Invoke(Ternary));
- EXPECT_EQ(123, a.Perform(make_tuple(100, 6.5, Char(20), Short(3))));
+ EXPECT_EQ(123, a.Perform(std::make_tuple(100, 6.5, Char(20), Short(3))));
}
// Tests using WithArgs with an action that takes 4 arguments.
@@ -306,8 +302,8 @@ TEST(WithArgsTest, FourArgs) {
Action<std::string(const char*, const char*, double, const char*,
const char*)>
a = WithArgs<4, 3, 1, 0>(Invoke(Concat4));
- EXPECT_EQ("4310", a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), 2.5,
- CharPtr("3"), CharPtr("4"))));
+ EXPECT_EQ("4310", a.Perform(std::make_tuple(CharPtr("0"), CharPtr("1"), 2.5,
+ CharPtr("3"), CharPtr("4"))));
}
// Tests using WithArgs with an action that takes 5 arguments.
@@ -316,34 +312,32 @@ TEST(WithArgsTest, FiveArgs) {
const char*)>
a = WithArgs<4, 3, 2, 1, 0>(Invoke(Concat5));
EXPECT_EQ("43210",
- a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"),
- CharPtr("3"), CharPtr("4"))));
+ a.Perform(std::make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"),
+ CharPtr("3"), CharPtr("4"))));
}
// Tests using WithArgs with an action that takes 6 arguments.
TEST(WithArgsTest, SixArgs) {
Action<std::string(const char*, const char*, const char*)> a =
WithArgs<0, 1, 2, 2, 1, 0>(Invoke(Concat6));
- EXPECT_EQ("012210",
- a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"))));
+ EXPECT_EQ("012210", a.Perform(std::make_tuple(CharPtr("0"), CharPtr("1"),
+ CharPtr("2"))));
}
// Tests using WithArgs with an action that takes 7 arguments.
TEST(WithArgsTest, SevenArgs) {
Action<std::string(const char*, const char*, const char*, const char*)> a =
WithArgs<0, 1, 2, 3, 2, 1, 0>(Invoke(Concat7));
- EXPECT_EQ("0123210",
- a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"),
- CharPtr("3"))));
+ EXPECT_EQ("0123210", a.Perform(std::make_tuple(CharPtr("0"), CharPtr("1"),
+ CharPtr("2"), CharPtr("3"))));
}
// Tests using WithArgs with an action that takes 8 arguments.
TEST(WithArgsTest, EightArgs) {
Action<std::string(const char*, const char*, const char*, const char*)> a =
WithArgs<0, 1, 2, 3, 0, 1, 2, 3>(Invoke(Concat8));
- EXPECT_EQ("01230123",
- a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"),
- CharPtr("3"))));
+ EXPECT_EQ("01230123", a.Perform(std::make_tuple(CharPtr("0"), CharPtr("1"),
+ CharPtr("2"), CharPtr("3"))));
}
// Tests using WithArgs with an action that takes 9 arguments.
@@ -351,8 +345,8 @@ TEST(WithArgsTest, NineArgs) {
Action<std::string(const char*, const char*, const char*, const char*)> a =
WithArgs<0, 1, 2, 3, 1, 2, 3, 2, 3>(Invoke(Concat9));
EXPECT_EQ("012312323",
- a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"),
- CharPtr("3"))));
+ a.Perform(std::make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"),
+ CharPtr("3"))));
}
// Tests using WithArgs with an action that takes 10 arguments.
@@ -360,22 +354,23 @@ TEST(WithArgsTest, TenArgs) {
Action<std::string(const char*, const char*, const char*, const char*)> a =
WithArgs<0, 1, 2, 3, 2, 1, 0, 1, 2, 3>(Invoke(Concat10));
EXPECT_EQ("0123210123",
- a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"),
- CharPtr("3"))));
+ a.Perform(std::make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"),
+ CharPtr("3"))));
}
// Tests using WithArgs with an action that is not Invoke().
class SubstractAction : public ActionInterface<int(int, int)> { // NOLINT
public:
- virtual int Perform(const tuple<int, int>& args) {
- return get<0>(args) - get<1>(args);
+ virtual int Perform(const std::tuple<int, int>& args) {
+ return std::get<0>(args) - std::get<1>(args);
}
};
TEST(WithArgsTest, NonInvokeAction) {
Action<int(const std::string&, int, int)> a = // NOLINT
WithArgs<2, 1>(MakeAction(new SubstractAction));
- tuple<std::string, int, int> dummy = make_tuple(std::string("hi"), 2, 10);
+ std::tuple<std::string, int, int> dummy =
+ std::make_tuple(std::string("hi"), 2, 10);
EXPECT_EQ(8, a.Perform(dummy));
}
@@ -383,14 +378,14 @@ TEST(WithArgsTest, NonInvokeAction) {
TEST(WithArgsTest, Identity) {
Action<int(int x, char y, short z)> a = // NOLINT
WithArgs<0, 1, 2>(Invoke(Ternary));
- EXPECT_EQ(123, a.Perform(make_tuple(100, Char(20), Short(3))));
+ EXPECT_EQ(123, a.Perform(std::make_tuple(100, Char(20), Short(3))));
}
// Tests using WithArgs with repeated arguments.
TEST(WithArgsTest, RepeatedArguments) {
Action<int(bool, int m, int n)> a = // NOLINT
WithArgs<1, 1, 1, 1>(Invoke(SumOf4));
- EXPECT_EQ(4, a.Perform(make_tuple(false, 1, 10)));
+ EXPECT_EQ(4, a.Perform(std::make_tuple(false, 1, 10)));
}
// Tests using WithArgs with reversed argument order.
@@ -398,21 +393,22 @@ TEST(WithArgsTest, ReversedArgumentOrder) {
Action<const char*(short n, const char* input)> a = // NOLINT
WithArgs<1, 0>(Invoke(Binary));
const char s[] = "Hello";
- EXPECT_EQ(s + 2, a.Perform(make_tuple(Short(2), CharPtr(s))));
+ EXPECT_EQ(s + 2, a.Perform(std::make_tuple(Short(2), CharPtr(s))));
}
// Tests using WithArgs with compatible, but not identical, argument types.
TEST(WithArgsTest, ArgsOfCompatibleTypes) {
Action<long(short x, char y, double z, char c)> a = // NOLINT
WithArgs<0, 1, 3>(Invoke(Ternary));
- EXPECT_EQ(123, a.Perform(make_tuple(Short(100), Char(20), 5.6, Char(3))));
+ EXPECT_EQ(123,
+ a.Perform(std::make_tuple(Short(100), Char(20), 5.6, Char(3))));
}
// Tests using WithArgs with an action that returns void.
TEST(WithArgsTest, VoidAction) {
Action<void(double x, char c, int n)> a = WithArgs<2, 1>(Invoke(VoidBinary));
g_done = false;
- a.Perform(make_tuple(1.5, 'a', 3));
+ a.Perform(std::make_tuple(1.5, 'a', 3));
EXPECT_TRUE(g_done);
}
@@ -421,7 +417,7 @@ TEST(DoAllTest, TwoActions) {
int n = 0;
Action<int(int*)> a = DoAll(SetArgPointee<0>(1), // NOLINT
Return(2));
- EXPECT_EQ(2, a.Perform(make_tuple(&n)));
+ EXPECT_EQ(2, a.Perform(std::make_tuple(&n)));
EXPECT_EQ(1, n);
}
@@ -431,7 +427,7 @@ TEST(DoAllTest, ThreeActions) {
Action<int(int*, int*)> a = DoAll(SetArgPointee<0>(1), // NOLINT
SetArgPointee<1>(2),
Return(3));
- EXPECT_EQ(3, a.Perform(make_tuple(&m, &n)));
+ EXPECT_EQ(3, a.Perform(std::make_tuple(&m, &n)));
EXPECT_EQ(1, m);
EXPECT_EQ(2, n);
}
@@ -445,7 +441,7 @@ TEST(DoAllTest, FourActions) {
SetArgPointee<1>(2),
SetArgPointee<2>('a'),
Return(3));
- EXPECT_EQ(3, a.Perform(make_tuple(&m, &n, &ch)));
+ EXPECT_EQ(3, a.Perform(std::make_tuple(&m, &n, &ch)));
EXPECT_EQ(1, m);
EXPECT_EQ(2, n);
EXPECT_EQ('a', ch);
@@ -461,7 +457,7 @@ TEST(DoAllTest, FiveActions) {
SetArgPointee<2>('a'),
SetArgPointee<3>('b'),
Return(3));
- EXPECT_EQ(3, action.Perform(make_tuple(&m, &n, &a, &b)));
+ EXPECT_EQ(3, action.Perform(std::make_tuple(&m, &n, &a, &b)));
EXPECT_EQ(1, m);
EXPECT_EQ(2, n);
EXPECT_EQ('a', a);
@@ -479,7 +475,7 @@ TEST(DoAllTest, SixActions) {
SetArgPointee<3>('b'),
SetArgPointee<4>('c'),
Return(3));
- EXPECT_EQ(3, action.Perform(make_tuple(&m, &n, &a, &b, &c)));
+ EXPECT_EQ(3, action.Perform(std::make_tuple(&m, &n, &a, &b, &c)));
EXPECT_EQ(1, m);
EXPECT_EQ(2, n);
EXPECT_EQ('a', a);
@@ -499,7 +495,7 @@ TEST(DoAllTest, SevenActions) {
SetArgPointee<4>('c'),
SetArgPointee<5>('d'),
Return(3));
- EXPECT_EQ(3, action.Perform(make_tuple(&m, &n, &a, &b, &c, &d)));
+ EXPECT_EQ(3, action.Perform(std::make_tuple(&m, &n, &a, &b, &c, &d)));
EXPECT_EQ(1, m);
EXPECT_EQ(2, n);
EXPECT_EQ('a', a);
@@ -522,7 +518,7 @@ TEST(DoAllTest, EightActions) {
SetArgPointee<5>('d'),
SetArgPointee<6>('e'),
Return(3));
- EXPECT_EQ(3, action.Perform(make_tuple(&m, &n, &a, &b, &c, &d, &e)));
+ EXPECT_EQ(3, action.Perform(std::make_tuple(&m, &n, &a, &b, &c, &d, &e)));
EXPECT_EQ(1, m);
EXPECT_EQ(2, n);
EXPECT_EQ('a', a);
@@ -547,7 +543,7 @@ TEST(DoAllTest, NineActions) {
SetArgPointee<6>('e'),
SetArgPointee<7>('f'),
Return(3));
- EXPECT_EQ(3, action.Perform(make_tuple(&m, &n, &a, &b, &c, &d, &e, &f)));
+ EXPECT_EQ(3, action.Perform(std::make_tuple(&m, &n, &a, &b, &c, &d, &e, &f)));
EXPECT_EQ(1, m);
EXPECT_EQ(2, n);
EXPECT_EQ('a', a);
@@ -575,7 +571,8 @@ TEST(DoAllTest, TenActions) {
SetArgPointee<7>('f'),
SetArgPointee<8>('g'),
Return(3));
- EXPECT_EQ(3, action.Perform(make_tuple(&m, &n, &a, &b, &c, &d, &e, &f, &g)));
+ EXPECT_EQ(
+ 3, action.Perform(std::make_tuple(&m, &n, &a, &b, &c, &d, &e, &f, &g)));
EXPECT_EQ(1, m);
EXPECT_EQ(2, n);
EXPECT_EQ('a', a);
@@ -605,10 +602,10 @@ ACTION(Return5) { return 5; }
TEST(ActionMacroTest, WorksWhenNotReferencingArguments) {
Action<double()> a1 = Return5();
- EXPECT_DOUBLE_EQ(5, a1.Perform(make_tuple()));
+ EXPECT_DOUBLE_EQ(5, a1.Perform(std::make_tuple()));
Action<int(double, bool)> a2 = Return5();
- EXPECT_EQ(5, a2.Perform(make_tuple(1, true)));
+ EXPECT_EQ(5, a2.Perform(std::make_tuple(1, true)));
}
// Tests that ACTION() can define an action that returns void.
@@ -617,7 +614,7 @@ ACTION(IncrementArg1) { (*arg1)++; }
TEST(ActionMacroTest, WorksWhenReturningVoid) {
Action<void(int, int*)> a1 = IncrementArg1();
int n = 0;
- a1.Perform(make_tuple(5, &n));
+ a1.Perform(std::make_tuple(5, &n));
EXPECT_EQ(1, n);
}
@@ -632,22 +629,22 @@ ACTION(IncrementArg2) {
TEST(ActionMacroTest, CanReferenceArgumentType) {
Action<void(int, bool, int*)> a1 = IncrementArg2();
int n = 0;
- a1.Perform(make_tuple(5, false, &n));
+ a1.Perform(std::make_tuple(5, false, &n));
EXPECT_EQ(1, n);
}
// Tests that the body of ACTION() can reference the argument tuple
// via args_type and args.
ACTION(Sum2) {
- StaticAssertTypeEq<tuple<int, char, int*>, args_type>();
+ StaticAssertTypeEq<std::tuple<int, char, int*>, args_type>();
args_type args_copy = args;
- return get<0>(args_copy) + get<1>(args_copy);
+ return std::get<0>(args_copy) + std::get<1>(args_copy);
}
TEST(ActionMacroTest, CanReferenceArgumentTuple) {
Action<int(int, char, int*)> a1 = Sum2();
int dummy = 0;
- EXPECT_EQ(11, a1.Perform(make_tuple(5, Char(6), &dummy)));
+ EXPECT_EQ(11, a1.Perform(std::make_tuple(5, Char(6), &dummy)));
}
// Tests that the body of ACTION() can reference the mock function
@@ -662,8 +659,8 @@ ACTION(InvokeDummy) {
TEST(ActionMacroTest, CanReferenceMockFunctionType) {
Action<int(bool)> a1 = InvokeDummy();
- EXPECT_EQ(1, a1.Perform(make_tuple(true)));
- EXPECT_EQ(1, a1.Perform(make_tuple(false)));
+ EXPECT_EQ(1, a1.Perform(std::make_tuple(true)));
+ EXPECT_EQ(1, a1.Perform(std::make_tuple(false)));
}
// Tests that the body of ACTION() can reference the mock function's
@@ -676,8 +673,8 @@ ACTION(InvokeDummy2) {
TEST(ActionMacroTest, CanReferenceMockFunctionReturnType) {
Action<int(bool)> a1 = InvokeDummy2();
- EXPECT_EQ(1, a1.Perform(make_tuple(true)));
- EXPECT_EQ(1, a1.Perform(make_tuple(false)));
+ EXPECT_EQ(1, a1.Perform(std::make_tuple(true)));
+ EXPECT_EQ(1, a1.Perform(std::make_tuple(false)));
}
// Tests that ACTION() works for arguments passed by const reference.
@@ -689,7 +686,7 @@ ACTION(ReturnAddrOfConstBoolReferenceArg) {
TEST(ActionMacroTest, WorksForConstReferenceArg) {
Action<const bool*(int, const bool&)> a = ReturnAddrOfConstBoolReferenceArg();
const bool b = false;
- EXPECT_EQ(&b, a.Perform(tuple<int, const bool&>(0, b)));
+ EXPECT_EQ(&b, a.Perform(std::tuple<int, const bool&>(0, b)));
}
// Tests that ACTION() works for arguments passed by non-const reference.
@@ -701,7 +698,7 @@ ACTION(ReturnAddrOfIntReferenceArg) {
TEST(ActionMacroTest, WorksForNonConstReferenceArg) {
Action<int*(int&, bool, int)> a = ReturnAddrOfIntReferenceArg();
int n = 0;
- EXPECT_EQ(&n, a.Perform(tuple<int&, bool, int>(n, true, 1)));
+ EXPECT_EQ(&n, a.Perform(std::tuple<int&, bool, int>(n, true, 1)));
}
// Tests that ACTION() can be used in a namespace.
@@ -711,7 +708,7 @@ ACTION(Sum) { return arg0 + arg1; }
TEST(ActionMacroTest, WorksInNamespace) {
Action<int(int, int)> a1 = action_test::Sum();
- EXPECT_EQ(3, a1.Perform(make_tuple(1, 2)));
+ EXPECT_EQ(3, a1.Perform(std::make_tuple(1, 2)));
}
// Tests that the same ACTION definition works for mock functions with
@@ -720,11 +717,11 @@ ACTION(PlusTwo) { return arg0 + 2; }
TEST(ActionMacroTest, WorksForDifferentArgumentNumbers) {
Action<int(int)> a1 = PlusTwo();
- EXPECT_EQ(4, a1.Perform(make_tuple(2)));
+ EXPECT_EQ(4, a1.Perform(std::make_tuple(2)));
Action<double(float, void*)> a2 = PlusTwo();
int dummy;
- EXPECT_DOUBLE_EQ(6, a2.Perform(make_tuple(4.0f, &dummy)));
+ EXPECT_DOUBLE_EQ(6, a2.Perform(std::make_tuple(4.0f, &dummy)));
}
// Tests that ACTION_P can define a parameterized action.
@@ -732,7 +729,7 @@ ACTION_P(Plus, n) { return arg0 + n; }
TEST(ActionPMacroTest, DefinesParameterizedAction) {
Action<int(int m, bool t)> a1 = Plus(9);
- EXPECT_EQ(10, a1.Perform(make_tuple(1, true)));
+ EXPECT_EQ(10, a1.Perform(std::make_tuple(1, true)));
}
// Tests that the body of ACTION_P can reference the argument types
@@ -745,7 +742,7 @@ ACTION_P(TypedPlus, n) {
TEST(ActionPMacroTest, CanReferenceArgumentAndParameterTypes) {
Action<int(char m, bool t)> a1 = TypedPlus(9);
- EXPECT_EQ(10, a1.Perform(make_tuple(Char(1), true)));
+ EXPECT_EQ(10, a1.Perform(std::make_tuple(Char(1), true)));
}
// Tests that a parameterized action can be used in any mock function
@@ -753,7 +750,7 @@ TEST(ActionPMacroTest, CanReferenceArgumentAndParameterTypes) {
TEST(ActionPMacroTest, WorksInCompatibleMockFunction) {
Action<std::string(const std::string& s)> a1 = Plus("tail");
const std::string re = "re";
- tuple<const std::string> dummy = make_tuple(re);
+ std::tuple<const std::string> dummy = std::make_tuple(re);
EXPECT_EQ("retail", a1.Perform(dummy));
}
@@ -774,16 +771,16 @@ TEST(ActionMacroTest, CanDefineOverloadedActions) {
typedef Action<const char*(bool, const char*)> MyAction;
const MyAction a1 = OverloadedAction();
- EXPECT_STREQ("hello", a1.Perform(make_tuple(false, CharPtr("world"))));
- EXPECT_STREQ("world", a1.Perform(make_tuple(true, CharPtr("world"))));
+ EXPECT_STREQ("hello", a1.Perform(std::make_tuple(false, CharPtr("world"))));
+ EXPECT_STREQ("world", a1.Perform(std::make_tuple(true, CharPtr("world"))));
const MyAction a2 = OverloadedAction("hi");
- EXPECT_STREQ("hi", a2.Perform(make_tuple(false, CharPtr("world"))));
- EXPECT_STREQ("world", a2.Perform(make_tuple(true, CharPtr("world"))));
+ EXPECT_STREQ("hi", a2.Perform(std::make_tuple(false, CharPtr("world"))));
+ EXPECT_STREQ("world", a2.Perform(std::make_tuple(true, CharPtr("world"))));
const MyAction a3 = OverloadedAction("hi", "you");
- EXPECT_STREQ("hi", a3.Perform(make_tuple(true, CharPtr("world"))));
- EXPECT_STREQ("you", a3.Perform(make_tuple(false, CharPtr("world"))));
+ EXPECT_STREQ("hi", a3.Perform(std::make_tuple(true, CharPtr("world"))));
+ EXPECT_STREQ("you", a3.Perform(std::make_tuple(false, CharPtr("world"))));
}
// Tests ACTION_Pn where n >= 3.
@@ -792,11 +789,11 @@ ACTION_P3(Plus, m, n, k) { return arg0 + m + n + k; }
TEST(ActionPnMacroTest, WorksFor3Parameters) {
Action<double(int m, bool t)> a1 = Plus(100, 20, 3.4);
- EXPECT_DOUBLE_EQ(3123.4, a1.Perform(make_tuple(3000, true)));
+ EXPECT_DOUBLE_EQ(3123.4, a1.Perform(std::make_tuple(3000, true)));
Action<std::string(const std::string& s)> a2 = Plus("tail", "-", ">");
const std::string re = "re";
- tuple<const std::string> dummy = make_tuple(re);
+ std::tuple<const std::string> dummy = std::make_tuple(re);
EXPECT_EQ("retail->", a2.Perform(dummy));
}
@@ -804,14 +801,14 @@ ACTION_P4(Plus, p0, p1, p2, p3) { return arg0 + p0 + p1 + p2 + p3; }
TEST(ActionPnMacroTest, WorksFor4Parameters) {
Action<int(int)> a1 = Plus(1, 2, 3, 4);
- EXPECT_EQ(10 + 1 + 2 + 3 + 4, a1.Perform(make_tuple(10)));
+ EXPECT_EQ(10 + 1 + 2 + 3 + 4, a1.Perform(std::make_tuple(10)));
}
ACTION_P5(Plus, p0, p1, p2, p3, p4) { return arg0 + p0 + p1 + p2 + p3 + p4; }
TEST(ActionPnMacroTest, WorksFor5Parameters) {
Action<int(int)> a1 = Plus(1, 2, 3, 4, 5);
- EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5, a1.Perform(make_tuple(10)));
+ EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5, a1.Perform(std::make_tuple(10)));
}
ACTION_P6(Plus, p0, p1, p2, p3, p4, p5) {
@@ -820,7 +817,7 @@ ACTION_P6(Plus, p0, p1, p2, p3, p4, p5) {
TEST(ActionPnMacroTest, WorksFor6Parameters) {
Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6);
- EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5 + 6, a1.Perform(make_tuple(10)));
+ EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5 + 6, a1.Perform(std::make_tuple(10)));
}
ACTION_P7(Plus, p0, p1, p2, p3, p4, p5, p6) {
@@ -829,7 +826,7 @@ ACTION_P7(Plus, p0, p1, p2, p3, p4, p5, p6) {
TEST(ActionPnMacroTest, WorksFor7Parameters) {
Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7);
- EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5 + 6 + 7, a1.Perform(make_tuple(10)));
+ EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5 + 6 + 7, a1.Perform(std::make_tuple(10)));
}
ACTION_P8(Plus, p0, p1, p2, p3, p4, p5, p6, p7) {
@@ -838,7 +835,8 @@ ACTION_P8(Plus, p0, p1, p2, p3, p4, p5, p6, p7) {
TEST(ActionPnMacroTest, WorksFor8Parameters) {
Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7, 8);
- EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8, a1.Perform(make_tuple(10)));
+ EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8,
+ a1.Perform(std::make_tuple(10)));
}
ACTION_P9(Plus, p0, p1, p2, p3, p4, p5, p6, p7, p8) {
@@ -847,7 +845,8 @@ ACTION_P9(Plus, p0, p1, p2, p3, p4, p5, p6, p7, p8) {
TEST(ActionPnMacroTest, WorksFor9Parameters) {
Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7, 8, 9);
- EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9, a1.Perform(make_tuple(10)));
+ EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9,
+ a1.Perform(std::make_tuple(10)));
}
ACTION_P10(Plus, p0, p1, p2, p3, p4, p5, p6, p7, p8, last_param) {
@@ -859,7 +858,7 @@ ACTION_P10(Plus, p0, p1, p2, p3, p4, p5, p6, p7, p8, last_param) {
TEST(ActionPnMacroTest, WorksFor10Parameters) {
Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10,
- a1.Perform(make_tuple(10)));
+ a1.Perform(std::make_tuple(10)));
}
// Tests that the action body can promote the parameter types.
@@ -876,8 +875,8 @@ TEST(ActionPnMacroTest, SimpleTypePromotion) {
PadArgument(std::string("foo"), 'r');
Action<std::string(const char*)> promo =
PadArgument("foo", static_cast<int>('r'));
- EXPECT_EQ("foobar", no_promo.Perform(make_tuple(CharPtr("ba"))));
- EXPECT_EQ("foobar", promo.Perform(make_tuple(CharPtr("ba"))));
+ EXPECT_EQ("foobar", no_promo.Perform(std::make_tuple(CharPtr("ba"))));
+ EXPECT_EQ("foobar", promo.Perform(std::make_tuple(CharPtr("ba"))));
}
// Tests that we can partially restrict parameter types using a
@@ -926,10 +925,10 @@ Concat(T1 a, int b, T2 c) {
TEST(ActionPnMacroTest, CanPartiallyRestrictParameterTypes) {
Action<const std::string()> a1 = Concat("Hello", "1", 2);
- EXPECT_EQ("Hello12", a1.Perform(make_tuple()));
+ EXPECT_EQ("Hello12", a1.Perform(std::make_tuple()));
a1 = Concat(1, 2, 3);
- EXPECT_EQ("123", a1.Perform(make_tuple()));
+ EXPECT_EQ("123", a1.Perform(std::make_tuple()));
}
// Verifies the type of an ACTION*.
@@ -987,7 +986,7 @@ ACTION_P10(Plus10, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) {
TEST(ActionPnMacroTest, CanExplicitlyInstantiateWithReferenceTypes) {
int x = 1, y = 2, z = 3;
- const tuple<> empty = make_tuple();
+ const std::tuple<> empty = std::make_tuple();
Action<int()> a = Plus1<int&>(x);
EXPECT_EQ(1, a.Perform(empty));
@@ -1014,7 +1013,7 @@ class NullaryConstructorClass {
// Tests using ReturnNew() with a nullary constructor.
TEST(ReturnNewTest, NoArgs) {
Action<NullaryConstructorClass*()> a = ReturnNew<NullaryConstructorClass>();
- NullaryConstructorClass* c = a.Perform(make_tuple());
+ NullaryConstructorClass* c = a.Perform(std::make_tuple());
EXPECT_EQ(123, c->value_);
delete c;
}
@@ -1028,7 +1027,7 @@ class UnaryConstructorClass {
// Tests using ReturnNew() with a unary constructor.
TEST(ReturnNewTest, Unary) {
Action<UnaryConstructorClass*()> a = ReturnNew<UnaryConstructorClass>(4000);
- UnaryConstructorClass* c = a.Perform(make_tuple());
+ UnaryConstructorClass* c = a.Perform(std::make_tuple());
EXPECT_EQ(4000, c->value_);
delete c;
}
@@ -1036,7 +1035,7 @@ TEST(ReturnNewTest, Unary) {
TEST(ReturnNewTest, UnaryWorksWhenMockMethodHasArgs) {
Action<UnaryConstructorClass*(bool, int)> a =
ReturnNew<UnaryConstructorClass>(4000);
- UnaryConstructorClass* c = a.Perform(make_tuple(false, 5));
+ UnaryConstructorClass* c = a.Perform(std::make_tuple(false, 5));
EXPECT_EQ(4000, c->value_);
delete c;
}
@@ -1044,7 +1043,7 @@ TEST(ReturnNewTest, UnaryWorksWhenMockMethodHasArgs) {
TEST(ReturnNewTest, UnaryWorksWhenMockMethodReturnsPointerToConst) {
Action<const UnaryConstructorClass*()> a =
ReturnNew<UnaryConstructorClass>(4000);
- const UnaryConstructorClass* c = a.Perform(make_tuple());
+ const UnaryConstructorClass* c = a.Perform(std::make_tuple());
EXPECT_EQ(4000, c->value_);
delete c;
}
@@ -1064,7 +1063,7 @@ TEST(ReturnNewTest, ConstructorThatTakes10Arguments) {
ReturnNew<TenArgConstructorClass>(1000000000, 200000000, 30000000,
4000000, 500000, 60000,
7000, 800, 90, 0);
- TenArgConstructorClass* c = a.Perform(make_tuple());
+ TenArgConstructorClass* c = a.Perform(std::make_tuple());
EXPECT_EQ(1234567890, c->value_);
delete c;
}
@@ -1078,7 +1077,7 @@ ACTION_TEMPLATE(CreateNew,
TEST(ActionTemplateTest, WorksWithoutValueParam) {
const Action<int*()> a = CreateNew<int>();
- int* p = a.Perform(make_tuple());
+ int* p = a.Perform(std::make_tuple());
delete p;
}
@@ -1091,7 +1090,7 @@ ACTION_TEMPLATE(CreateNew,
TEST(ActionTemplateTest, WorksWithValueParams) {
const Action<int*()> a = CreateNew<int>(42);
- int* p = a.Perform(make_tuple());
+ int* p = a.Perform(std::make_tuple());
EXPECT_EQ(42, *p);
delete p;
}
@@ -1100,7 +1099,7 @@ TEST(ActionTemplateTest, WorksWithValueParams) {
ACTION_TEMPLATE(MyDeleteArg,
HAS_1_TEMPLATE_PARAMS(int, k),
AND_0_VALUE_PARAMS()) {
- delete get<k>(args);
+ delete std::get<k>(args);
}
// Resets a bool variable in the destructor.
@@ -1117,7 +1116,7 @@ TEST(ActionTemplateTest, WorksForIntegralTemplateParams) {
int n = 0;
bool b = true;
BoolResetter* resetter = new BoolResetter(&b);
- a.Perform(make_tuple(&n, resetter));
+ a.Perform(std::make_tuple(&n, resetter));
EXPECT_FALSE(b); // Verifies that resetter is deleted.
}
@@ -1132,7 +1131,7 @@ ACTION_TEMPLATE(ReturnSmartPointer,
TEST(ActionTemplateTest, WorksForTemplateTemplateParameters) {
using ::testing::internal::linked_ptr;
const Action<linked_ptr<int>()> a = ReturnSmartPointer<linked_ptr>(42);
- linked_ptr<int> p = a.Perform(make_tuple());
+ linked_ptr<int> p = a.Perform(std::make_tuple());
EXPECT_EQ(42, *p);
}
@@ -1167,7 +1166,7 @@ TEST(ActionTemplateTest, WorksFor10TemplateParameters) {
true, 6, char, unsigned, int> Giant;
const Action<Giant()> a = ReturnGiant<
int, bool, double, 5, true, 6, char, unsigned, int, linked_ptr>(42);
- Giant giant = a.Perform(make_tuple());
+ Giant giant = a.Perform(std::make_tuple());
EXPECT_EQ(42, giant.value);
}
@@ -1180,7 +1179,7 @@ ACTION_TEMPLATE(ReturnSum,
TEST(ActionTemplateTest, WorksFor10ValueParameters) {
const Action<int()> a = ReturnSum<int>(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
- EXPECT_EQ(55, a.Perform(make_tuple()));
+ EXPECT_EQ(55, a.Perform(std::make_tuple()));
}
// Tests that ACTION_TEMPLATE and ACTION/ACTION_P* can be overloaded
@@ -1214,11 +1213,11 @@ TEST(ActionTemplateTest, CanBeOverloadedOnNumberOfValueParameters) {
const Action<int()> a2 = ReturnSum<int>(1, 2);
const Action<int()> a3 = ReturnSum<int>(1, 2, 3);
const Action<int()> a4 = ReturnSum<int, 10000>(2000, 300, 40, 5);
- EXPECT_EQ(0, a0.Perform(make_tuple()));
- EXPECT_EQ(1, a1.Perform(make_tuple()));
- EXPECT_EQ(3, a2.Perform(make_tuple()));
- EXPECT_EQ(6, a3.Perform(make_tuple()));
- EXPECT_EQ(12345, a4.Perform(make_tuple()));
+ EXPECT_EQ(0, a0.Perform(std::make_tuple()));
+ EXPECT_EQ(1, a1.Perform(std::make_tuple()));
+ EXPECT_EQ(3, a2.Perform(std::make_tuple()));
+ EXPECT_EQ(6, a3.Perform(std::make_tuple()));
+ EXPECT_EQ(12345, a4.Perform(std::make_tuple()));
}
#ifdef _MSC_VER
diff --git a/googlemock/test/gmock-generated-internal-utils_test.cc b/googlemock/test/gmock-generated-internal-utils_test.cc
index ae0280fc..965cbaa6 100644
--- a/googlemock/test/gmock-generated-internal-utils_test.cc
+++ b/googlemock/test/gmock-generated-internal-utils_test.cc
@@ -38,7 +38,6 @@
namespace {
-using ::testing::tuple;
using ::testing::Matcher;
using ::testing::internal::CompileAssertTypesEqual;
using ::testing::internal::MatcherTuple;
@@ -48,24 +47,24 @@ using ::testing::internal::IgnoredValue;
// Tests the MatcherTuple template struct.
TEST(MatcherTupleTest, ForSize0) {
- CompileAssertTypesEqual<tuple<>, MatcherTuple<tuple<> >::type>();
+ CompileAssertTypesEqual<std::tuple<>, MatcherTuple<std::tuple<> >::type>();
}
TEST(MatcherTupleTest, ForSize1) {
- CompileAssertTypesEqual<tuple<Matcher<int> >,
- MatcherTuple<tuple<int> >::type>();
+ CompileAssertTypesEqual<std::tuple<Matcher<int> >,
+ MatcherTuple<std::tuple<int> >::type>();
}
TEST(MatcherTupleTest, ForSize2) {
- CompileAssertTypesEqual<tuple<Matcher<int>, Matcher<char> >,
- MatcherTuple<tuple<int, char> >::type>();
+ CompileAssertTypesEqual<std::tuple<Matcher<int>, Matcher<char> >,
+ MatcherTuple<std::tuple<int, char> >::type>();
}
TEST(MatcherTupleTest, ForSize5) {
CompileAssertTypesEqual<
- tuple<Matcher<int>, Matcher<char>, Matcher<bool>, Matcher<double>,
- Matcher<char*> >,
- MatcherTuple<tuple<int, char, bool, double, char*> >::type>();
+ std::tuple<Matcher<int>, Matcher<char>, Matcher<bool>, Matcher<double>,
+ Matcher<char*> >,
+ MatcherTuple<std::tuple<int, char, bool, double, char*> >::type>();
}
// Tests the Function template struct.
@@ -73,8 +72,8 @@ TEST(MatcherTupleTest, ForSize5) {
TEST(FunctionTest, Nullary) {
typedef Function<int()> F; // NOLINT
CompileAssertTypesEqual<int, F::Result>();
- CompileAssertTypesEqual<tuple<>, F::ArgumentTuple>();
- CompileAssertTypesEqual<tuple<>, F::ArgumentMatcherTuple>();
+ CompileAssertTypesEqual<std::tuple<>, F::ArgumentTuple>();
+ CompileAssertTypesEqual<std::tuple<>, F::ArgumentMatcherTuple>();
CompileAssertTypesEqual<void(), F::MakeResultVoid>();
CompileAssertTypesEqual<IgnoredValue(), F::MakeResultIgnoredValue>();
}
@@ -83,8 +82,9 @@ TEST(FunctionTest, Unary) {
typedef Function<int(bool)> F; // NOLINT
CompileAssertTypesEqual<int, F::Result>();
CompileAssertTypesEqual<bool, F::Argument1>();
- CompileAssertTypesEqual<tuple<bool>, F::ArgumentTuple>();
- CompileAssertTypesEqual<tuple<Matcher<bool> >, F::ArgumentMatcherTuple>();
+ CompileAssertTypesEqual<std::tuple<bool>, F::ArgumentTuple>();
+ CompileAssertTypesEqual<std::tuple<Matcher<bool> >,
+ F::ArgumentMatcherTuple>();
CompileAssertTypesEqual<void(bool), F::MakeResultVoid>(); // NOLINT
CompileAssertTypesEqual<IgnoredValue(bool), // NOLINT
F::MakeResultIgnoredValue>();
@@ -95,9 +95,10 @@ TEST(FunctionTest, Binary) {
CompileAssertTypesEqual<int, F::Result>();
CompileAssertTypesEqual<bool, F::Argument1>();
CompileAssertTypesEqual<const long&, F::Argument2>(); // NOLINT
- CompileAssertTypesEqual<tuple<bool, const long&>, F::ArgumentTuple>(); // NOLINT
+ CompileAssertTypesEqual<std::tuple<bool, const long&>, // NOLINT
+ F::ArgumentTuple>();
CompileAssertTypesEqual<
- tuple<Matcher<bool>, Matcher<const long&> >, // NOLINT
+ std::tuple<Matcher<bool>, Matcher<const long&> >, // NOLINT
F::ArgumentMatcherTuple>();
CompileAssertTypesEqual<void(bool, const long&), F::MakeResultVoid>(); // NOLINT
CompileAssertTypesEqual<IgnoredValue(bool, const long&), // NOLINT
@@ -112,11 +113,12 @@ TEST(FunctionTest, LongArgumentList) {
CompileAssertTypesEqual<char*, F::Argument3>();
CompileAssertTypesEqual<int&, F::Argument4>();
CompileAssertTypesEqual<const long&, F::Argument5>(); // NOLINT
- CompileAssertTypesEqual<tuple<bool, int, char*, int&, const long&>, // NOLINT
- F::ArgumentTuple>();
CompileAssertTypesEqual<
- tuple<Matcher<bool>, Matcher<int>, Matcher<char*>, Matcher<int&>,
- Matcher<const long&> >, // NOLINT
+ std::tuple<bool, int, char*, int&, const long&>, // NOLINT
+ F::ArgumentTuple>();
+ CompileAssertTypesEqual<
+ std::tuple<Matcher<bool>, Matcher<int>, Matcher<char*>, Matcher<int&>,
+ Matcher<const long&> >, // NOLINT
F::ArgumentMatcherTuple>();
CompileAssertTypesEqual<void(bool, int, char*, int&, const long&), // NOLINT
F::MakeResultVoid>();
diff --git a/googlemock/test/gmock-generated-matchers_test.cc b/googlemock/test/gmock-generated-matchers_test.cc
index 10a4ac39..fdbfb549 100644
--- a/googlemock/test/gmock-generated-matchers_test.cc
+++ b/googlemock/test/gmock-generated-matchers_test.cc
@@ -62,9 +62,6 @@ using std::pair;
using std::set;
using std::stringstream;
using std::vector;
-using testing::get;
-using testing::make_tuple;
-using testing::tuple;
using testing::_;
using testing::AllOf;
using testing::AnyOf;
@@ -118,20 +115,20 @@ std::string Explain(const MatcherType& m, const Value& x) {
// Tests Args<k0, ..., kn>(m).
TEST(ArgsTest, AcceptsZeroTemplateArg) {
- const tuple<int, bool> t(5, true);
- EXPECT_THAT(t, Args<>(Eq(tuple<>())));
- EXPECT_THAT(t, Not(Args<>(Ne(tuple<>()))));
+ const std::tuple<int, bool> t(5, true);
+ EXPECT_THAT(t, Args<>(Eq(std::tuple<>())));
+ EXPECT_THAT(t, Not(Args<>(Ne(std::tuple<>()))));
}
TEST(ArgsTest, AcceptsOneTemplateArg) {
- const tuple<int, bool> t(5, true);
- EXPECT_THAT(t, Args<0>(Eq(make_tuple(5))));
- EXPECT_THAT(t, Args<1>(Eq(make_tuple(true))));
- EXPECT_THAT(t, Not(Args<1>(Eq(make_tuple(false)))));
+ const std::tuple<int, bool> t(5, true);
+ EXPECT_THAT(t, Args<0>(Eq(std::make_tuple(5))));
+ EXPECT_THAT(t, Args<1>(Eq(std::make_tuple(true))));
+ EXPECT_THAT(t, Not(Args<1>(Eq(std::make_tuple(false)))));
}
TEST(ArgsTest, AcceptsTwoTemplateArgs) {
- const tuple<short, int, long> t(4, 5, 6L); // NOLINT
+ const std::tuple<short, int, long> t(4, 5, 6L); // NOLINT
EXPECT_THAT(t, (Args<0, 1>(Lt())));
EXPECT_THAT(t, (Args<1, 2>(Lt())));
@@ -139,13 +136,13 @@ TEST(ArgsTest, AcceptsTwoTemplateArgs) {
}
TEST(ArgsTest, AcceptsRepeatedTemplateArgs) {
- const tuple<short, int, long> t(4, 5, 6L); // NOLINT
+ const std::tuple<short, int, long> t(4, 5, 6L); // NOLINT
EXPECT_THAT(t, (Args<0, 0>(Eq())));
EXPECT_THAT(t, Not(Args<1, 1>(Ne())));
}
TEST(ArgsTest, AcceptsDecreasingTemplateArgs) {
- const tuple<short, int, long> t(4, 5, 6L); // NOLINT
+ const std::tuple<short, int, long> t(4, 5, 6L); // NOLINT
EXPECT_THAT(t, (Args<2, 0>(Gt())));
EXPECT_THAT(t, Not(Args<2, 1>(Lt())));
}
@@ -161,29 +158,29 @@ TEST(ArgsTest, AcceptsDecreasingTemplateArgs) {
#endif
MATCHER(SumIsZero, "") {
- return get<0>(arg) + get<1>(arg) + get<2>(arg) == 0;
+ return std::get<0>(arg) + std::get<1>(arg) + std::get<2>(arg) == 0;
}
TEST(ArgsTest, AcceptsMoreTemplateArgsThanArityOfOriginalTuple) {
- EXPECT_THAT(make_tuple(-1, 2), (Args<0, 0, 1>(SumIsZero())));
- EXPECT_THAT(make_tuple(1, 2), Not(Args<0, 0, 1>(SumIsZero())));
+ EXPECT_THAT(std::make_tuple(-1, 2), (Args<0, 0, 1>(SumIsZero())));
+ EXPECT_THAT(std::make_tuple(1, 2), Not(Args<0, 0, 1>(SumIsZero())));
}
TEST(ArgsTest, CanBeNested) {
- const tuple<short, int, long, int> t(4, 5, 6L, 6); // NOLINT
+ const std::tuple<short, int, long, int> t(4, 5, 6L, 6); // NOLINT
EXPECT_THAT(t, (Args<1, 2, 3>(Args<1, 2>(Eq()))));
EXPECT_THAT(t, (Args<0, 1, 3>(Args<0, 2>(Lt()))));
}
TEST(ArgsTest, CanMatchTupleByValue) {
- typedef tuple<char, int, int> Tuple3;
+ typedef std::tuple<char, int, int> Tuple3;
const Matcher<Tuple3> m = Args<1, 2>(Lt());
EXPECT_TRUE(m.Matches(Tuple3('a', 1, 2)));
EXPECT_FALSE(m.Matches(Tuple3('b', 2, 2)));
}
TEST(ArgsTest, CanMatchTupleByReference) {
- typedef tuple<char, char, int> Tuple3;
+ typedef std::tuple<char, char, int> Tuple3;
const Matcher<const Tuple3&> m = Args<0, 1>(Lt());
EXPECT_TRUE(m.Matches(Tuple3('a', 'b', 2)));
EXPECT_FALSE(m.Matches(Tuple3('b', 'b', 2)));
@@ -195,23 +192,23 @@ MATCHER_P(PrintsAs, str, "") {
}
TEST(ArgsTest, AcceptsTenTemplateArgs) {
- EXPECT_THAT(make_tuple(0, 1L, 2, 3L, 4, 5, 6, 7, 8, 9),
+ EXPECT_THAT(std::make_tuple(0, 1L, 2, 3L, 4, 5, 6, 7, 8, 9),
(Args<9, 8, 7, 6, 5, 4, 3, 2, 1, 0>(
PrintsAs("(9, 8, 7, 6, 5, 4, 3, 2, 1, 0)"))));
- EXPECT_THAT(make_tuple(0, 1L, 2, 3L, 4, 5, 6, 7, 8, 9),
+ EXPECT_THAT(std::make_tuple(0, 1L, 2, 3L, 4, 5, 6, 7, 8, 9),
Not(Args<9, 8, 7, 6, 5, 4, 3, 2, 1, 0>(
- PrintsAs("(0, 8, 7, 6, 5, 4, 3, 2, 1, 0)"))));
+ PrintsAs("(0, 8, 7, 6, 5, 4, 3, 2, 1, 0)"))));
}
TEST(ArgsTest, DescirbesSelfCorrectly) {
- const Matcher<tuple<int, bool, char> > m = Args<2, 0>(Lt());
+ const Matcher<std::tuple<int, bool, char> > m = Args<2, 0>(Lt());
EXPECT_EQ("are a tuple whose fields (#2, #0) are a pair where "
"the first < the second",
Describe(m));
}
TEST(ArgsTest, DescirbesNestedArgsCorrectly) {
- const Matcher<const tuple<int, bool, char, int>&> m =
+ const Matcher<const std::tuple<int, bool, char, int>&> m =
Args<0, 2, 3>(Args<2, 0>(Lt()));
EXPECT_EQ("are a tuple whose fields (#0, #2, #3) are a tuple "
"whose fields (#2, #0) are a pair where the first < the second",
@@ -219,28 +216,28 @@ TEST(ArgsTest, DescirbesNestedArgsCorrectly) {
}
TEST(ArgsTest, DescribesNegationCorrectly) {
- const Matcher<tuple<int, char> > m = Args<1, 0>(Gt());
+ const Matcher<std::tuple<int, char> > m = Args<1, 0>(Gt());
EXPECT_EQ("are a tuple whose fields (#1, #0) aren't a pair "
"where the first > the second",
DescribeNegation(m));
}
TEST(ArgsTest, ExplainsMatchResultWithoutInnerExplanation) {
- const Matcher<tuple<bool, int, int> > m = Args<1, 2>(Eq());
+ const Matcher<std::tuple<bool, int, int> > m = Args<1, 2>(Eq());
EXPECT_EQ("whose fields (#1, #2) are (42, 42)",
- Explain(m, make_tuple(false, 42, 42)));
+ Explain(m, std::make_tuple(false, 42, 42)));
EXPECT_EQ("whose fields (#1, #2) are (42, 43)",
- Explain(m, make_tuple(false, 42, 43)));
+ Explain(m, std::make_tuple(false, 42, 43)));
}
// For testing Args<>'s explanation.
-class LessThanMatcher : public MatcherInterface<tuple<char, int> > {
+class LessThanMatcher : public MatcherInterface<std::tuple<char, int> > {
public:
virtual void DescribeTo(::std::ostream* os) const {}
- virtual bool MatchAndExplain(tuple<char, int> value,
+ virtual bool MatchAndExplain(std::tuple<char, int> value,
MatchResultListener* listener) const {
- const int diff = get<0>(value) - get<1>(value);
+ const int diff = std::get<0>(value) - std::get<1>(value);
if (diff > 0) {
*listener << "where the first value is " << diff
<< " more than the second";
@@ -249,17 +246,18 @@ class LessThanMatcher : public MatcherInterface<tuple<char, int> > {
}
};
-Matcher<tuple<char, int> > LessThan() {
+Matcher<std::tuple<char, int> > LessThan() {
return MakeMatcher(new LessThanMatcher);
}
TEST(ArgsTest, ExplainsMatchResultWithInnerExplanation) {
- const Matcher<tuple<char, int, int> > m = Args<0, 2>(LessThan());
- EXPECT_EQ("whose fields (#0, #2) are ('a' (97, 0x61), 42), "
- "where the first value is 55 more than the second",
- Explain(m, make_tuple('a', 42, 42)));
+ const Matcher<std::tuple<char, int, int> > m = Args<0, 2>(LessThan());
+ EXPECT_EQ(
+ "whose fields (#0, #2) are ('a' (97, 0x61), 42), "
+ "where the first value is 55 more than the second",
+ Explain(m, std::make_tuple('a', 42, 42)));
EXPECT_EQ("whose fields (#0, #2) are ('\\0', 43)",
- Explain(m, make_tuple('\0', 42, 43)));
+ Explain(m, std::make_tuple('\0', 42, 43)));
}
// For testing ExplainMatchResultTo().
@@ -517,7 +515,7 @@ class NativeArrayPassedAsPointerAndSize {
TEST(ElementsAreTest, WorksWithNativeArrayPassedAsPointerAndSize) {
int array[] = { 0, 1 };
- ::testing::tuple<int*, size_t> array_as_tuple(array, 2);
+ ::std::tuple<int*, size_t> array_as_tuple(array, 2);
EXPECT_THAT(array_as_tuple, ElementsAre(0, 1));
EXPECT_THAT(array_as_tuple, Not(ElementsAre(0)));
@@ -571,8 +569,8 @@ TEST(ElementsAreTest, MakesCopyOfArguments) {
int x = 1;
int y = 2;
// This should make a copy of x and y.
- ::testing::internal::ElementsAreMatcher<testing::tuple<int, int> >
- polymorphic_matcher = ElementsAre(x, y);
+ ::testing::internal::ElementsAreMatcher<std::tuple<int, int> >
+ polymorphic_matcher = ElementsAre(x, y);
// Changing x and y now shouldn't affect the meaning of the above matcher.
x = y = 0;
const int array1[] = { 1, 2 };
@@ -1235,8 +1233,8 @@ TEST(ContainsTest, AcceptsMatcher) {
TEST(ContainsTest, WorksForNativeArrayAsTuple) {
const int a[] = { 1, 2 };
const int* const pointer = a;
- EXPECT_THAT(make_tuple(pointer, 2), Contains(1));
- EXPECT_THAT(make_tuple(pointer, 2), Not(Contains(Gt(3))));
+ EXPECT_THAT(std::make_tuple(pointer, 2), Contains(1));
+ EXPECT_THAT(std::make_tuple(pointer, 2), Not(Contains(Gt(3))));
}
TEST(ContainsTest, WorksForTwoDimensionalNativeArray) {
diff --git a/googlemock/test/gmock-internal-utils_test.cc b/googlemock/test/gmock-internal-utils_test.cc
index 7116e4fc..41498f0e 100644
--- a/googlemock/test/gmock-internal-utils_test.cc
+++ b/googlemock/test/gmock-internal-utils_test.cc
@@ -308,26 +308,23 @@ TEST(LosslessArithmeticConvertibleTest, FloatingPointToFloatingPoint) {
// Tests the TupleMatches() template function.
TEST(TupleMatchesTest, WorksForSize0) {
- tuple<> matchers;
- tuple<> values;
+ std::tuple<> matchers;
+ std::tuple<> values;
EXPECT_TRUE(TupleMatches(matchers, values));
}
TEST(TupleMatchesTest, WorksForSize1) {
- tuple<Matcher<int> > matchers(Eq(1));
- tuple<int> values1(1),
- values2(2);
+ std::tuple<Matcher<int> > matchers(Eq(1));
+ std::tuple<int> values1(1), values2(2);
EXPECT_TRUE(TupleMatches(matchers, values1));
EXPECT_FALSE(TupleMatches(matchers, values2));
}
TEST(TupleMatchesTest, WorksForSize2) {
- tuple<Matcher<int>, Matcher<char> > matchers(Eq(1), Eq('a'));
- tuple<int, char> values1(1, 'a'),
- values2(1, 'b'),
- values3(2, 'a'),
+ std::tuple<Matcher<int>, Matcher<char> > matchers(Eq(1), Eq('a'));
+ std::tuple<int, char> values1(1, 'a'), values2(1, 'b'), values3(2, 'a'),
values4(2, 'b');
EXPECT_TRUE(TupleMatches(matchers, values1));
@@ -337,10 +334,11 @@ TEST(TupleMatchesTest, WorksForSize2) {
}
TEST(TupleMatchesTest, WorksForSize5) {
- tuple<Matcher<int>, Matcher<char>, Matcher<bool>, Matcher<long>, // NOLINT
- Matcher<std::string> >
+ std::tuple<Matcher<int>, Matcher<char>, Matcher<bool>,
+ Matcher<long>, // NOLINT
+ Matcher<std::string> >
matchers(Eq(1), Eq('a'), Eq(true), Eq(2L), Eq("hi"));
- tuple<int, char, bool, long, std::string> // NOLINT
+ std::tuple<int, char, bool, long, std::string> // NOLINT
values1(1, 'a', true, 2L, "hi"), values2(1, 'a', true, 2L, "hello"),
values3(2, 'a', true, 2L, "hi");
@@ -686,22 +684,25 @@ TEST(StlContainerViewTest, WorksForStaticNativeArray) {
TEST(StlContainerViewTest, WorksForDynamicNativeArray) {
StaticAssertTypeEq<NativeArray<int>,
- StlContainerView<tuple<const int*, size_t> >::type>();
- StaticAssertTypeEq<NativeArray<double>,
- StlContainerView<tuple<linked_ptr<double>, int> >::type>();
+ StlContainerView<std::tuple<const int*, size_t> >::type>();
+ StaticAssertTypeEq<
+ NativeArray<double>,
+ StlContainerView<std::tuple<linked_ptr<double>, int> >::type>();
- StaticAssertTypeEq<const NativeArray<int>,
- StlContainerView<tuple<const int*, int> >::const_reference>();
+ StaticAssertTypeEq<
+ const NativeArray<int>,
+ StlContainerView<std::tuple<const int*, int> >::const_reference>();
int a1[3] = { 0, 1, 2 };
const int* const p1 = a1;
- NativeArray<int> a2 = StlContainerView<tuple<const int*, int> >::
- ConstReference(make_tuple(p1, 3));
+ NativeArray<int> a2 =
+ StlContainerView<std::tuple<const int*, int> >::ConstReference(
+ std::make_tuple(p1, 3));
EXPECT_EQ(3U, a2.size());
EXPECT_EQ(a1, a2.begin());
- const NativeArray<int> a3 = StlContainerView<tuple<int*, size_t> >::
- Copy(make_tuple(static_cast<int*>(a1), 3));
+ const NativeArray<int> a3 = StlContainerView<std::tuple<int*, size_t> >::Copy(
+ std::make_tuple(static_cast<int*>(a1), 3));
ASSERT_EQ(3U, a3.size());
EXPECT_EQ(0, a3.begin()[0]);
EXPECT_EQ(1, a3.begin()[1]);
diff --git a/googlemock/test/gmock-matchers_test.cc b/googlemock/test/gmock-matchers_test.cc
index 6d432340..86ff580a 100644
--- a/googlemock/test/gmock-matchers_test.cc
+++ b/googlemock/test/gmock-matchers_test.cc
@@ -136,7 +136,6 @@ using testing::Value;
using testing::WhenSorted;
using testing::WhenSortedBy;
using testing::_;
-using testing::get;
using testing::internal::DummyMatchResultListener;
using testing::internal::ElementMatcherPair;
using testing::internal::ElementMatcherPairs;
@@ -153,8 +152,6 @@ using testing::internal::Strings;
using testing::internal::linked_ptr;
using testing::internal::scoped_ptr;
using testing::internal::string;
-using testing::make_tuple;
-using testing::tuple;
// For testing ExplainMatchResultTo().
class GreaterThanMatcher : public MatcherInterface<int> {
@@ -2239,8 +2236,7 @@ TEST(GlobalWideEndsWithTest, CanDescribeSelf) {
#endif // GTEST_HAS_GLOBAL_WSTRING
-
-typedef ::testing::tuple<long, int> Tuple2; // NOLINT
+typedef ::std::tuple<long, int> Tuple2; // NOLINT
// Tests that Eq() matches a 2-tuple where the first field == the
// second field.
@@ -2334,7 +2330,7 @@ TEST(Ne2Test, CanDescribeSelf) {
// Tests that FloatEq() matches a 2-tuple where
// FloatEq(first field) matches the second field.
TEST(FloatEq2Test, MatchesEqualArguments) {
- typedef ::testing::tuple<float, float> Tpl;
+ typedef ::std::tuple<float, float> Tpl;
Matcher<const Tpl&> m = FloatEq();
EXPECT_TRUE(m.Matches(Tpl(1.0f, 1.0f)));
EXPECT_TRUE(m.Matches(Tpl(0.3f, 0.1f + 0.1f + 0.1f)));
@@ -2343,14 +2339,14 @@ TEST(FloatEq2Test, MatchesEqualArguments) {
// Tests that FloatEq() describes itself properly.
TEST(FloatEq2Test, CanDescribeSelf) {
- Matcher<const ::testing::tuple<float, float>&> m = FloatEq();
+ Matcher<const ::std::tuple<float, float>&> m = FloatEq();
EXPECT_EQ("are an almost-equal pair", Describe(m));
}
// Tests that NanSensitiveFloatEq() matches a 2-tuple where
// NanSensitiveFloatEq(first field) matches the second field.
TEST(NanSensitiveFloatEqTest, MatchesEqualArgumentsWithNaN) {
- typedef ::testing::tuple<float, float> Tpl;
+ typedef ::std::tuple<float, float> Tpl;
Matcher<const Tpl&> m = NanSensitiveFloatEq();
EXPECT_TRUE(m.Matches(Tpl(1.0f, 1.0f)));
EXPECT_TRUE(m.Matches(Tpl(std::numeric_limits<float>::quiet_NaN(),
@@ -2362,14 +2358,14 @@ TEST(NanSensitiveFloatEqTest, MatchesEqualArgumentsWithNaN) {
// Tests that NanSensitiveFloatEq() describes itself properly.
TEST(NanSensitiveFloatEqTest, CanDescribeSelfWithNaNs) {
- Matcher<const ::testing::tuple<float, float>&> m = NanSensitiveFloatEq();
+ Matcher<const ::std::tuple<float, float>&> m = NanSensitiveFloatEq();
EXPECT_EQ("are an almost-equal pair", Describe(m));
}
// Tests that DoubleEq() matches a 2-tuple where
// DoubleEq(first field) matches the second field.
TEST(DoubleEq2Test, MatchesEqualArguments) {
- typedef ::testing::tuple<double, double> Tpl;
+ typedef ::std::tuple<double, double> Tpl;
Matcher<const Tpl&> m = DoubleEq();
EXPECT_TRUE(m.Matches(Tpl(1.0, 1.0)));
EXPECT_TRUE(m.Matches(Tpl(0.3, 0.1 + 0.1 + 0.1)));
@@ -2378,14 +2374,14 @@ TEST(DoubleEq2Test, MatchesEqualArguments) {
// Tests that DoubleEq() describes itself properly.
TEST(DoubleEq2Test, CanDescribeSelf) {
- Matcher<const ::testing::tuple<double, double>&> m = DoubleEq();
+ Matcher<const ::std::tuple<double, double>&> m = DoubleEq();
EXPECT_EQ("are an almost-equal pair", Describe(m));
}
// Tests that NanSensitiveDoubleEq() matches a 2-tuple where
// NanSensitiveDoubleEq(first field) matches the second field.
TEST(NanSensitiveDoubleEqTest, MatchesEqualArgumentsWithNaN) {
- typedef ::testing::tuple<double, double> Tpl;
+ typedef ::std::tuple<double, double> Tpl;
Matcher<const Tpl&> m = NanSensitiveDoubleEq();
EXPECT_TRUE(m.Matches(Tpl(1.0f, 1.0f)));
EXPECT_TRUE(m.Matches(Tpl(std::numeric_limits<double>::quiet_NaN(),
@@ -2397,14 +2393,14 @@ TEST(NanSensitiveDoubleEqTest, MatchesEqualArgumentsWithNaN) {
// Tests that DoubleEq() describes itself properly.
TEST(NanSensitiveDoubleEqTest, CanDescribeSelfWithNaNs) {
- Matcher<const ::testing::tuple<double, double>&> m = NanSensitiveDoubleEq();
+ Matcher<const ::std::tuple<double, double>&> m = NanSensitiveDoubleEq();
EXPECT_EQ("are an almost-equal pair", Describe(m));
}
// Tests that FloatEq() matches a 2-tuple where
// FloatNear(first field, max_abs_error) matches the second field.
TEST(FloatNear2Test, MatchesEqualArguments) {
- typedef ::testing::tuple<float, float> Tpl;
+ typedef ::std::tuple<float, float> Tpl;
Matcher<const Tpl&> m = FloatNear(0.5f);
EXPECT_TRUE(m.Matches(Tpl(1.0f, 1.0f)));
EXPECT_TRUE(m.Matches(Tpl(1.3f, 1.0f)));
@@ -2413,14 +2409,14 @@ TEST(FloatNear2Test, MatchesEqualArguments) {
// Tests that FloatNear() describes itself properly.
TEST(FloatNear2Test, CanDescribeSelf) {
- Matcher<const ::testing::tuple<float, float>&> m = FloatNear(0.5f);
+ Matcher<const ::std::tuple<float, float>&> m = FloatNear(0.5f);
EXPECT_EQ("are an almost-equal pair", Describe(m));
}
// Tests that NanSensitiveFloatNear() matches a 2-tuple where
// NanSensitiveFloatNear(first field) matches the second field.
TEST(NanSensitiveFloatNearTest, MatchesNearbyArgumentsWithNaN) {
- typedef ::testing::tuple<float, float> Tpl;
+ typedef ::std::tuple<float, float> Tpl;
Matcher<const Tpl&> m = NanSensitiveFloatNear(0.5f);
EXPECT_TRUE(m.Matches(Tpl(1.0f, 1.0f)));
EXPECT_TRUE(m.Matches(Tpl(1.1f, 1.0f)));
@@ -2433,15 +2429,14 @@ TEST(NanSensitiveFloatNearTest, MatchesNearbyArgumentsWithNaN) {
// Tests that NanSensitiveFloatNear() describes itself properly.
TEST(NanSensitiveFloatNearTest, CanDescribeSelfWithNaNs) {
- Matcher<const ::testing::tuple<float, float>&> m =
- NanSensitiveFloatNear(0.5f);
+ Matcher<const ::std::tuple<float, float>&> m = NanSensitiveFloatNear(0.5f);
EXPECT_EQ("are an almost-equal pair", Describe(m));
}
// Tests that FloatEq() matches a 2-tuple where
// DoubleNear(first field, max_abs_error) matches the second field.
TEST(DoubleNear2Test, MatchesEqualArguments) {
- typedef ::testing::tuple<double, double> Tpl;
+ typedef ::std::tuple<double, double> Tpl;
Matcher<const Tpl&> m = DoubleNear(0.5);
EXPECT_TRUE(m.Matches(Tpl(1.0, 1.0)));
EXPECT_TRUE(m.Matches(Tpl(1.3, 1.0)));
@@ -2450,14 +2445,14 @@ TEST(DoubleNear2Test, MatchesEqualArguments) {
// Tests that DoubleNear() describes itself properly.
TEST(DoubleNear2Test, CanDescribeSelf) {
- Matcher<const ::testing::tuple<double, double>&> m = DoubleNear(0.5);
+ Matcher<const ::std::tuple<double, double>&> m = DoubleNear(0.5);
EXPECT_EQ("are an almost-equal pair", Describe(m));
}
// Tests that NanSensitiveDoubleNear() matches a 2-tuple where
// NanSensitiveDoubleNear(first field) matches the second field.
TEST(NanSensitiveDoubleNearTest, MatchesNearbyArgumentsWithNaN) {
- typedef ::testing::tuple<double, double> Tpl;
+ typedef ::std::tuple<double, double> Tpl;
Matcher<const Tpl&> m = NanSensitiveDoubleNear(0.5f);
EXPECT_TRUE(m.Matches(Tpl(1.0f, 1.0f)));
EXPECT_TRUE(m.Matches(Tpl(1.1f, 1.0f)));
@@ -2470,8 +2465,7 @@ TEST(NanSensitiveDoubleNearTest, MatchesNearbyArgumentsWithNaN) {
// Tests that NanSensitiveDoubleNear() describes itself properly.
TEST(NanSensitiveDoubleNearTest, CanDescribeSelfWithNaNs) {
- Matcher<const ::testing::tuple<double, double>&> m =
- NanSensitiveDoubleNear(0.5f);
+ Matcher<const ::std::tuple<double, double>&> m = NanSensitiveDoubleNear(0.5f);
EXPECT_EQ("are an almost-equal pair", Describe(m));
}
@@ -3081,8 +3075,8 @@ TEST(DescribeMatcherTest, WorksWithPolymorphicMatcher) {
}
TEST(AllArgsTest, WorksForTuple) {
- EXPECT_THAT(make_tuple(1, 2L), AllArgs(Lt()));
- EXPECT_THAT(make_tuple(2L, 1), Not(AllArgs(Lt())));
+ EXPECT_THAT(std::make_tuple(1, 2L), AllArgs(Lt()));
+ EXPECT_THAT(std::make_tuple(2L, 1), Not(AllArgs(Lt())));
}
TEST(AllArgsTest, WorksForNonTuple) {
@@ -5060,11 +5054,11 @@ TEST(ContainerEqExtraTest, WorksForNativeArrayAsTuple) {
const int b[] = {1, 2, 3, 4};
const int* const p1 = a1;
- EXPECT_THAT(make_tuple(p1, 3), ContainerEq(a2));
- EXPECT_THAT(make_tuple(p1, 3), Not(ContainerEq(b)));
+ EXPECT_THAT(std::make_tuple(p1, 3), ContainerEq(a2));
+ EXPECT_THAT(std::make_tuple(p1, 3), Not(ContainerEq(b)));
const int c[] = {1, 3, 2};
- EXPECT_THAT(make_tuple(p1, 3), Not(ContainerEq(c)));
+ EXPECT_THAT(std::make_tuple(p1, 3), Not(ContainerEq(c)));
}
TEST(ContainerEqExtraTest, CopiesNativeArrayParameter) {
@@ -6246,13 +6240,15 @@ TEST(PolymorphicMatcherTest, CanAccessImpl) {
TEST(MatcherTupleTest, ExplainsMatchFailure) {
stringstream ss1;
- ExplainMatchFailureTupleTo(make_tuple(Matcher<char>(Eq('a')), GreaterThan(5)),
- make_tuple('a', 10), &ss1);
+ ExplainMatchFailureTupleTo(
+ std::make_tuple(Matcher<char>(Eq('a')), GreaterThan(5)),
+ std::make_tuple('a', 10), &ss1);
EXPECT_EQ("", ss1.str()); // Successful match.
stringstream ss2;
- ExplainMatchFailureTupleTo(make_tuple(GreaterThan(5), Matcher<char>(Eq('a'))),
- make_tuple(2, 'b'), &ss2);
+ ExplainMatchFailureTupleTo(
+ std::make_tuple(GreaterThan(5), Matcher<char>(Eq('a'))),
+ std::make_tuple(2, 'b'), &ss2);
EXPECT_EQ(" Expected arg #0: is > 5\n"
" Actual: 2, which is 3 less than 5\n"
" Expected arg #1: is equal to 'a' (97, 0x61)\n"
@@ -6260,8 +6256,9 @@ TEST(MatcherTupleTest, ExplainsMatchFailure) {
ss2.str()); // Failed match where both arguments need explanation.
stringstream ss3;
- ExplainMatchFailureTupleTo(make_tuple(GreaterThan(5), Matcher<char>(Eq('a'))),
- make_tuple(2, 'a'), &ss3);
+ ExplainMatchFailureTupleTo(
+ std::make_tuple(GreaterThan(5), Matcher<char>(Eq('a'))),
+ std::make_tuple(2, 'a'), &ss3);
EXPECT_EQ(" Expected arg #0: is > 5\n"
" Actual: 2, which is 3 less than 5\n",
ss3.str()); // Failed match where only one argument needs
@@ -6350,21 +6347,21 @@ TEST(EachTest, AcceptsMatcher) {
TEST(EachTest, WorksForNativeArrayAsTuple) {
const int a[] = {1, 2};
const int* const pointer = a;
- EXPECT_THAT(make_tuple(pointer, 2), Each(Gt(0)));
- EXPECT_THAT(make_tuple(pointer, 2), Not(Each(Gt(1))));
+ EXPECT_THAT(std::make_tuple(pointer, 2), Each(Gt(0)));
+ EXPECT_THAT(std::make_tuple(pointer, 2), Not(Each(Gt(1))));
}
// For testing Pointwise().
class IsHalfOfMatcher {
public:
template <typename T1, typename T2>
- bool MatchAndExplain(const tuple<T1, T2>& a_pair,
+ bool MatchAndExplain(const std::tuple<T1, T2>& a_pair,
MatchResultListener* listener) const {
- if (get<0>(a_pair) == get<1>(a_pair)/2) {
- *listener << "where the second is " << get<1>(a_pair);
+ if (std::get<0>(a_pair) == std::get<1>(a_pair) / 2) {
+ *listener << "where the second is " << std::get<1>(a_pair);
return true;
} else {
- *listener << "where the second/2 is " << get<1>(a_pair)/2;
+ *listener << "where the second/2 is " << std::get<1>(a_pair) / 2;
return false;
}
}
@@ -6481,13 +6478,13 @@ TEST(PointwiseTest, AcceptsCorrectContent) {
TEST(PointwiseTest, AllowsMonomorphicInnerMatcher) {
const double lhs[3] = {1, 2, 3};
const int rhs[3] = {2, 4, 6};
- const Matcher<tuple<const double&, const int&> > m1 = IsHalfOf();
+ const Matcher<std::tuple<const double&, const int&>> m1 = IsHalfOf();
EXPECT_THAT(lhs, Pointwise(m1, rhs));
EXPECT_EQ("", Explain(Pointwise(m1, rhs), lhs));
- // This type works as a tuple<const double&, const int&> can be
- // implicitly cast to tuple<double, int>.
- const Matcher<tuple<double, int> > m2 = IsHalfOf();
+ // This type works as a std::tuple<const double&, const int&> can be
+ // implicitly cast to std::tuple<double, int>.
+ const Matcher<std::tuple<double, int>> m2 = IsHalfOf();
EXPECT_THAT(lhs, Pointwise(m2, rhs));
EXPECT_EQ("", Explain(Pointwise(m2, rhs), lhs));
}
@@ -6597,12 +6594,12 @@ TEST(UnorderedPointwiseTest, AcceptsCorrectContentInDifferentOrder) {
TEST(UnorderedPointwiseTest, AllowsMonomorphicInnerMatcher) {
const double lhs[3] = {1, 2, 3};
const int rhs[3] = {4, 6, 2};
- const Matcher<tuple<const double&, const int&> > m1 = IsHalfOf();
+ const Matcher<std::tuple<const double&, const int&>> m1 = IsHalfOf();
EXPECT_THAT(lhs, UnorderedPointwise(m1, rhs));
- // This type works as a tuple<const double&, const int&> can be
- // implicitly cast to tuple<double, int>.
- const Matcher<tuple<double, int> > m2 = IsHalfOf();
+ // This type works as a std::tuple<const double&, const int&> can be
+ // implicitly cast to std::tuple<double, int>.
+ const Matcher<std::tuple<double, int>> m2 = IsHalfOf();
EXPECT_THAT(lhs, UnorderedPointwise(m2, rhs));
}
diff --git a/googlemock/test/gmock-more-actions_test.cc b/googlemock/test/gmock-more-actions_test.cc
index 976b245e..521f3058 100644
--- a/googlemock/test/gmock-more-actions_test.cc
+++ b/googlemock/test/gmock-more-actions_test.cc
@@ -46,10 +46,6 @@ namespace gmock_more_actions_test {
using ::std::plus;
using ::std::string;
-using testing::get;
-using testing::make_tuple;
-using testing::tuple;
-using testing::tuple_element;
using testing::_;
using testing::Action;
using testing::ActionInterface;
@@ -232,45 +228,46 @@ class Foo {
// Tests using Invoke() with a nullary function.
TEST(InvokeTest, Nullary) {
Action<int()> a = Invoke(Nullary); // NOLINT
- EXPECT_EQ(1, a.Perform(make_tuple()));
+ EXPECT_EQ(1, a.Perform(std::make_tuple()));
}
// Tests using Invoke() with a unary function.
TEST(InvokeTest, Unary) {
Action<bool(int)> a = Invoke(Unary); // NOLINT
- EXPECT_FALSE(a.Perform(make_tuple(1)));
- EXPECT_TRUE(a.Perform(make_tuple(-1)));
+ EXPECT_FALSE(a.Perform(std::make_tuple(1)));
+ EXPECT_TRUE(a.Perform(std::make_tuple(-1)));
}
// Tests using Invoke() with a binary function.
TEST(InvokeTest, Binary) {
Action<const char*(const char*, short)> a = Invoke(Binary); // NOLINT
const char* p = "Hello";
- EXPECT_EQ(p + 2, a.Perform(make_tuple(p, Short(2))));
+ EXPECT_EQ(p + 2, a.Perform(std::make_tuple(p, Short(2))));
}
// Tests using Invoke() with a ternary function.
TEST(InvokeTest, Ternary) {
Action<int(int, char, short)> a = Invoke(Ternary); // NOLINT
- EXPECT_EQ(6, a.Perform(make_tuple(1, '\2', Short(3))));
+ EXPECT_EQ(6, a.Perform(std::make_tuple(1, '\2', Short(3))));
}
// Tests using Invoke() with a 4-argument function.
TEST(InvokeTest, FunctionThatTakes4Arguments) {
Action<int(int, int, int, int)> a = Invoke(SumOf4); // NOLINT
- EXPECT_EQ(1234, a.Perform(make_tuple(1000, 200, 30, 4)));
+ EXPECT_EQ(1234, a.Perform(std::make_tuple(1000, 200, 30, 4)));
}
// Tests using Invoke() with a 5-argument function.
TEST(InvokeTest, FunctionThatTakes5Arguments) {
Action<int(int, int, int, int, int)> a = Invoke(SumOf5); // NOLINT
- EXPECT_EQ(12345, a.Perform(make_tuple(10000, 2000, 300, 40, 5)));
+ EXPECT_EQ(12345, a.Perform(std::make_tuple(10000, 2000, 300, 40, 5)));
}
// Tests using Invoke() with a 6-argument function.
TEST(InvokeTest, FunctionThatTakes6Arguments) {
Action<int(int, int, int, int, int, int)> a = Invoke(SumOf6); // NOLINT
- EXPECT_EQ(123456, a.Perform(make_tuple(100000, 20000, 3000, 400, 50, 6)));
+ EXPECT_EQ(123456,
+ a.Perform(std::make_tuple(100000, 20000, 3000, 400, 50, 6)));
}
// A helper that turns the type of a C-string literal from const
@@ -283,9 +280,9 @@ TEST(InvokeTest, FunctionThatTakes7Arguments) {
const char*, const char*, const char*)>
a = Invoke(Concat7);
EXPECT_EQ("1234567",
- a.Perform(make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
- CharPtr("4"), CharPtr("5"), CharPtr("6"),
- CharPtr("7"))));
+ a.Perform(std::make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
+ CharPtr("4"), CharPtr("5"), CharPtr("6"),
+ CharPtr("7"))));
}
// Tests using Invoke() with a 8-argument function.
@@ -294,9 +291,9 @@ TEST(InvokeTest, FunctionThatTakes8Arguments) {
const char*, const char*, const char*, const char*)>
a = Invoke(Concat8);
EXPECT_EQ("12345678",
- a.Perform(make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
- CharPtr("4"), CharPtr("5"), CharPtr("6"),
- CharPtr("7"), CharPtr("8"))));
+ a.Perform(std::make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
+ CharPtr("4"), CharPtr("5"), CharPtr("6"),
+ CharPtr("7"), CharPtr("8"))));
}
// Tests using Invoke() with a 9-argument function.
@@ -305,10 +302,10 @@ TEST(InvokeTest, FunctionThatTakes9Arguments) {
const char*, const char*, const char*, const char*,
const char*)>
a = Invoke(Concat9);
- EXPECT_EQ("123456789",
- a.Perform(make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
- CharPtr("4"), CharPtr("5"), CharPtr("6"),
- CharPtr("7"), CharPtr("8"), CharPtr("9"))));
+ EXPECT_EQ("123456789", a.Perform(std::make_tuple(
+ CharPtr("1"), CharPtr("2"), CharPtr("3"),
+ CharPtr("4"), CharPtr("5"), CharPtr("6"),
+ CharPtr("7"), CharPtr("8"), CharPtr("9"))));
}
// Tests using Invoke() with a 10-argument function.
@@ -318,46 +315,46 @@ TEST(InvokeTest, FunctionThatTakes10Arguments) {
const char*, const char*)>
a = Invoke(Concat10);
EXPECT_EQ("1234567890",
- a.Perform(make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
- CharPtr("4"), CharPtr("5"), CharPtr("6"),
- CharPtr("7"), CharPtr("8"), CharPtr("9"),
- CharPtr("0"))));
+ a.Perform(std::make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
+ CharPtr("4"), CharPtr("5"), CharPtr("6"),
+ CharPtr("7"), CharPtr("8"), CharPtr("9"),
+ CharPtr("0"))));
}
// Tests using Invoke() with functions with parameters declared as Unused.
TEST(InvokeTest, FunctionWithUnusedParameters) {
Action<int(int, int, double, const std::string&)> a1 = Invoke(SumOfFirst2);
- tuple<int, int, double, std::string> dummy =
- make_tuple(10, 2, 5.6, std::string("hi"));
+ std::tuple<int, int, double, std::string> dummy =
+ std::make_tuple(10, 2, 5.6, std::string("hi"));
EXPECT_EQ(12, a1.Perform(dummy));
Action<int(int, int, bool, int*)> a2 =
Invoke(SumOfFirst2);
- EXPECT_EQ(23,
- a2.Perform(make_tuple(20, 3, true, static_cast<int*>(nullptr))));
+ EXPECT_EQ(
+ 23, a2.Perform(std::make_tuple(20, 3, true, static_cast<int*>(nullptr))));
}
// Tests using Invoke() with methods with parameters declared as Unused.
TEST(InvokeTest, MethodWithUnusedParameters) {
Foo foo;
Action<int(std::string, bool, int, int)> a1 = Invoke(&foo, &Foo::SumOfLast2);
- EXPECT_EQ(12, a1.Perform(make_tuple(CharPtr("hi"), true, 10, 2)));
+ EXPECT_EQ(12, a1.Perform(std::make_tuple(CharPtr("hi"), true, 10, 2)));
Action<int(char, double, int, int)> a2 =
Invoke(&foo, &Foo::SumOfLast2);
- EXPECT_EQ(23, a2.Perform(make_tuple('a', 2.5, 20, 3)));
+ EXPECT_EQ(23, a2.Perform(std::make_tuple('a', 2.5, 20, 3)));
}
// Tests using Invoke() with a functor.
TEST(InvokeTest, Functor) {
Action<long(long, int)> a = Invoke(plus<long>()); // NOLINT
- EXPECT_EQ(3L, a.Perform(make_tuple(1, 2)));
+ EXPECT_EQ(3L, a.Perform(std::make_tuple(1, 2)));
}
// Tests using Invoke(f) as an action of a compatible type.
TEST(InvokeTest, FunctionWithCompatibleType) {
Action<long(int, short, char, bool)> a = Invoke(SumOf4); // NOLINT
- EXPECT_EQ(4321, a.Perform(make_tuple(4000, Short(300), Char(20), true)));
+ EXPECT_EQ(4321, a.Perform(std::make_tuple(4000, Short(300), Char(20), true)));
}
// Tests using Invoke() with an object pointer and a method pointer.
@@ -366,14 +363,14 @@ TEST(InvokeTest, FunctionWithCompatibleType) {
TEST(InvokeMethodTest, Nullary) {
Foo foo;
Action<int()> a = Invoke(&foo, &Foo::Nullary); // NOLINT
- EXPECT_EQ(123, a.Perform(make_tuple()));
+ EXPECT_EQ(123, a.Perform(std::make_tuple()));
}
// Tests using Invoke() with a unary method.
TEST(InvokeMethodTest, Unary) {
Foo foo;
Action<short(long)> a = Invoke(&foo, &Foo::Unary); // NOLINT
- EXPECT_EQ(4123, a.Perform(make_tuple(4000)));
+ EXPECT_EQ(4123, a.Perform(std::make_tuple(4000)));
}
// Tests using Invoke() with a binary method.
@@ -381,7 +378,7 @@ TEST(InvokeMethodTest, Binary) {
Foo foo;
Action<std::string(const std::string&, char)> a = Invoke(&foo, &Foo::Binary);
std::string s("Hell");
- tuple<std::string, char> dummy = make_tuple(s, 'o');
+ std::tuple<std::string, char> dummy = std::make_tuple(s, 'o');
EXPECT_EQ("Hello", a.Perform(dummy));
}
@@ -389,21 +386,21 @@ TEST(InvokeMethodTest, Binary) {
TEST(InvokeMethodTest, Ternary) {
Foo foo;
Action<int(int, bool, char)> a = Invoke(&foo, &Foo::Ternary); // NOLINT
- EXPECT_EQ(1124, a.Perform(make_tuple(1000, true, Char(1))));
+ EXPECT_EQ(1124, a.Perform(std::make_tuple(1000, true, Char(1))));
}
// Tests using Invoke() with a 4-argument method.
TEST(InvokeMethodTest, MethodThatTakes4Arguments) {
Foo foo;
Action<int(int, int, int, int)> a = Invoke(&foo, &Foo::SumOf4); // NOLINT
- EXPECT_EQ(1357, a.Perform(make_tuple(1000, 200, 30, 4)));
+ EXPECT_EQ(1357, a.Perform(std::make_tuple(1000, 200, 30, 4)));
}
// Tests using Invoke() with a 5-argument method.
TEST(InvokeMethodTest, MethodThatTakes5Arguments) {
Foo foo;
Action<int(int, int, int, int, int)> a = Invoke(&foo, &Foo::SumOf5); // NOLINT
- EXPECT_EQ(12345, a.Perform(make_tuple(10000, 2000, 300, 40, 5)));
+ EXPECT_EQ(12345, a.Perform(std::make_tuple(10000, 2000, 300, 40, 5)));
}
// Tests using Invoke() with a 6-argument method.
@@ -411,7 +408,8 @@ TEST(InvokeMethodTest, MethodThatTakes6Arguments) {
Foo foo;
Action<int(int, int, int, int, int, int)> a = // NOLINT
Invoke(&foo, &Foo::SumOf6);
- EXPECT_EQ(123456, a.Perform(make_tuple(100000, 20000, 3000, 400, 50, 6)));
+ EXPECT_EQ(123456,
+ a.Perform(std::make_tuple(100000, 20000, 3000, 400, 50, 6)));
}
// Tests using Invoke() with a 7-argument method.
@@ -421,9 +419,9 @@ TEST(InvokeMethodTest, MethodThatTakes7Arguments) {
const char*, const char*, const char*)>
a = Invoke(&foo, &Foo::Concat7);
EXPECT_EQ("1234567",
- a.Perform(make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
- CharPtr("4"), CharPtr("5"), CharPtr("6"),
- CharPtr("7"))));
+ a.Perform(std::make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
+ CharPtr("4"), CharPtr("5"), CharPtr("6"),
+ CharPtr("7"))));
}
// Tests using Invoke() with a 8-argument method.
@@ -433,9 +431,9 @@ TEST(InvokeMethodTest, MethodThatTakes8Arguments) {
const char*, const char*, const char*, const char*)>
a = Invoke(&foo, &Foo::Concat8);
EXPECT_EQ("12345678",
- a.Perform(make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
- CharPtr("4"), CharPtr("5"), CharPtr("6"),
- CharPtr("7"), CharPtr("8"))));
+ a.Perform(std::make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
+ CharPtr("4"), CharPtr("5"), CharPtr("6"),
+ CharPtr("7"), CharPtr("8"))));
}
// Tests using Invoke() with a 9-argument method.
@@ -445,10 +443,10 @@ TEST(InvokeMethodTest, MethodThatTakes9Arguments) {
const char*, const char*, const char*, const char*,
const char*)>
a = Invoke(&foo, &Foo::Concat9);
- EXPECT_EQ("123456789",
- a.Perform(make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
- CharPtr("4"), CharPtr("5"), CharPtr("6"),
- CharPtr("7"), CharPtr("8"), CharPtr("9"))));
+ EXPECT_EQ("123456789", a.Perform(std::make_tuple(
+ CharPtr("1"), CharPtr("2"), CharPtr("3"),
+ CharPtr("4"), CharPtr("5"), CharPtr("6"),
+ CharPtr("7"), CharPtr("8"), CharPtr("9"))));
}
// Tests using Invoke() with a 10-argument method.
@@ -459,10 +457,10 @@ TEST(InvokeMethodTest, MethodThatTakes10Arguments) {
const char*, const char*)>
a = Invoke(&foo, &Foo::Concat10);
EXPECT_EQ("1234567890",
- a.Perform(make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
- CharPtr("4"), CharPtr("5"), CharPtr("6"),
- CharPtr("7"), CharPtr("8"), CharPtr("9"),
- CharPtr("0"))));
+ a.Perform(std::make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
+ CharPtr("4"), CharPtr("5"), CharPtr("6"),
+ CharPtr("7"), CharPtr("8"), CharPtr("9"),
+ CharPtr("0"))));
}
// Tests using Invoke(f) as an action of a compatible type.
@@ -470,48 +468,48 @@ TEST(InvokeMethodTest, MethodWithCompatibleType) {
Foo foo;
Action<long(int, short, char, bool)> a = // NOLINT
Invoke(&foo, &Foo::SumOf4);
- EXPECT_EQ(4444, a.Perform(make_tuple(4000, Short(300), Char(20), true)));
+ EXPECT_EQ(4444, a.Perform(std::make_tuple(4000, Short(300), Char(20), true)));
}
// Tests using WithoutArgs with an action that takes no argument.
TEST(WithoutArgsTest, NoArg) {
Action<int(int n)> a = WithoutArgs(Invoke(Nullary)); // NOLINT
- EXPECT_EQ(1, a.Perform(make_tuple(2)));
+ EXPECT_EQ(1, a.Perform(std::make_tuple(2)));
}
// Tests using WithArg with an action that takes 1 argument.
TEST(WithArgTest, OneArg) {
Action<bool(double x, int n)> b = WithArg<1>(Invoke(Unary)); // NOLINT
- EXPECT_TRUE(b.Perform(make_tuple(1.5, -1)));
- EXPECT_FALSE(b.Perform(make_tuple(1.5, 1)));
+ EXPECT_TRUE(b.Perform(std::make_tuple(1.5, -1)));
+ EXPECT_FALSE(b.Perform(std::make_tuple(1.5, 1)));
}
TEST(ReturnArgActionTest, WorksForOneArgIntArg0) {
const Action<int(int)> a = ReturnArg<0>();
- EXPECT_EQ(5, a.Perform(make_tuple(5)));
+ EXPECT_EQ(5, a.Perform(std::make_tuple(5)));
}
TEST(ReturnArgActionTest, WorksForMultiArgBoolArg0) {
const Action<bool(bool, bool, bool)> a = ReturnArg<0>();
- EXPECT_TRUE(a.Perform(make_tuple(true, false, false)));
+ EXPECT_TRUE(a.Perform(std::make_tuple(true, false, false)));
}
TEST(ReturnArgActionTest, WorksForMultiArgStringArg2) {
const Action<std::string(int, int, std::string, int)> a = ReturnArg<2>();
- EXPECT_EQ("seven", a.Perform(make_tuple(5, 6, std::string("seven"), 8)));
+ EXPECT_EQ("seven", a.Perform(std::make_tuple(5, 6, std::string("seven"), 8)));
}
TEST(SaveArgActionTest, WorksForSameType) {
int result = 0;
const Action<void(int n)> a1 = SaveArg<0>(&result);
- a1.Perform(make_tuple(5));
+ a1.Perform(std::make_tuple(5));
EXPECT_EQ(5, result);
}
TEST(SaveArgActionTest, WorksForCompatibleType) {
int result = 0;
const Action<void(bool, char)> a1 = SaveArg<1>(&result);
- a1.Perform(make_tuple(true, 'a'));
+ a1.Perform(std::make_tuple(true, 'a'));
EXPECT_EQ('a', result);
}
@@ -519,7 +517,7 @@ TEST(SaveArgPointeeActionTest, WorksForSameType) {
int result = 0;
const int value = 5;
const Action<void(const int*)> a1 = SaveArgPointee<0>(&result);
- a1.Perform(make_tuple(&value));
+ a1.Perform(std::make_tuple(&value));
EXPECT_EQ(5, result);
}
@@ -527,7 +525,7 @@ TEST(SaveArgPointeeActionTest, WorksForCompatibleType) {
int result = 0;
char value = 'a';
const Action<void(bool, char*)> a1 = SaveArgPointee<1>(&result);
- a1.Perform(make_tuple(true, &value));
+ a1.Perform(std::make_tuple(true, &value));
EXPECT_EQ('a', result);
}
@@ -535,28 +533,28 @@ TEST(SaveArgPointeeActionTest, WorksForLinkedPtr) {
int result = 0;
linked_ptr<int> value(new int(5));
const Action<void(linked_ptr<int>)> a1 = SaveArgPointee<0>(&result);
- a1.Perform(make_tuple(value));
+ a1.Perform(std::make_tuple(value));
EXPECT_EQ(5, result);
}
TEST(SetArgRefereeActionTest, WorksForSameType) {
int value = 0;
const Action<void(int&)> a1 = SetArgReferee<0>(1);
- a1.Perform(tuple<int&>(value));
+ a1.Perform(std::tuple<int&>(value));
EXPECT_EQ(1, value);
}
TEST(SetArgRefereeActionTest, WorksForCompatibleType) {
int value = 0;
const Action<void(int, int&)> a1 = SetArgReferee<1>('a');
- a1.Perform(tuple<int, int&>(0, value));
+ a1.Perform(std::tuple<int, int&>(0, value));
EXPECT_EQ('a', value);
}
TEST(SetArgRefereeActionTest, WorksWithExtraArguments) {
int value = 0;
const Action<void(bool, int, int&, const char*)> a1 = SetArgReferee<2>('a');
- a1.Perform(tuple<bool, int, int&, const char*>(true, 0, value, "hi"));
+ a1.Perform(std::tuple<bool, int, int&, const char*>(true, 0, value, "hi"));
EXPECT_EQ('a', value);
}
@@ -583,7 +581,7 @@ TEST(DeleteArgActionTest, OneArg) {
DeletionTester* t = new DeletionTester(&is_deleted);
const Action<void(DeletionTester*)> a1 = DeleteArg<0>(); // NOLINT
EXPECT_FALSE(is_deleted);
- a1.Perform(make_tuple(t));
+ a1.Perform(std::make_tuple(t));
EXPECT_TRUE(is_deleted);
}
@@ -593,7 +591,7 @@ TEST(DeleteArgActionTest, TenArgs) {
const Action<void(bool, int, int, const char*, bool,
int, int, int, int, DeletionTester*)> a1 = DeleteArg<9>();
EXPECT_FALSE(is_deleted);
- a1.Perform(make_tuple(true, 5, 6, CharPtr("hi"), false, 7, 8, 9, 10, t));
+ a1.Perform(std::make_tuple(true, 5, 6, CharPtr("hi"), false, 7, 8, 9, 10, t));
EXPECT_TRUE(is_deleted);
}
@@ -601,19 +599,19 @@ TEST(DeleteArgActionTest, TenArgs) {
TEST(ThrowActionTest, ThrowsGivenExceptionInVoidFunction) {
const Action<void(int n)> a = Throw('a');
- EXPECT_THROW(a.Perform(make_tuple(0)), char);
+ EXPECT_THROW(a.Perform(std::make_tuple(0)), char);
}
class MyException {};
TEST(ThrowActionTest, ThrowsGivenExceptionInNonVoidFunction) {
const Action<double(char ch)> a = Throw(MyException());
- EXPECT_THROW(a.Perform(make_tuple('0')), MyException);
+ EXPECT_THROW(a.Perform(std::make_tuple('0')), MyException);
}
TEST(ThrowActionTest, ThrowsGivenExceptionInNullaryFunction) {
const Action<double()> a = Throw(MyException());
- EXPECT_THROW(a.Perform(make_tuple()), MyException);
+ EXPECT_THROW(a.Perform(std::make_tuple()), MyException);
}
#endif // GTEST_HAS_EXCEPTIONS
@@ -629,7 +627,7 @@ TEST(SetArrayArgumentTest, SetsTheNthArray) {
int* pn = n;
char ch[4] = {};
char* pch = ch;
- a.Perform(make_tuple(true, pn, pch));
+ a.Perform(std::make_tuple(true, pn, pch));
EXPECT_EQ(1, n[0]);
EXPECT_EQ(2, n[1]);
EXPECT_EQ(3, n[2]);
@@ -644,7 +642,7 @@ TEST(SetArrayArgumentTest, SetsTheNthArray) {
a = SetArrayArgument<2>(letters.begin(), letters.end());
std::fill_n(n, 4, 0);
std::fill_n(ch, 4, '\0');
- a.Perform(make_tuple(true, pn, pch));
+ a.Perform(std::make_tuple(true, pn, pch));
EXPECT_EQ(0, n[0]);
EXPECT_EQ(0, n[1]);
EXPECT_EQ(0, n[2]);
@@ -663,7 +661,7 @@ TEST(SetArrayArgumentTest, SetsTheNthArrayWithEmptyRange) {
int n[4] = {};
int* pn = n;
- a.Perform(make_tuple(true, pn));
+ a.Perform(std::make_tuple(true, pn));
EXPECT_EQ(0, n[0]);
EXPECT_EQ(0, n[1]);
EXPECT_EQ(0, n[2]);
@@ -679,7 +677,7 @@ TEST(SetArrayArgumentTest, SetsTheNthArrayWithConvertibleType) {
int codes[4] = { 111, 222, 333, 444 };
int* pcodes = codes;
- a.Perform(make_tuple(true, pcodes));
+ a.Perform(std::make_tuple(true, pcodes));
EXPECT_EQ(97, codes[0]);
EXPECT_EQ(98, codes[1]);
EXPECT_EQ(99, codes[2]);
@@ -693,17 +691,17 @@ TEST(SetArrayArgumentTest, SetsTheNthArrayWithIteratorArgument) {
Action<MyFunction> a = SetArrayArgument<1>(letters.begin(), letters.end());
std::string s;
- a.Perform(make_tuple(true, back_inserter(s)));
+ a.Perform(std::make_tuple(true, back_inserter(s)));
EXPECT_EQ(letters, s);
}
TEST(ReturnPointeeTest, Works) {
int n = 42;
const Action<int()> a = ReturnPointee(&n);
- EXPECT_EQ(42, a.Perform(make_tuple()));
+ EXPECT_EQ(42, a.Perform(std::make_tuple()));
n = 43;
- EXPECT_EQ(43, a.Perform(make_tuple()));
+ EXPECT_EQ(43, a.Perform(std::make_tuple()));
}
} // namespace gmock_generated_actions_test