Unverified Commit c955e334 authored by Gennadiy Civil's avatar Gennadiy Civil Committed by GitHub
Browse files

Merge branch 'master' into python3-tests

parents 3149e0e8 f410177a
...@@ -41,6 +41,8 @@ googletest/fused-src/ ...@@ -41,6 +41,8 @@ googletest/fused-src/
# macOS files # macOS files
.DS_Store .DS_Store
googletest/.DS_Store
googletest/xcode/.DS_Store
# Ignore cmake generated directories and files. # Ignore cmake generated directories and files.
CMakeFiles CMakeFiles
......
cmake_minimum_required(VERSION 2.8.8) cmake_minimum_required(VERSION 2.8.8)
add_definitions(-std=c++11)
if (POLICY CMP0048) if (POLICY CMP0048)
cmake_policy(SET CMP0048 NEW) cmake_policy(SET CMP0048 NEW)
......
...@@ -16,10 +16,8 @@ This repository is a merger of the formerly separate GoogleTest and ...@@ -16,10 +16,8 @@ This repository is a merger of the formerly separate GoogleTest and
GoogleMock projects. These were so closely related that it makes sense to GoogleMock projects. These were so closely related that it makes sense to
maintain and release them together. maintain and release them together.
Please see the project page above for more information as well as the Please the mailing list at googletestframework@googlegroups.com for questions, discussions, and development.
mailing list for questions, discussions, and development. There is There is also an IRC channel on [OFTC](https://webchat.oftc.net/) (irc.oftc.net) #gtest available.
also an IRC channel on [OFTC](https://webchat.oftc.net/) (irc.oftc.net) #gtest available. Please
join us!
Getting started information for **Google Test** is available in the Getting started information for **Google Test** is available in the
[Google Test Primer](googletest/docs/primer.md) documentation. [Google Test Primer](googletest/docs/primer.md) documentation.
......
...@@ -34,7 +34,8 @@ ...@@ -34,7 +34,8 @@
# #
# TODO() - we can check if this is being sourced using $BASH_VERSION and $BASH_SOURCE[0] != ${0}. # TODO() - we can check if this is being sourced using $BASH_VERSION and $BASH_SOURCE[0] != ${0}.
#
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
if [ "$CXX" = "clang++" ]; then export CXX="clang++-3.9" CC="clang-3.9"; fi if [ "$CXX" = "clang++" ]; then export CXX="clang++-3.9" CC="clang-3.9"; fi
fi fi
Changes for 1.7.0:
* All new improvements in Google Test 1.7.0.
* New feature: matchers DoubleNear(), FloatNear(),
NanSensitiveDoubleNear(), NanSensitiveFloatNear(),
UnorderedElementsAre(), UnorderedElementsAreArray(), WhenSorted(),
WhenSortedBy(), IsEmpty(), and SizeIs().
* Improvement: Google Mock can now be built as a DLL.
* Improvement: when compiled by a C++11 compiler, matchers AllOf()
and AnyOf() can accept an arbitrary number of matchers.
* Improvement: when compiled by a C++11 compiler, matchers
ElementsAreArray() can accept an initializer list.
* Improvement: when exceptions are enabled, a mock method with no
default action now throws instead crashing the test.
* Improvement: added class testing::StringMatchResultListener to aid
definition of composite matchers.
* Improvement: function return types used in MOCK_METHOD*() macros can
now contain unprotected commas.
* Improvement (potentially breaking): EXPECT_THAT() and ASSERT_THAT()
are now more strict in ensuring that the value type and the matcher
type are compatible, catching potential bugs in tests.
* Improvement: Pointee() now works on an optional<T>.
* Improvement: the ElementsAreArray() matcher can now take a vector or
iterator range as input, and makes a copy of its input elements
before the conversion to a Matcher.
* Improvement: the Google Mock Generator can now generate mocks for
some class templates.
* Bug fix: mock object destruction triggerred by another mock object's
destruction no longer hangs.
* Improvement: Google Mock Doctor works better with newer Clang and
GCC now.
* Compatibility fixes.
* Bug/warning fixes.
Changes for 1.6.0:
* Compilation is much faster and uses much less memory, especially
when the constructor and destructor of a mock class are moved out of
the class body.
* New matchers: Pointwise(), Each().
* New actions: ReturnPointee() and ReturnRefOfCopy().
* CMake support.
* Project files for Visual Studio 2010.
* AllOf() and AnyOf() can handle up-to 10 arguments now.
* Google Mock doctor understands Clang error messages now.
* SetArgPointee<> now accepts string literals.
* gmock_gen.py handles storage specifier macros and template return
types now.
* Compatibility fixes.
* Bug fixes and implementation clean-ups.
* Potentially incompatible changes: disables the harmful 'make install'
command in autotools.
Potentially breaking changes:
* The description string for MATCHER*() changes from Python-style
interpolation to an ordinary C++ string expression.
* SetArgumentPointee is deprecated in favor of SetArgPointee.
* Some non-essential project files for Visual Studio 2005 are removed.
Changes for 1.5.0:
* New feature: Google Mock can be safely used in multi-threaded tests
on platforms having pthreads.
* New feature: function for printing a value of arbitrary type.
* New feature: function ExplainMatchResult() for easy definition of
composite matchers.
* The new matcher API lets user-defined matchers generate custom
explanations more directly and efficiently.
* Better failure messages all around.
* NotNull() and IsNull() now work with smart pointers.
* Field() and Property() now work when the matcher argument is a pointer
passed by reference.
* Regular expression matchers on all platforms.
* Added GCC 4.0 support for Google Mock Doctor.
* Added gmock_all_test.cc for compiling most Google Mock tests
in a single file.
* Significantly cleaned up compiler warnings.
* Bug fixes, better test coverage, and implementation clean-ups.
Potentially breaking changes:
* Custom matchers defined using MatcherInterface or MakePolymorphicMatcher()
need to be updated after upgrading to Google Mock 1.5.0; matchers defined
using MATCHER or MATCHER_P* aren't affected.
* Dropped support for 'make install'.
Changes for 1.4.0 (we skipped 1.2.* and 1.3.* to match the version of
Google Test):
* Works in more environments: Symbian and minGW, Visual C++ 7.1.
* Lighter weight: comes with our own implementation of TR1 tuple (no
more dependency on Boost!).
* New feature: --gmock_catch_leaked_mocks for detecting leaked mocks.
* New feature: ACTION_TEMPLATE for defining templatized actions.
* New feature: the .After() clause for specifying expectation order.
* New feature: the .With() clause for specifying inter-argument
constraints.
* New feature: actions ReturnArg<k>(), ReturnNew<T>(...), and
DeleteArg<k>().
* New feature: matchers Key(), Pair(), Args<...>(), AllArgs(), IsNull(),
and Contains().
* New feature: utility class MockFunction<F>, useful for checkpoints, etc.
* New feature: functions Value(x, m) and SafeMatcherCast<T>(m).
* New feature: copying a mock object is rejected at compile time.
* New feature: a script for fusing all Google Mock and Google Test
source files for easy deployment.
* Improved the Google Mock doctor to diagnose more diseases.
* Improved the Google Mock generator script.
* Compatibility fixes for Mac OS X and gcc.
* Bug fixes and implementation clean-ups.
Changes for 1.1.0:
* New feature: ability to use Google Mock with any testing framework.
* New feature: macros for easily defining new matchers
* New feature: macros for easily defining new actions.
* New feature: more container matchers.
* New feature: actions for accessing function arguments and throwing
exceptions.
* Improved the Google Mock doctor script for diagnosing compiler errors.
* Bug fixes and implementation clean-ups.
Changes for 1.0.0:
* Initial Open Source release of Google Mock
...@@ -75,18 +75,6 @@ set(gmock_build_include_dirs ...@@ -75,18 +75,6 @@ set(gmock_build_include_dirs
"${gtest_SOURCE_DIR}") "${gtest_SOURCE_DIR}")
include_directories(${gmock_build_include_dirs}) 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 # Defines the gmock & gmock_main libraries. User tests should link
...@@ -199,25 +187,12 @@ $env:Path = \"$project_bin;$env:Path\" ...@@ -199,25 +187,12 @@ $env:Path = \"$project_bin;$env:Path\"
cxx_library(gmock_main_no_rtti "${cxx_no_rtti}" cxx_library(gmock_main_no_rtti "${cxx_no_rtti}"
"${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc) "${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() else()
cxx_library(gmock_main_no_exception "${cxx_no_exception}" src/gmock_main.cc) cxx_library(gmock_main_no_exception "${cxx_no_exception}" src/gmock_main.cc)
target_link_libraries(gmock_main_no_exception PUBLIC gmock) target_link_libraries(gmock_main_no_exception PUBLIC gmock)
cxx_library(gmock_main_no_rtti "${cxx_no_rtti}" src/gmock_main.cc) cxx_library(gmock_main_no_rtti "${cxx_no_rtti}" src/gmock_main.cc)
target_link_libraries(gmock_main_no_rtti PUBLIC gmock) 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() endif()
cxx_test_with_flags(gmock-more-actions_no_exception_test "${cxx_no_exception}" cxx_test_with_flags(gmock-more-actions_no_exception_test "${cxx_no_exception}"
gmock_main_no_exception test/gmock-more-actions_test.cc) gmock_main_no_exception test/gmock-more-actions_test.cc)
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include <algorithm> #include <algorithm>
#include <string> #include <string>
#include <utility>
#include "gmock/internal/gmock-internal-utils.h" #include "gmock/internal/gmock-internal-utils.h"
#include "gmock/internal/gmock-port.h" #include "gmock/internal/gmock-port.h"
...@@ -439,7 +440,7 @@ class Action { ...@@ -439,7 +440,7 @@ class Action {
// template <typename Result, typename ArgumentTuple> // template <typename Result, typename ArgumentTuple>
// Result Perform(const ArgumentTuple& args) const { // Result Perform(const ArgumentTuple& args) const {
// // Processes the arguments and returns a result, using // // 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.
// } // }
// ... // ...
// }; // };
...@@ -527,7 +528,7 @@ class ActionAdaptor : public ActionInterface<F1> { ...@@ -527,7 +528,7 @@ class ActionAdaptor : public ActionInterface<F1> {
// on return. Useful for move-only types, but could be used on any type. // on return. Useful for move-only types, but could be used on any type.
template <typename T> template <typename T>
struct ByMoveWrapper { struct ByMoveWrapper {
explicit ByMoveWrapper(T value) : payload(internal::move(value)) {} explicit ByMoveWrapper(T value) : payload(std::move(value)) {}
T payload; T payload;
}; };
...@@ -564,7 +565,7 @@ class ReturnAction { ...@@ -564,7 +565,7 @@ class ReturnAction {
// Constructs a ReturnAction object from the value to be returned. // Constructs a ReturnAction object from the value to be returned.
// 'value' is passed by value instead of by const reference in order // 'value' is passed by value instead of by const reference in order
// to allow Return("string literal") to compile. // to allow Return("string literal") to compile.
explicit ReturnAction(R value) : value_(new R(internal::move(value))) {} explicit ReturnAction(R value) : value_(new R(std::move(value))) {}
// This template type conversion operator allows Return(x) to be // This template type conversion operator allows Return(x) to be
// used in ANY function that returns x's type. // used in ANY function that returns x's type.
...@@ -632,7 +633,7 @@ class ReturnAction { ...@@ -632,7 +633,7 @@ class ReturnAction {
GTEST_CHECK_(!performed_) GTEST_CHECK_(!performed_)
<< "A ByMove() action should only be performed once."; << "A ByMove() action should only be performed once.";
performed_ = true; performed_ = true;
return internal::move(wrapper_->payload); return std::move(wrapper_->payload);
} }
private: private:
...@@ -838,7 +839,7 @@ class SetArgumentPointeeAction { ...@@ -838,7 +839,7 @@ class SetArgumentPointeeAction {
template <typename Result, typename ArgumentTuple> template <typename Result, typename ArgumentTuple>
void Perform(const ArgumentTuple& args) const { void Perform(const ArgumentTuple& args) const {
CompileAssertTypesEqual<void, Result>(); CompileAssertTypesEqual<void, Result>();
*::testing::get<N>(args) = value_; *::std::get<N>(args) = value_;
} }
private: private:
...@@ -861,7 +862,7 @@ class SetArgumentPointeeAction<N, Proto, true> { ...@@ -861,7 +862,7 @@ class SetArgumentPointeeAction<N, Proto, true> {
template <typename Result, typename ArgumentTuple> template <typename Result, typename ArgumentTuple>
void Perform(const ArgumentTuple& args) const { void Perform(const ArgumentTuple& args) const {
CompileAssertTypesEqual<void, Result>(); CompileAssertTypesEqual<void, Result>();
::testing::get<N>(args)->CopyFrom(*proto_); ::std::get<N>(args)->CopyFrom(*proto_);
} }
private: private:
...@@ -1116,7 +1117,7 @@ Action<To>::Action(const Action<From>& from) ...@@ -1116,7 +1117,7 @@ Action<To>::Action(const Action<From>& from)
// will trigger a compiler error about using array as initializer. // will trigger a compiler error about using array as initializer.
template <typename R> template <typename R>
internal::ReturnAction<R> Return(R value) { internal::ReturnAction<R> Return(R value) {
return internal::ReturnAction<R>(internal::move(value)); return internal::ReturnAction<R>(std::move(value));
} }
// Creates an action that returns NULL. // Creates an action that returns NULL.
...@@ -1149,7 +1150,7 @@ inline internal::ReturnRefOfCopyAction<R> ReturnRefOfCopy(const R& x) { ...@@ -1149,7 +1150,7 @@ inline internal::ReturnRefOfCopyAction<R> ReturnRefOfCopy(const R& x) {
// invariant. // invariant.
template <typename R> template <typename R>
internal::ByMoveWrapper<R> ByMove(R x) { internal::ByMoveWrapper<R> ByMove(R x) {
return internal::ByMoveWrapper<R>(internal::move(x)); return internal::ByMoveWrapper<R>(std::move(x));
} }
// Creates an action that does the default action for the give mock function. // Creates an action that does the default action for the give mock function.
......
...@@ -41,6 +41,8 @@ ...@@ -41,6 +41,8 @@
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_ #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_ #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
#include <utility>
#include "gmock/gmock-actions.h" #include "gmock/gmock-actions.h"
#include "gmock/internal/gmock-port.h" #include "gmock/internal/gmock-port.h"
...@@ -54,164 +56,167 @@ template <typename Result, typename ArgumentTuple> ...@@ -54,164 +56,167 @@ template <typename Result, typename ArgumentTuple>
class InvokeHelper; class InvokeHelper;
template <typename R> template <typename R>
class InvokeHelper<R, ::testing::tuple<> > { class InvokeHelper<R, ::std::tuple<> > {
public: public:
template <typename Function> template <typename Function>
static R Invoke(Function function, const ::testing::tuple<>&) { static R Invoke(Function function, const ::std::tuple<>&) {
return function(); return function();
} }
template <class Class, typename MethodPtr> template <class Class, typename MethodPtr>
static R InvokeMethod(Class* obj_ptr, static R InvokeMethod(Class* obj_ptr,
MethodPtr method_ptr, MethodPtr method_ptr,
const ::testing::tuple<>&) { const ::std::tuple<>&) {
return (obj_ptr->*method_ptr)(); return (obj_ptr->*method_ptr)();
} }
template <typename CallbackType> template <typename CallbackType>
static R InvokeCallback(CallbackType* callback, static R InvokeCallback(CallbackType* callback,
const ::testing::tuple<>&) { const ::std::tuple<>&) {
return callback->Run(); return callback->Run();
} }
}; };
template <typename R, typename A1> template <typename R, typename A1>
class InvokeHelper<R, ::testing::tuple<A1> > { class InvokeHelper<R, ::std::tuple<A1> > {
public: public:
template <typename Function> template <typename Function>
static R Invoke(Function function, const ::testing::tuple<A1>& args) { static R Invoke(Function function, const ::std::tuple<A1>& args) {
return function(get<0>(args)); return function(std::get<0>(args));
} }
template <class Class, typename MethodPtr> template <class Class, typename MethodPtr>
static R InvokeMethod(Class* obj_ptr, static R InvokeMethod(Class* obj_ptr,
MethodPtr method_ptr, MethodPtr method_ptr,
const ::testing::tuple<A1>& args) { const ::std::tuple<A1>& args) {
return (obj_ptr->*method_ptr)(get<0>(args)); return (obj_ptr->*method_ptr)(std::get<0>(args));
} }
template <typename CallbackType> template <typename CallbackType>
static R InvokeCallback(CallbackType* callback, static R InvokeCallback(CallbackType* callback,
const ::testing::tuple<A1>& args) { const ::std::tuple<A1>& args) {
return callback->Run(get<0>(args)); return callback->Run(std::get<0>(args));
} }
}; };
template <typename R, typename A1, typename A2> template <typename R, typename A1, typename A2>
class InvokeHelper<R, ::testing::tuple<A1, A2> > { class InvokeHelper<R, ::std::tuple<A1, A2> > {
public: public:
template <typename Function> template <typename Function>
static R Invoke(Function function, const ::testing::tuple<A1, A2>& args) { static R Invoke(Function function, const ::std::tuple<A1, A2>& args) {
return function(get<0>(args), get<1>(args)); return function(std::get<0>(args), std::get<1>(args));
} }
template <class Class, typename MethodPtr> template <class Class, typename MethodPtr>
static R InvokeMethod(Class* obj_ptr, static R InvokeMethod(Class* obj_ptr,
MethodPtr method_ptr, MethodPtr method_ptr,
const ::testing::tuple<A1, A2>& args) { const ::std::tuple<A1, A2>& args) {
return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args)); return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args));
} }
template <typename CallbackType> template <typename CallbackType>
static R InvokeCallback(CallbackType* callback, static R InvokeCallback(CallbackType* callback,
const ::testing::tuple<A1, A2>& args) { const ::std::tuple<A1, A2>& args) {
return callback->Run(get<0>(args), get<1>(args)); return callback->Run(std::get<0>(args), std::get<1>(args));
} }
}; };
template <typename R, typename A1, typename A2, typename A3> 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: public:
template <typename Function> template <typename Function>
static R Invoke(Function function, const ::testing::tuple<A1, A2, A3>& args) { static R Invoke(Function function, const ::std::tuple<A1, A2, A3>& args) {
return function(get<0>(args), get<1>(args), get<2>(args)); return function(std::get<0>(args), std::get<1>(args),
std::get<2>(args));
} }
template <class Class, typename MethodPtr> template <class Class, typename MethodPtr>
static R InvokeMethod(Class* obj_ptr, static R InvokeMethod(Class* obj_ptr,
MethodPtr method_ptr, MethodPtr method_ptr,
const ::testing::tuple<A1, A2, A3>& args) { const ::std::tuple<A1, A2, A3>& args) {
return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args),
get<2>(args)); std::get<2>(args));
} }
template <typename CallbackType> template <typename CallbackType>
static R InvokeCallback(CallbackType* callback, static R InvokeCallback(CallbackType* callback,
const ::testing::tuple<A1, A2, A3>& args) { const ::std::tuple<A1, A2, A3>& args) {
return callback->Run(get<0>(args), get<1>(args), get<2>(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> 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: public:
template <typename Function> template <typename Function>
static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, static R Invoke(Function function, const ::std::tuple<A1, A2, A3, A4>& args) {
A4>& args) { return function(std::get<0>(args), std::get<1>(args),
return function(get<0>(args), get<1>(args), get<2>(args), std::get<2>(args), std::get<3>(args));
get<3>(args));
} }
template <class Class, typename MethodPtr> template <class Class, typename MethodPtr>
static R InvokeMethod(Class* obj_ptr, static R InvokeMethod(Class* obj_ptr,
MethodPtr method_ptr, MethodPtr method_ptr,
const ::testing::tuple<A1, A2, A3, A4>& args) { const ::std::tuple<A1, A2, A3, A4>& args) {
return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args),
get<2>(args), get<3>(args)); std::get<2>(args), std::get<3>(args));
} }
template <typename CallbackType> template <typename CallbackType>
static R InvokeCallback(CallbackType* callback, static R InvokeCallback(CallbackType* callback,
const ::testing::tuple<A1, A2, A3, A4>& args) { const ::std::tuple<A1, A2, A3, A4>& args) {
return callback->Run(get<0>(args), get<1>(args), get<2>(args), return callback->Run(std::get<0>(args), std::get<1>(args),
get<3>(args)); std::get<2>(args), std::get<3>(args));
} }
}; };
template <typename R, typename A1, typename A2, typename A3, typename A4, template <typename R, typename A1, typename A2, typename A3, typename A4,
typename A5> typename A5>
class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5> > { class InvokeHelper<R, ::std::tuple<A1, A2, A3, A4, A5> > {
public: public:
template <typename Function> 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) { A5>& args) {
return function(get<0>(args), get<1>(args), get<2>(args), return function(std::get<0>(args), std::get<1>(args),
get<3>(args), get<4>(args)); std::get<2>(args), std::get<3>(args), std::get<4>(args));
} }
template <class Class, typename MethodPtr> template <class Class, typename MethodPtr>
static R InvokeMethod(Class* obj_ptr, static R InvokeMethod(Class* obj_ptr,
MethodPtr method_ptr, MethodPtr method_ptr,
const ::testing::tuple<A1, A2, A3, A4, A5>& args) { const ::std::tuple<A1, A2, A3, A4, A5>& args) {
return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args),
get<2>(args), get<3>(args), get<4>(args)); std::get<2>(args), std::get<3>(args), std::get<4>(args));
} }
template <typename CallbackType> template <typename CallbackType>
static R InvokeCallback(CallbackType* callback, static R InvokeCallback(CallbackType* callback,
const ::testing::tuple<A1, A2, A3, A4, A5>& args) { const ::std::tuple<A1, A2, A3, A4, A5>& args) {
return callback->Run(get<0>(args), get<1>(args), get<2>(args), return callback->Run(std::get<0>(args), std::get<1>(args),
get<3>(args), get<4>(args)); std::get<2>(args), std::get<3>(args), std::get<4>(args));
} }
}; };
template <typename R, typename A1, typename A2, typename A3, typename A4, template <typename R, typename A1, typename A2, typename A3, typename A4,
typename A5, typename A6> 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: public:
template <typename Function> 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) { A6>& args) {
return function(get<0>(args), get<1>(args), get<2>(args), return function(std::get<0>(args), std::get<1>(args),
get<3>(args), get<4>(args), get<5>(args)); std::get<2>(args), std::get<3>(args), std::get<4>(args),
std::get<5>(args));
} }
template <class Class, typename MethodPtr> template <class Class, typename MethodPtr>
static R InvokeMethod(Class* obj_ptr, static R InvokeMethod(Class* obj_ptr,
MethodPtr method_ptr, MethodPtr method_ptr,
const ::testing::tuple<A1, A2, A3, A4, A5, A6>& args) { const ::std::tuple<A1, A2, A3, A4, A5, A6>& args) {
return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args),
get<2>(args), get<3>(args), get<4>(args), get<5>(args)); std::get<2>(args), std::get<3>(args), std::get<4>(args),
std::get<5>(args));
} }
// There is no InvokeCallback() for 6-tuples // There is no InvokeCallback() for 6-tuples
...@@ -219,23 +224,23 @@ class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6> > { ...@@ -219,23 +224,23 @@ class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6> > {
template <typename R, typename A1, typename A2, typename A3, typename A4, template <typename R, typename A1, typename A2, typename A3, typename A4,
typename A5, typename A6, typename A7> 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: public:
template <typename Function> 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,
A6, A7>& args) { A7>& args) {
return function(get<0>(args), get<1>(args), get<2>(args), return function(std::get<0>(args), std::get<1>(args),
get<3>(args), get<4>(args), get<5>(args), get<6>(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> template <class Class, typename MethodPtr>
static R InvokeMethod(Class* obj_ptr, static R InvokeMethod(Class* obj_ptr,
MethodPtr method_ptr, MethodPtr method_ptr,
const ::testing::tuple<A1, A2, A3, A4, A5, A6, const ::std::tuple<A1, A2, A3, A4, A5, A6, A7>& args) {
A7>& args) { return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args),
return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), std::get<2>(args), std::get<3>(args), std::get<4>(args),
get<2>(args), get<3>(args), get<4>(args), get<5>(args), std::get<5>(args), std::get<6>(args));
get<6>(args));
} }
// There is no InvokeCallback() for 7-tuples // There is no InvokeCallback() for 7-tuples
...@@ -243,24 +248,24 @@ class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> > { ...@@ -243,24 +248,24 @@ class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> > {
template <typename R, typename A1, typename A2, typename A3, typename A4, template <typename R, typename A1, typename A2, typename A3, typename A4,
typename A5, typename A6, typename A7, typename A8> 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: public:
template <typename Function> 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,
A6, A7, A8>& args) { A7, A8>& args) {
return function(get<0>(args), get<1>(args), get<2>(args), return function(std::get<0>(args), std::get<1>(args),
get<3>(args), get<4>(args), get<5>(args), get<6>(args), std::get<2>(args), std::get<3>(args), std::get<4>(args),
get<7>(args)); std::get<5>(args), std::get<6>(args), std::get<7>(args));
} }
template <class Class, typename MethodPtr> template <class Class, typename MethodPtr>
static R InvokeMethod(Class* obj_ptr, static R InvokeMethod(Class* obj_ptr,
MethodPtr method_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) { A8>& args) {
return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args),
get<2>(args), get<3>(args), get<4>(args), get<5>(args), std::get<2>(args), std::get<3>(args), std::get<4>(args),
get<6>(args), get<7>(args)); std::get<5>(args), std::get<6>(args), std::get<7>(args));
} }
// There is no InvokeCallback() for 8-tuples // There is no InvokeCallback() for 8-tuples
...@@ -268,24 +273,26 @@ class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > { ...@@ -268,24 +273,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, template <typename R, typename A1, typename A2, typename A3, typename A4,
typename A5, typename A6, typename A7, typename A8, typename A9> 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: public:
template <typename Function> 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,
A6, A7, A8, A9>& args) { A7, A8, A9>& args) {
return function(get<0>(args), get<1>(args), get<2>(args), return function(std::get<0>(args), std::get<1>(args),
get<3>(args), get<4>(args), get<5>(args), get<6>(args), std::get<2>(args), std::get<3>(args), std::get<4>(args),
get<7>(args), get<8>(args)); std::get<5>(args), std::get<6>(args), std::get<7>(args),
std::get<8>(args));
} }
template <class Class, typename MethodPtr> template <class Class, typename MethodPtr>
static R InvokeMethod(Class* obj_ptr, static R InvokeMethod(Class* obj_ptr,
MethodPtr method_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) { A9>& args) {
return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args),
get<2>(args), get<3>(args), get<4>(args), get<5>(args), std::get<2>(args), std::get<3>(args), std::get<4>(args),
get<6>(args), get<7>(args), get<8>(args)); std::get<5>(args), std::get<6>(args), std::get<7>(args),
std::get<8>(args));
} }
// There is no InvokeCallback() for 9-tuples // There is no InvokeCallback() for 9-tuples
...@@ -294,25 +301,26 @@ class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > { ...@@ -294,25 +301,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, template <typename R, typename A1, typename A2, typename A3, typename A4,
typename A5, typename A6, typename A7, typename A8, typename A9, typename A5, typename A6, typename A7, typename A8, typename A9,
typename A10> typename A10>
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, A10> > {
A10> > {
public: public:
template <typename Function> 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,
A6, A7, A8, A9, A10>& args) { A7, A8, A9, A10>& args) {
return function(get<0>(args), get<1>(args), get<2>(args), return function(std::get<0>(args), std::get<1>(args),
get<3>(args), get<4>(args), get<5>(args), get<6>(args), std::get<2>(args), std::get<3>(args), std::get<4>(args),
get<7>(args), get<8>(args), get<9>(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> template <class Class, typename MethodPtr>
static R InvokeMethod(Class* obj_ptr, static R InvokeMethod(Class* obj_ptr,
MethodPtr method_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,
A9, A10>& args) { A10>& args) {
return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args),
get<2>(args), get<3>(args), get<4>(args), get<5>(args), std::get<2>(args), std::get<3>(args), std::get<4>(args),
get<6>(args), get<7>(args), get<8>(args), get<9>(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 // There is no InvokeCallback() for 10-tuples
...@@ -346,20 +354,20 @@ class InvokeCallbackAction { ...@@ -346,20 +354,20 @@ class InvokeCallbackAction {
// An INTERNAL macro for extracting the type of a tuple field. It's // An INTERNAL macro for extracting the type of a tuple field. It's
// subject to change without notice - DO NOT USE IN USER CODE! // subject to change without notice - DO NOT USE IN USER CODE!
#define GMOCK_FIELD_(Tuple, N) \ #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 // 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 // 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 // k{i}-th (0-based) field of ArgumentTuple, which must be a tuple
// type, and whose return type is Result. For example, // 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). // is int(bool, long).
// //
// SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::Select(args) // SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::Select(args)
// returns the selected fields (k1, k2, ..., k_n) of args as a tuple. // returns the selected fields (k1, k2, ..., k_n) of args as a tuple.
// For example, // For example,
// SelectArgs<int, tuple<bool, char, double>, 2, 0>::Select( // SelectArgs<int, std::tuple<bool, char, double>, 2, 0>::Select(
// ::testing::make_tuple(true, 'a', 2.5)) // ::std::make_tuple(true, 'a', 2.5))
// returns tuple (2.5, true). // returns tuple (2.5, true).
// //
// The numbers in list k1, k2, ..., k_n must be >= 0, where n can be // The numbers in list k1, k2, ..., k_n must be >= 0, where n can be
...@@ -378,9 +386,10 @@ class SelectArgs { ...@@ -378,9 +386,10 @@ class SelectArgs {
GMOCK_FIELD_(ArgumentTuple, k10)); GMOCK_FIELD_(ArgumentTuple, k10));
typedef typename Function<type>::ArgumentTuple SelectedArgs; typedef typename Function<type>::ArgumentTuple SelectedArgs;
static SelectedArgs Select(const ArgumentTuple& args) { 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),
get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args), std::get<k3>(args), std::get<k4>(args), std::get<k5>(args),
get<k8>(args), get<k9>(args), get<k10>(args)); std::get<k6>(args), std::get<k7>(args), std::get<k8>(args),
std::get<k9>(args), std::get<k10>(args));
} }
}; };
...@@ -402,7 +411,7 @@ class SelectArgs<Result, ArgumentTuple, ...@@ -402,7 +411,7 @@ class SelectArgs<Result, ArgumentTuple,
typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1)); typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1));
typedef typename Function<type>::ArgumentTuple SelectedArgs; typedef typename Function<type>::ArgumentTuple SelectedArgs;
static SelectedArgs Select(const ArgumentTuple& args) { static SelectedArgs Select(const ArgumentTuple& args) {
return SelectedArgs(get<k1>(args)); return SelectedArgs(std::get<k1>(args));
} }
}; };
...@@ -414,7 +423,7 @@ class SelectArgs<Result, ArgumentTuple, ...@@ -414,7 +423,7 @@ class SelectArgs<Result, ArgumentTuple,
GMOCK_FIELD_(ArgumentTuple, k2)); GMOCK_FIELD_(ArgumentTuple, k2));
typedef typename Function<type>::ArgumentTuple SelectedArgs; typedef typename Function<type>::ArgumentTuple SelectedArgs;
static SelectedArgs Select(const ArgumentTuple& args) { 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 +435,8 @@ class SelectArgs<Result, ArgumentTuple, ...@@ -426,7 +435,8 @@ class SelectArgs<Result, ArgumentTuple,
GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3)); GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3));
typedef typename Function<type>::ArgumentTuple SelectedArgs; typedef typename Function<type>::ArgumentTuple SelectedArgs;
static SelectedArgs Select(const ArgumentTuple& args) { 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 +450,8 @@ class SelectArgs<Result, ArgumentTuple, ...@@ -440,8 +450,8 @@ class SelectArgs<Result, ArgumentTuple,
GMOCK_FIELD_(ArgumentTuple, k4)); GMOCK_FIELD_(ArgumentTuple, k4));
typedef typename Function<type>::ArgumentTuple SelectedArgs; typedef typename Function<type>::ArgumentTuple SelectedArgs;
static SelectedArgs Select(const ArgumentTuple& args) { 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),
get<k4>(args)); std::get<k3>(args), std::get<k4>(args));
} }
}; };
...@@ -455,8 +465,8 @@ class SelectArgs<Result, ArgumentTuple, ...@@ -455,8 +465,8 @@ class SelectArgs<Result, ArgumentTuple,
GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5)); GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5));
typedef typename Function<type>::ArgumentTuple SelectedArgs; typedef typename Function<type>::ArgumentTuple SelectedArgs;
static SelectedArgs Select(const ArgumentTuple& args) { 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),
get<k4>(args), get<k5>(args)); std::get<k3>(args), std::get<k4>(args), std::get<k5>(args));
} }
}; };
...@@ -471,8 +481,9 @@ class SelectArgs<Result, ArgumentTuple, ...@@ -471,8 +481,9 @@ class SelectArgs<Result, ArgumentTuple,
GMOCK_FIELD_(ArgumentTuple, k6)); GMOCK_FIELD_(ArgumentTuple, k6));
typedef typename Function<type>::ArgumentTuple SelectedArgs; typedef typename Function<type>::ArgumentTuple SelectedArgs;
static SelectedArgs Select(const ArgumentTuple& args) { 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),
get<k4>(args), get<k5>(args), get<k6>(args)); std::get<k3>(args), std::get<k4>(args), std::get<k5>(args),
std::get<k6>(args));
} }
}; };
...@@ -487,8 +498,9 @@ class SelectArgs<Result, ArgumentTuple, ...@@ -487,8 +498,9 @@ class SelectArgs<Result, ArgumentTuple,
GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7)); GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7));
typedef typename Function<type>::ArgumentTuple SelectedArgs; typedef typename Function<type>::ArgumentTuple SelectedArgs;
static SelectedArgs Select(const ArgumentTuple& args) { 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),
get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args)); std::get<k3>(args), std::get<k4>(args), std::get<k5>(args),
std::get<k6>(args), std::get<k7>(args));
} }
}; };
...@@ -504,9 +516,9 @@ class SelectArgs<Result, ArgumentTuple, ...@@ -504,9 +516,9 @@ class SelectArgs<Result, ArgumentTuple,
GMOCK_FIELD_(ArgumentTuple, k8)); GMOCK_FIELD_(ArgumentTuple, k8));
typedef typename Function<type>::ArgumentTuple SelectedArgs; typedef typename Function<type>::ArgumentTuple SelectedArgs;
static SelectedArgs Select(const ArgumentTuple& args) { 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),
get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args), std::get<k3>(args), std::get<k4>(args), std::get<k5>(args),
get<k8>(args)); std::get<k6>(args), std::get<k7>(args), std::get<k8>(args));
} }
}; };
...@@ -522,9 +534,10 @@ class SelectArgs<Result, ArgumentTuple, ...@@ -522,9 +534,10 @@ class SelectArgs<Result, ArgumentTuple,
GMOCK_FIELD_(ArgumentTuple, k8), GMOCK_FIELD_(ArgumentTuple, k9)); GMOCK_FIELD_(ArgumentTuple, k8), GMOCK_FIELD_(ArgumentTuple, k9));
typedef typename Function<type>::ArgumentTuple SelectedArgs; typedef typename Function<type>::ArgumentTuple SelectedArgs;
static SelectedArgs Select(const ArgumentTuple& args) { 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),
get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args), std::get<k3>(args), std::get<k4>(args), std::get<k5>(args),
get<k8>(args), get<k9>(args)); std::get<k6>(args), std::get<k7>(args), std::get<k8>(args),
std::get<k9>(args));
} }
}; };
...@@ -587,7 +600,7 @@ struct ExcessiveArg {}; ...@@ -587,7 +600,7 @@ struct ExcessiveArg {};
template <typename Result, class Impl> template <typename Result, class Impl>
class ActionHelper { class ActionHelper {
public: 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(), return impl->template gmock_PerformImpl<>(args, ExcessiveArg(),
ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
...@@ -595,95 +608,96 @@ class ActionHelper { ...@@ -595,95 +608,96 @@ class ActionHelper {
} }
template <typename A0> template <typename A0>
static Result Perform(Impl* impl, const ::testing::tuple<A0>& args) { static Result Perform(Impl* impl, const ::std::tuple<A0>& args) {
return impl->template gmock_PerformImpl<A0>(args, get<0>(args), return impl->template gmock_PerformImpl<A0>(args, std::get<0>(args),
ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
ExcessiveArg()); ExcessiveArg());
} }
template <typename A0, typename A1> template <typename A0, typename A1>
static Result Perform(Impl* impl, const ::testing::tuple<A0, A1>& args) { static Result Perform(Impl* impl, const ::std::tuple<A0, A1>& args) {
return impl->template gmock_PerformImpl<A0, A1>(args, get<0>(args), return impl->template gmock_PerformImpl<A0, A1>(args, std::get<0>(args),
get<1>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), std::get<1>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
ExcessiveArg()); ExcessiveArg());
} }
template <typename A0, typename A1, typename A2> template <typename A0, typename A1, typename A2>
static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2>& args) { static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2>& args) {
return impl->template gmock_PerformImpl<A0, A1, A2>(args, get<0>(args), return impl->template gmock_PerformImpl<A0, A1, A2>(args,
get<1>(args), get<2>(args), ExcessiveArg(), ExcessiveArg(), std::get<0>(args), std::get<1>(args), std::get<2>(args),
ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
ExcessiveArg()); ExcessiveArg(), ExcessiveArg(), ExcessiveArg());
} }
template <typename A0, typename A1, typename A2, typename A3> template <typename A0, typename A1, typename A2, typename A3>
static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2, A3>& args) {
A3>& args) { return impl->template gmock_PerformImpl<A0, A1, A2, A3>(args,
return impl->template gmock_PerformImpl<A0, A1, A2, A3>(args, get<0>(args), std::get<0>(args), std::get<1>(args), std::get<2>(args),
get<1>(args), get<2>(args), get<3>(args), ExcessiveArg(), std::get<3>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg());
ExcessiveArg());
} }
template <typename A0, typename A1, typename A2, typename A3, typename A4> 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) { A4>& args) {
return impl->template gmock_PerformImpl<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), std::get<0>(args), std::get<1>(args), std::get<2>(args),
ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), std::get<3>(args), std::get<4>(args), ExcessiveArg(), ExcessiveArg(),
ExcessiveArg()); ExcessiveArg(), ExcessiveArg(), ExcessiveArg());
} }
template <typename A0, typename A1, typename A2, typename A3, typename A4, template <typename A0, typename A1, typename A2, typename A3, typename A4,
typename A5> 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) { A5>& args) {
return impl->template gmock_PerformImpl<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), std::get<0>(args), std::get<1>(args), std::get<2>(args),
get<5>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), std::get<3>(args), std::get<4>(args), std::get<5>(args),
ExcessiveArg()); ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg());
} }
template <typename A0, typename A1, typename A2, typename A3, typename A4, template <typename A0, typename A1, typename A2, typename A3, typename A4,
typename A5, typename A6> typename A5, typename A6>
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,
A5, A6>& args) { A6>& args) {
return impl->template gmock_PerformImpl<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), std::get<0>(args), std::get<1>(args), std::get<2>(args),
get<5>(args), get<6>(args), ExcessiveArg(), ExcessiveArg(), std::get<3>(args), std::get<4>(args), std::get<5>(args),
ExcessiveArg()); std::get<6>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg());
} }
template <typename A0, typename A1, typename A2, typename A3, typename A4, template <typename A0, typename A1, typename A2, typename A3, typename A4,
typename A5, typename A6, typename A7> typename A5, typename A6, typename A7>
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,
A5, A6, A7>& args) { A6, A7>& args) {
return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, 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), A7>(args, std::get<0>(args), std::get<1>(args), std::get<2>(args),
get<4>(args), get<5>(args), get<6>(args), get<7>(args), ExcessiveArg(), std::get<3>(args), std::get<4>(args), std::get<5>(args),
ExcessiveArg()); std::get<6>(args), std::get<7>(args), ExcessiveArg(), ExcessiveArg());
} }
template <typename A0, typename A1, typename A2, typename A3, typename A4, template <typename A0, typename A1, typename A2, typename A3, typename A4,
typename A5, typename A6, typename A7, typename A8> typename A5, typename A6, typename A7, typename A8>
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,
A5, A6, A7, A8>& args) { A6, A7, A8>& args) {
return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, A7, 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), A8>(args, std::get<0>(args), std::get<1>(args), std::get<2>(args),
get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(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()); ExcessiveArg());
} }
template <typename A0, typename A1, typename A2, typename A3, typename A4, template <typename A0, typename A1, typename A2, typename A3, typename A4,
typename A5, typename A6, typename A7, typename A8, typename A9> typename A5, typename A6, typename A7, typename A8, typename A9>
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,
A5, A6, A7, A8, A9>& args) { A6, A7, A8, A9>& args) {
return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, A7, A8, 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), A9>(args, std::get<0>(args), std::get<1>(args), std::get<2>(args),
get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args), std::get<3>(args), std::get<4>(args), std::get<5>(args),
get<9>(args)); std::get<6>(args), std::get<7>(args), std::get<8>(args),
std::get<9>(args));
} }
}; };
...@@ -950,8 +964,8 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, ...@@ -950,8 +964,8 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
// //
// MORE INFORMATION: // MORE INFORMATION:
// //
// To learn more about using these macros, please search for 'ACTION' // To learn more about using these macros, please search for 'ACTION' on
// on https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md // https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md
// An internal macro needed for implementing ACTION*(). // An internal macro needed for implementing ACTION*().
#define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_\ #define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_\
...@@ -991,7 +1005,7 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, ...@@ -991,7 +1005,7 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
// ACTION_TEMPLATE(DuplicateArg, // ACTION_TEMPLATE(DuplicateArg,
// HAS_2_TEMPLATE_PARAMS(int, k, typename, T), // HAS_2_TEMPLATE_PARAMS(int, k, typename, T),
// AND_1_VALUE_PARAMS(output)) { // AND_1_VALUE_PARAMS(output)) {
// *output = T(::testing::get<k>(args)); // *output = T(::std::get<k>(args));
// } // }
// ... // ...
// int n; // int n;
...@@ -1149,90 +1163,67 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, ...@@ -1149,90 +1163,67 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
#define GMOCK_INTERNAL_INIT_AND_0_VALUE_PARAMS()\ #define GMOCK_INTERNAL_INIT_AND_0_VALUE_PARAMS()\
() ()
#define GMOCK_INTERNAL_INIT_AND_1_VALUE_PARAMS(p0)\ #define GMOCK_INTERNAL_INIT_AND_1_VALUE_PARAMS(p0)\
(p0##_type gmock_p0) : p0(::testing::internal::move(gmock_p0)) (p0##_type gmock_p0) : p0(::std::move(gmock_p0))
#define GMOCK_INTERNAL_INIT_AND_2_VALUE_PARAMS(p0, p1)\ #define GMOCK_INTERNAL_INIT_AND_2_VALUE_PARAMS(p0, p1)\
(p0##_type gmock_p0, \ (p0##_type gmock_p0, p1##_type gmock_p1) : p0(::std::move(gmock_p0)), \
p1##_type gmock_p1) : p0(::testing::internal::move(gmock_p0)), \ p1(::std::move(gmock_p1))
p1(::testing::internal::move(gmock_p1))
#define GMOCK_INTERNAL_INIT_AND_3_VALUE_PARAMS(p0, p1, p2)\ #define GMOCK_INTERNAL_INIT_AND_3_VALUE_PARAMS(p0, p1, p2)\
(p0##_type gmock_p0, p1##_type gmock_p1, \ (p0##_type gmock_p0, p1##_type gmock_p1, \
p2##_type gmock_p2) : p0(::testing::internal::move(gmock_p0)), \ p2##_type gmock_p2) : p0(::std::move(gmock_p0)), \
p1(::testing::internal::move(gmock_p1)), \ p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2))
p2(::testing::internal::move(gmock_p2))
#define GMOCK_INTERNAL_INIT_AND_4_VALUE_PARAMS(p0, p1, p2, p3)\ #define GMOCK_INTERNAL_INIT_AND_4_VALUE_PARAMS(p0, p1, p2, p3)\
(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
p3##_type gmock_p3) : p0(::testing::internal::move(gmock_p0)), \ p3##_type gmock_p3) : p0(::std::move(gmock_p0)), \
p1(::testing::internal::move(gmock_p1)), \ p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
p2(::testing::internal::move(gmock_p2)), \ p3(::std::move(gmock_p3))
p3(::testing::internal::move(gmock_p3))
#define GMOCK_INTERNAL_INIT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)\ #define GMOCK_INTERNAL_INIT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)\
(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
p3##_type gmock_p3, \ p3##_type gmock_p3, p4##_type gmock_p4) : p0(::std::move(gmock_p0)), \
p4##_type gmock_p4) : p0(::testing::internal::move(gmock_p0)), \ p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
p1(::testing::internal::move(gmock_p1)), \ p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4))
p2(::testing::internal::move(gmock_p2)), \
p3(::testing::internal::move(gmock_p3)), \
p4(::testing::internal::move(gmock_p4))
#define GMOCK_INTERNAL_INIT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)\ #define GMOCK_INTERNAL_INIT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)\
(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
p3##_type gmock_p3, p4##_type gmock_p4, \ p3##_type gmock_p3, p4##_type gmock_p4, \
p5##_type gmock_p5) : p0(::testing::internal::move(gmock_p0)), \ p5##_type gmock_p5) : p0(::std::move(gmock_p0)), \
p1(::testing::internal::move(gmock_p1)), \ p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
p2(::testing::internal::move(gmock_p2)), \ p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
p3(::testing::internal::move(gmock_p3)), \ p5(::std::move(gmock_p5))
p4(::testing::internal::move(gmock_p4)), \
p5(::testing::internal::move(gmock_p5))
#define GMOCK_INTERNAL_INIT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)\ #define GMOCK_INTERNAL_INIT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)\
(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
p6##_type gmock_p6) : p0(::testing::internal::move(gmock_p0)), \ p6##_type gmock_p6) : p0(::std::move(gmock_p0)), \
p1(::testing::internal::move(gmock_p1)), \ p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
p2(::testing::internal::move(gmock_p2)), \ p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
p3(::testing::internal::move(gmock_p3)), \ p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6))
p4(::testing::internal::move(gmock_p4)), \
p5(::testing::internal::move(gmock_p5)), \
p6(::testing::internal::move(gmock_p6))
#define GMOCK_INTERNAL_INIT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)\ #define GMOCK_INTERNAL_INIT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)\
(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
p6##_type gmock_p6, \ p6##_type gmock_p6, p7##_type gmock_p7) : p0(::std::move(gmock_p0)), \
p7##_type gmock_p7) : p0(::testing::internal::move(gmock_p0)), \ p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
p1(::testing::internal::move(gmock_p1)), \ p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
p2(::testing::internal::move(gmock_p2)), \ p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \
p3(::testing::internal::move(gmock_p3)), \ p7(::std::move(gmock_p7))
p4(::testing::internal::move(gmock_p4)), \
p5(::testing::internal::move(gmock_p5)), \
p6(::testing::internal::move(gmock_p6)), \
p7(::testing::internal::move(gmock_p7))
#define GMOCK_INTERNAL_INIT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ #define GMOCK_INTERNAL_INIT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
p7, p8)\ p7, p8)\
(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
p6##_type gmock_p6, p7##_type gmock_p7, \ p6##_type gmock_p6, p7##_type gmock_p7, \
p8##_type gmock_p8) : p0(::testing::internal::move(gmock_p0)), \ p8##_type gmock_p8) : p0(::std::move(gmock_p0)), \
p1(::testing::internal::move(gmock_p1)), \ p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
p2(::testing::internal::move(gmock_p2)), \ p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
p3(::testing::internal::move(gmock_p3)), \ p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \
p4(::testing::internal::move(gmock_p4)), \ p7(::std::move(gmock_p7)), p8(::std::move(gmock_p8))
p5(::testing::internal::move(gmock_p5)), \
p6(::testing::internal::move(gmock_p6)), \
p7(::testing::internal::move(gmock_p7)), \
p8(::testing::internal::move(gmock_p8))
#define GMOCK_INTERNAL_INIT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ #define GMOCK_INTERNAL_INIT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
p7, p8, p9)\ p7, p8, p9)\
(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \ p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
p9##_type gmock_p9) : p0(::testing::internal::move(gmock_p0)), \ p9##_type gmock_p9) : p0(::std::move(gmock_p0)), \
p1(::testing::internal::move(gmock_p1)), \ p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
p2(::testing::internal::move(gmock_p2)), \ p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
p3(::testing::internal::move(gmock_p3)), \ p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \
p4(::testing::internal::move(gmock_p4)), \ p7(::std::move(gmock_p7)), p8(::std::move(gmock_p8)), \
p5(::testing::internal::move(gmock_p5)), \ p9(::std::move(gmock_p9))
p6(::testing::internal::move(gmock_p6)), \
p7(::testing::internal::move(gmock_p7)), \
p8(::testing::internal::move(gmock_p8)), \
p9(::testing::internal::move(gmock_p9))
// Declares the fields for storing the value parameters. // Declares the fields for storing the value parameters.
#define GMOCK_INTERNAL_DEFN_AND_0_VALUE_PARAMS() #define GMOCK_INTERNAL_DEFN_AND_0_VALUE_PARAMS()
...@@ -1469,7 +1460,7 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, ...@@ -1469,7 +1460,7 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
class name##ActionP {\ class name##ActionP {\
public:\ public:\
explicit name##ActionP(p0##_type gmock_p0) : \ explicit name##ActionP(p0##_type gmock_p0) : \
p0(::testing::internal::forward<p0##_type>(gmock_p0)) {}\ p0(::std::forward<p0##_type>(gmock_p0)) {}\
template <typename F>\ template <typename F>\
class gmock_Impl : public ::testing::ActionInterface<F> {\ class gmock_Impl : public ::testing::ActionInterface<F> {\
public:\ public:\
...@@ -1478,7 +1469,7 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, ...@@ -1478,7 +1469,7 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
typedef typename ::testing::internal::Function<F>::ArgumentTuple\ typedef typename ::testing::internal::Function<F>::ArgumentTuple\
args_type;\ args_type;\
explicit gmock_Impl(p0##_type gmock_p0) : \ explicit gmock_Impl(p0##_type gmock_p0) : \
p0(::testing::internal::forward<p0##_type>(gmock_p0)) {}\ p0(::std::forward<p0##_type>(gmock_p0)) {}\
virtual return_type Perform(const args_type& args) {\ virtual return_type Perform(const args_type& args) {\
return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
Perform(this, args);\ Perform(this, args);\
...@@ -1521,8 +1512,8 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, ...@@ -1521,8 +1512,8 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
class name##ActionP2 {\ class name##ActionP2 {\
public:\ public:\
name##ActionP2(p0##_type gmock_p0, \ name##ActionP2(p0##_type gmock_p0, \
p1##_type gmock_p1) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ p1##_type gmock_p1) : p0(::std::forward<p0##_type>(gmock_p0)), \
p1(::testing::internal::forward<p1##_type>(gmock_p1)) {}\ p1(::std::forward<p1##_type>(gmock_p1)) {}\
template <typename F>\ template <typename F>\
class gmock_Impl : public ::testing::ActionInterface<F> {\ class gmock_Impl : public ::testing::ActionInterface<F> {\
public:\ public:\
...@@ -1531,8 +1522,8 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, ...@@ -1531,8 +1522,8 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
typedef typename ::testing::internal::Function<F>::ArgumentTuple\ typedef typename ::testing::internal::Function<F>::ArgumentTuple\
args_type;\ args_type;\
gmock_Impl(p0##_type gmock_p0, \ gmock_Impl(p0##_type gmock_p0, \
p1##_type gmock_p1) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ p1##_type gmock_p1) : p0(::std::forward<p0##_type>(gmock_p0)), \
p1(::testing::internal::forward<p1##_type>(gmock_p1)) {}\ p1(::std::forward<p1##_type>(gmock_p1)) {}\
virtual return_type Perform(const args_type& args) {\ virtual return_type Perform(const args_type& args) {\
return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
Perform(this, args);\ Perform(this, args);\
...@@ -1578,9 +1569,9 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, ...@@ -1578,9 +1569,9 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
class name##ActionP3 {\ class name##ActionP3 {\
public:\ public:\
name##ActionP3(p0##_type gmock_p0, p1##_type gmock_p1, \ name##ActionP3(p0##_type gmock_p0, p1##_type gmock_p1, \
p2##_type gmock_p2) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ p2##_type gmock_p2) : p0(::std::forward<p0##_type>(gmock_p0)), \
p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ p1(::std::forward<p1##_type>(gmock_p1)), \
p2(::testing::internal::forward<p2##_type>(gmock_p2)) {}\ p2(::std::forward<p2##_type>(gmock_p2)) {}\
template <typename F>\ template <typename F>\
class gmock_Impl : public ::testing::ActionInterface<F> {\ class gmock_Impl : public ::testing::ActionInterface<F> {\
public:\ public:\
...@@ -1589,9 +1580,9 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, ...@@ -1589,9 +1580,9 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
typedef typename ::testing::internal::Function<F>::ArgumentTuple\ typedef typename ::testing::internal::Function<F>::ArgumentTuple\
args_type;\ args_type;\
gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, \ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, \
p2##_type gmock_p2) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ p2##_type gmock_p2) : p0(::std::forward<p0##_type>(gmock_p0)), \
p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ p1(::std::forward<p1##_type>(gmock_p1)), \
p2(::testing::internal::forward<p2##_type>(gmock_p2)) {}\ p2(::std::forward<p2##_type>(gmock_p2)) {}\
virtual return_type Perform(const args_type& args) {\ virtual return_type Perform(const args_type& args) {\
return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
Perform(this, args);\ Perform(this, args);\
...@@ -1642,10 +1633,10 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, ...@@ -1642,10 +1633,10 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
public:\ public:\
name##ActionP4(p0##_type gmock_p0, p1##_type gmock_p1, \ name##ActionP4(p0##_type gmock_p0, p1##_type gmock_p1, \
p2##_type gmock_p2, \ p2##_type gmock_p2, \
p3##_type gmock_p3) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ p3##_type gmock_p3) : p0(::std::forward<p0##_type>(gmock_p0)), \
p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ p1(::std::forward<p1##_type>(gmock_p1)), \
p2(::testing::internal::forward<p2##_type>(gmock_p2)), \ p2(::std::forward<p2##_type>(gmock_p2)), \
p3(::testing::internal::forward<p3##_type>(gmock_p3)) {}\ p3(::std::forward<p3##_type>(gmock_p3)) {}\
template <typename F>\ template <typename F>\
class gmock_Impl : public ::testing::ActionInterface<F> {\ class gmock_Impl : public ::testing::ActionInterface<F> {\
public:\ public:\
...@@ -1654,10 +1645,10 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, ...@@ -1654,10 +1645,10 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
typedef typename ::testing::internal::Function<F>::ArgumentTuple\ typedef typename ::testing::internal::Function<F>::ArgumentTuple\
args_type;\ args_type;\
gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
p3##_type gmock_p3) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ p3##_type gmock_p3) : p0(::std::forward<p0##_type>(gmock_p0)), \
p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ p1(::std::forward<p1##_type>(gmock_p1)), \
p2(::testing::internal::forward<p2##_type>(gmock_p2)), \ p2(::std::forward<p2##_type>(gmock_p2)), \
p3(::testing::internal::forward<p3##_type>(gmock_p3)) {}\ p3(::std::forward<p3##_type>(gmock_p3)) {}\
virtual return_type Perform(const args_type& args) {\ virtual return_type Perform(const args_type& args) {\
return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
Perform(this, args);\ Perform(this, args);\
...@@ -1714,11 +1705,11 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, ...@@ -1714,11 +1705,11 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
public:\ public:\
name##ActionP5(p0##_type gmock_p0, p1##_type gmock_p1, \ name##ActionP5(p0##_type gmock_p0, p1##_type gmock_p1, \
p2##_type gmock_p2, p3##_type gmock_p3, \ p2##_type gmock_p2, p3##_type gmock_p3, \
p4##_type gmock_p4) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ p4##_type gmock_p4) : p0(::std::forward<p0##_type>(gmock_p0)), \
p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ p1(::std::forward<p1##_type>(gmock_p1)), \
p2(::testing::internal::forward<p2##_type>(gmock_p2)), \ p2(::std::forward<p2##_type>(gmock_p2)), \
p3(::testing::internal::forward<p3##_type>(gmock_p3)), \ p3(::std::forward<p3##_type>(gmock_p3)), \
p4(::testing::internal::forward<p4##_type>(gmock_p4)) {}\ p4(::std::forward<p4##_type>(gmock_p4)) {}\
template <typename F>\ template <typename F>\
class gmock_Impl : public ::testing::ActionInterface<F> {\ class gmock_Impl : public ::testing::ActionInterface<F> {\
public:\ public:\
...@@ -1728,11 +1719,11 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, ...@@ -1728,11 +1719,11 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
args_type;\ args_type;\
gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
p3##_type gmock_p3, \ p3##_type gmock_p3, \
p4##_type gmock_p4) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ p4##_type gmock_p4) : p0(::std::forward<p0##_type>(gmock_p0)), \
p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ p1(::std::forward<p1##_type>(gmock_p1)), \
p2(::testing::internal::forward<p2##_type>(gmock_p2)), \ p2(::std::forward<p2##_type>(gmock_p2)), \
p3(::testing::internal::forward<p3##_type>(gmock_p3)), \ p3(::std::forward<p3##_type>(gmock_p3)), \
p4(::testing::internal::forward<p4##_type>(gmock_p4)) {}\ p4(::std::forward<p4##_type>(gmock_p4)) {}\
virtual return_type Perform(const args_type& args) {\ virtual return_type Perform(const args_type& args) {\
return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
Perform(this, args);\ Perform(this, args);\
...@@ -1791,12 +1782,12 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, ...@@ -1791,12 +1782,12 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
public:\ public:\
name##ActionP6(p0##_type gmock_p0, p1##_type gmock_p1, \ name##ActionP6(p0##_type gmock_p0, p1##_type gmock_p1, \
p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
p5##_type gmock_p5) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ p5##_type gmock_p5) : p0(::std::forward<p0##_type>(gmock_p0)), \
p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ p1(::std::forward<p1##_type>(gmock_p1)), \
p2(::testing::internal::forward<p2##_type>(gmock_p2)), \ p2(::std::forward<p2##_type>(gmock_p2)), \
p3(::testing::internal::forward<p3##_type>(gmock_p3)), \ p3(::std::forward<p3##_type>(gmock_p3)), \
p4(::testing::internal::forward<p4##_type>(gmock_p4)), \ p4(::std::forward<p4##_type>(gmock_p4)), \
p5(::testing::internal::forward<p5##_type>(gmock_p5)) {}\ p5(::std::forward<p5##_type>(gmock_p5)) {}\
template <typename F>\ template <typename F>\
class gmock_Impl : public ::testing::ActionInterface<F> {\ class gmock_Impl : public ::testing::ActionInterface<F> {\
public:\ public:\
...@@ -1806,12 +1797,12 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, ...@@ -1806,12 +1797,12 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
args_type;\ args_type;\
gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
p3##_type gmock_p3, p4##_type gmock_p4, \ p3##_type gmock_p3, p4##_type gmock_p4, \
p5##_type gmock_p5) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ p5##_type gmock_p5) : p0(::std::forward<p0##_type>(gmock_p0)), \
p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ p1(::std::forward<p1##_type>(gmock_p1)), \
p2(::testing::internal::forward<p2##_type>(gmock_p2)), \ p2(::std::forward<p2##_type>(gmock_p2)), \
p3(::testing::internal::forward<p3##_type>(gmock_p3)), \ p3(::std::forward<p3##_type>(gmock_p3)), \
p4(::testing::internal::forward<p4##_type>(gmock_p4)), \ p4(::std::forward<p4##_type>(gmock_p4)), \
p5(::testing::internal::forward<p5##_type>(gmock_p5)) {}\ p5(::std::forward<p5##_type>(gmock_p5)) {}\
virtual return_type Perform(const args_type& args) {\ virtual return_type Perform(const args_type& args) {\
return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
Perform(this, args);\ Perform(this, args);\
...@@ -1874,13 +1865,13 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, ...@@ -1874,13 +1865,13 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
name##ActionP7(p0##_type gmock_p0, p1##_type gmock_p1, \ name##ActionP7(p0##_type gmock_p0, p1##_type gmock_p1, \
p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
p5##_type gmock_p5, \ p5##_type gmock_p5, \
p6##_type gmock_p6) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ p6##_type gmock_p6) : p0(::std::forward<p0##_type>(gmock_p0)), \
p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ p1(::std::forward<p1##_type>(gmock_p1)), \
p2(::testing::internal::forward<p2##_type>(gmock_p2)), \ p2(::std::forward<p2##_type>(gmock_p2)), \
p3(::testing::internal::forward<p3##_type>(gmock_p3)), \ p3(::std::forward<p3##_type>(gmock_p3)), \
p4(::testing::internal::forward<p4##_type>(gmock_p4)), \ p4(::std::forward<p4##_type>(gmock_p4)), \
p5(::testing::internal::forward<p5##_type>(gmock_p5)), \ p5(::std::forward<p5##_type>(gmock_p5)), \
p6(::testing::internal::forward<p6##_type>(gmock_p6)) {}\ p6(::std::forward<p6##_type>(gmock_p6)) {}\
template <typename F>\ template <typename F>\
class gmock_Impl : public ::testing::ActionInterface<F> {\ class gmock_Impl : public ::testing::ActionInterface<F> {\
public:\ public:\
...@@ -1890,13 +1881,13 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, ...@@ -1890,13 +1881,13 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
args_type;\ args_type;\
gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
p6##_type gmock_p6) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ p6##_type gmock_p6) : p0(::std::forward<p0##_type>(gmock_p0)), \
p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ p1(::std::forward<p1##_type>(gmock_p1)), \
p2(::testing::internal::forward<p2##_type>(gmock_p2)), \ p2(::std::forward<p2##_type>(gmock_p2)), \
p3(::testing::internal::forward<p3##_type>(gmock_p3)), \ p3(::std::forward<p3##_type>(gmock_p3)), \
p4(::testing::internal::forward<p4##_type>(gmock_p4)), \ p4(::std::forward<p4##_type>(gmock_p4)), \
p5(::testing::internal::forward<p5##_type>(gmock_p5)), \ p5(::std::forward<p5##_type>(gmock_p5)), \
p6(::testing::internal::forward<p6##_type>(gmock_p6)) {}\ p6(::std::forward<p6##_type>(gmock_p6)) {}\
virtual return_type Perform(const args_type& args) {\ virtual return_type Perform(const args_type& args) {\
return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
Perform(this, args);\ Perform(this, args);\
...@@ -1965,14 +1956,14 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, ...@@ -1965,14 +1956,14 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
name##ActionP8(p0##_type gmock_p0, p1##_type gmock_p1, \ name##ActionP8(p0##_type gmock_p0, p1##_type gmock_p1, \
p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
p5##_type gmock_p5, p6##_type gmock_p6, \ p5##_type gmock_p5, p6##_type gmock_p6, \
p7##_type gmock_p7) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ p7##_type gmock_p7) : p0(::std::forward<p0##_type>(gmock_p0)), \
p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ p1(::std::forward<p1##_type>(gmock_p1)), \
p2(::testing::internal::forward<p2##_type>(gmock_p2)), \ p2(::std::forward<p2##_type>(gmock_p2)), \
p3(::testing::internal::forward<p3##_type>(gmock_p3)), \ p3(::std::forward<p3##_type>(gmock_p3)), \
p4(::testing::internal::forward<p4##_type>(gmock_p4)), \ p4(::std::forward<p4##_type>(gmock_p4)), \
p5(::testing::internal::forward<p5##_type>(gmock_p5)), \ p5(::std::forward<p5##_type>(gmock_p5)), \
p6(::testing::internal::forward<p6##_type>(gmock_p6)), \ p6(::std::forward<p6##_type>(gmock_p6)), \
p7(::testing::internal::forward<p7##_type>(gmock_p7)) {}\ p7(::std::forward<p7##_type>(gmock_p7)) {}\
template <typename F>\ template <typename F>\
class gmock_Impl : public ::testing::ActionInterface<F> {\ class gmock_Impl : public ::testing::ActionInterface<F> {\
public:\ public:\
...@@ -1983,14 +1974,14 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, ...@@ -1983,14 +1974,14 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
p6##_type gmock_p6, \ p6##_type gmock_p6, \
p7##_type gmock_p7) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ p7##_type gmock_p7) : p0(::std::forward<p0##_type>(gmock_p0)), \
p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ p1(::std::forward<p1##_type>(gmock_p1)), \
p2(::testing::internal::forward<p2##_type>(gmock_p2)), \ p2(::std::forward<p2##_type>(gmock_p2)), \
p3(::testing::internal::forward<p3##_type>(gmock_p3)), \ p3(::std::forward<p3##_type>(gmock_p3)), \
p4(::testing::internal::forward<p4##_type>(gmock_p4)), \ p4(::std::forward<p4##_type>(gmock_p4)), \
p5(::testing::internal::forward<p5##_type>(gmock_p5)), \ p5(::std::forward<p5##_type>(gmock_p5)), \
p6(::testing::internal::forward<p6##_type>(gmock_p6)), \ p6(::std::forward<p6##_type>(gmock_p6)), \
p7(::testing::internal::forward<p7##_type>(gmock_p7)) {}\ p7(::std::forward<p7##_type>(gmock_p7)) {}\
virtual return_type Perform(const args_type& args) {\ virtual return_type Perform(const args_type& args) {\
return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
Perform(this, args);\ Perform(this, args);\
...@@ -2063,15 +2054,15 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, ...@@ -2063,15 +2054,15 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
name##ActionP9(p0##_type gmock_p0, p1##_type gmock_p1, \ name##ActionP9(p0##_type gmock_p0, p1##_type gmock_p1, \
p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \ p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
p8##_type gmock_p8) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ p8##_type gmock_p8) : p0(::std::forward<p0##_type>(gmock_p0)), \
p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ p1(::std::forward<p1##_type>(gmock_p1)), \
p2(::testing::internal::forward<p2##_type>(gmock_p2)), \ p2(::std::forward<p2##_type>(gmock_p2)), \
p3(::testing::internal::forward<p3##_type>(gmock_p3)), \ p3(::std::forward<p3##_type>(gmock_p3)), \
p4(::testing::internal::forward<p4##_type>(gmock_p4)), \ p4(::std::forward<p4##_type>(gmock_p4)), \
p5(::testing::internal::forward<p5##_type>(gmock_p5)), \ p5(::std::forward<p5##_type>(gmock_p5)), \
p6(::testing::internal::forward<p6##_type>(gmock_p6)), \ p6(::std::forward<p6##_type>(gmock_p6)), \
p7(::testing::internal::forward<p7##_type>(gmock_p7)), \ p7(::std::forward<p7##_type>(gmock_p7)), \
p8(::testing::internal::forward<p8##_type>(gmock_p8)) {}\ p8(::std::forward<p8##_type>(gmock_p8)) {}\
template <typename F>\ template <typename F>\
class gmock_Impl : public ::testing::ActionInterface<F> {\ class gmock_Impl : public ::testing::ActionInterface<F> {\
public:\ public:\
...@@ -2082,15 +2073,15 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, ...@@ -2082,15 +2073,15 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
p6##_type gmock_p6, p7##_type gmock_p7, \ p6##_type gmock_p6, p7##_type gmock_p7, \
p8##_type gmock_p8) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ p8##_type gmock_p8) : p0(::std::forward<p0##_type>(gmock_p0)), \
p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ p1(::std::forward<p1##_type>(gmock_p1)), \
p2(::testing::internal::forward<p2##_type>(gmock_p2)), \ p2(::std::forward<p2##_type>(gmock_p2)), \
p3(::testing::internal::forward<p3##_type>(gmock_p3)), \ p3(::std::forward<p3##_type>(gmock_p3)), \
p4(::testing::internal::forward<p4##_type>(gmock_p4)), \ p4(::std::forward<p4##_type>(gmock_p4)), \
p5(::testing::internal::forward<p5##_type>(gmock_p5)), \ p5(::std::forward<p5##_type>(gmock_p5)), \
p6(::testing::internal::forward<p6##_type>(gmock_p6)), \ p6(::std::forward<p6##_type>(gmock_p6)), \
p7(::testing::internal::forward<p7##_type>(gmock_p7)), \ p7(::std::forward<p7##_type>(gmock_p7)), \
p8(::testing::internal::forward<p8##_type>(gmock_p8)) {}\ p8(::std::forward<p8##_type>(gmock_p8)) {}\
virtual return_type Perform(const args_type& args) {\ virtual return_type Perform(const args_type& args) {\
return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
Perform(this, args);\ Perform(this, args);\
...@@ -2168,16 +2159,16 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, ...@@ -2168,16 +2159,16 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \ p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
p8##_type gmock_p8, \ p8##_type gmock_p8, \
p9##_type gmock_p9) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ p9##_type gmock_p9) : p0(::std::forward<p0##_type>(gmock_p0)), \
p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ p1(::std::forward<p1##_type>(gmock_p1)), \
p2(::testing::internal::forward<p2##_type>(gmock_p2)), \ p2(::std::forward<p2##_type>(gmock_p2)), \
p3(::testing::internal::forward<p3##_type>(gmock_p3)), \ p3(::std::forward<p3##_type>(gmock_p3)), \
p4(::testing::internal::forward<p4##_type>(gmock_p4)), \ p4(::std::forward<p4##_type>(gmock_p4)), \
p5(::testing::internal::forward<p5##_type>(gmock_p5)), \ p5(::std::forward<p5##_type>(gmock_p5)), \
p6(::testing::internal::forward<p6##_type>(gmock_p6)), \ p6(::std::forward<p6##_type>(gmock_p6)), \
p7(::testing::internal::forward<p7##_type>(gmock_p7)), \ p7(::std::forward<p7##_type>(gmock_p7)), \
p8(::testing::internal::forward<p8##_type>(gmock_p8)), \ p8(::std::forward<p8##_type>(gmock_p8)), \
p9(::testing::internal::forward<p9##_type>(gmock_p9)) {}\ p9(::std::forward<p9##_type>(gmock_p9)) {}\
template <typename F>\ template <typename F>\
class gmock_Impl : public ::testing::ActionInterface<F> {\ class gmock_Impl : public ::testing::ActionInterface<F> {\
public:\ public:\
...@@ -2188,16 +2179,16 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, ...@@ -2188,16 +2179,16 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \ p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
p9##_type gmock_p9) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ p9##_type gmock_p9) : p0(::std::forward<p0##_type>(gmock_p0)), \
p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ p1(::std::forward<p1##_type>(gmock_p1)), \
p2(::testing::internal::forward<p2##_type>(gmock_p2)), \ p2(::std::forward<p2##_type>(gmock_p2)), \
p3(::testing::internal::forward<p3##_type>(gmock_p3)), \ p3(::std::forward<p3##_type>(gmock_p3)), \
p4(::testing::internal::forward<p4##_type>(gmock_p4)), \ p4(::std::forward<p4##_type>(gmock_p4)), \
p5(::testing::internal::forward<p5##_type>(gmock_p5)), \ p5(::std::forward<p5##_type>(gmock_p5)), \
p6(::testing::internal::forward<p6##_type>(gmock_p6)), \ p6(::std::forward<p6##_type>(gmock_p6)), \
p7(::testing::internal::forward<p7##_type>(gmock_p7)), \ p7(::std::forward<p7##_type>(gmock_p7)), \
p8(::testing::internal::forward<p8##_type>(gmock_p8)), \ p8(::std::forward<p8##_type>(gmock_p8)), \
p9(::testing::internal::forward<p9##_type>(gmock_p9)) {}\ p9(::std::forward<p9##_type>(gmock_p9)) {}\
virtual return_type Perform(const args_type& args) {\ virtual return_type Perform(const args_type& args) {\
return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
Perform(this, args);\ Perform(this, args);\
...@@ -2389,7 +2380,7 @@ ACTION_TEMPLATE(InvokeArgument, ...@@ -2389,7 +2380,7 @@ ACTION_TEMPLATE(InvokeArgument,
using internal::invoke_argument::InvokeArgumentAdl; using internal::invoke_argument::InvokeArgumentAdl;
return InvokeArgumentAdl<return_type>( return InvokeArgumentAdl<return_type>(
internal::invoke_argument::AdlTag(), internal::invoke_argument::AdlTag(),
::testing::get<k>(args)); ::std::get<k>(args));
} }
ACTION_TEMPLATE(InvokeArgument, ACTION_TEMPLATE(InvokeArgument,
...@@ -2398,7 +2389,7 @@ ACTION_TEMPLATE(InvokeArgument, ...@@ -2398,7 +2389,7 @@ ACTION_TEMPLATE(InvokeArgument,
using internal::invoke_argument::InvokeArgumentAdl; using internal::invoke_argument::InvokeArgumentAdl;
return InvokeArgumentAdl<return_type>( return InvokeArgumentAdl<return_type>(
internal::invoke_argument::AdlTag(), internal::invoke_argument::AdlTag(),
::testing::get<k>(args), p0); ::std::get<k>(args), p0);
} }
ACTION_TEMPLATE(InvokeArgument, ACTION_TEMPLATE(InvokeArgument,
...@@ -2407,7 +2398,7 @@ ACTION_TEMPLATE(InvokeArgument, ...@@ -2407,7 +2398,7 @@ ACTION_TEMPLATE(InvokeArgument,
using internal::invoke_argument::InvokeArgumentAdl; using internal::invoke_argument::InvokeArgumentAdl;
return InvokeArgumentAdl<return_type>( return InvokeArgumentAdl<return_type>(
internal::invoke_argument::AdlTag(), internal::invoke_argument::AdlTag(),
::testing::get<k>(args), p0, p1); ::std::get<k>(args), p0, p1);
} }
ACTION_TEMPLATE(InvokeArgument, ACTION_TEMPLATE(InvokeArgument,
...@@ -2416,7 +2407,7 @@ ACTION_TEMPLATE(InvokeArgument, ...@@ -2416,7 +2407,7 @@ ACTION_TEMPLATE(InvokeArgument,
using internal::invoke_argument::InvokeArgumentAdl; using internal::invoke_argument::InvokeArgumentAdl;
return InvokeArgumentAdl<return_type>( return InvokeArgumentAdl<return_type>(
internal::invoke_argument::AdlTag(), internal::invoke_argument::AdlTag(),
::testing::get<k>(args), p0, p1, p2); ::std::get<k>(args), p0, p1, p2);
} }
ACTION_TEMPLATE(InvokeArgument, ACTION_TEMPLATE(InvokeArgument,
...@@ -2425,7 +2416,7 @@ ACTION_TEMPLATE(InvokeArgument, ...@@ -2425,7 +2416,7 @@ ACTION_TEMPLATE(InvokeArgument,
using internal::invoke_argument::InvokeArgumentAdl; using internal::invoke_argument::InvokeArgumentAdl;
return InvokeArgumentAdl<return_type>( return InvokeArgumentAdl<return_type>(
internal::invoke_argument::AdlTag(), internal::invoke_argument::AdlTag(),
::testing::get<k>(args), p0, p1, p2, p3); ::std::get<k>(args), p0, p1, p2, p3);
} }
ACTION_TEMPLATE(InvokeArgument, ACTION_TEMPLATE(InvokeArgument,
...@@ -2434,7 +2425,7 @@ ACTION_TEMPLATE(InvokeArgument, ...@@ -2434,7 +2425,7 @@ ACTION_TEMPLATE(InvokeArgument,
using internal::invoke_argument::InvokeArgumentAdl; using internal::invoke_argument::InvokeArgumentAdl;
return InvokeArgumentAdl<return_type>( return InvokeArgumentAdl<return_type>(
internal::invoke_argument::AdlTag(), 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, ACTION_TEMPLATE(InvokeArgument,
...@@ -2443,7 +2434,7 @@ ACTION_TEMPLATE(InvokeArgument, ...@@ -2443,7 +2434,7 @@ ACTION_TEMPLATE(InvokeArgument,
using internal::invoke_argument::InvokeArgumentAdl; using internal::invoke_argument::InvokeArgumentAdl;
return InvokeArgumentAdl<return_type>( return InvokeArgumentAdl<return_type>(
internal::invoke_argument::AdlTag(), 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, ACTION_TEMPLATE(InvokeArgument,
...@@ -2452,7 +2443,7 @@ ACTION_TEMPLATE(InvokeArgument, ...@@ -2452,7 +2443,7 @@ ACTION_TEMPLATE(InvokeArgument,
using internal::invoke_argument::InvokeArgumentAdl; using internal::invoke_argument::InvokeArgumentAdl;
return InvokeArgumentAdl<return_type>( return InvokeArgumentAdl<return_type>(
internal::invoke_argument::AdlTag(), 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, ACTION_TEMPLATE(InvokeArgument,
...@@ -2461,7 +2452,7 @@ ACTION_TEMPLATE(InvokeArgument, ...@@ -2461,7 +2452,7 @@ ACTION_TEMPLATE(InvokeArgument,
using internal::invoke_argument::InvokeArgumentAdl; using internal::invoke_argument::InvokeArgumentAdl;
return InvokeArgumentAdl<return_type>( return InvokeArgumentAdl<return_type>(
internal::invoke_argument::AdlTag(), 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, ACTION_TEMPLATE(InvokeArgument,
...@@ -2470,7 +2461,7 @@ ACTION_TEMPLATE(InvokeArgument, ...@@ -2470,7 +2461,7 @@ ACTION_TEMPLATE(InvokeArgument,
using internal::invoke_argument::InvokeArgumentAdl; using internal::invoke_argument::InvokeArgumentAdl;
return InvokeArgumentAdl<return_type>( return InvokeArgumentAdl<return_type>(
internal::invoke_argument::AdlTag(), 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, ACTION_TEMPLATE(InvokeArgument,
...@@ -2479,7 +2470,7 @@ ACTION_TEMPLATE(InvokeArgument, ...@@ -2479,7 +2470,7 @@ ACTION_TEMPLATE(InvokeArgument,
using internal::invoke_argument::InvokeArgumentAdl; using internal::invoke_argument::InvokeArgumentAdl;
return InvokeArgumentAdl<return_type>( return InvokeArgumentAdl<return_type>(
internal::invoke_argument::AdlTag(), 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>(). // Various overloads for ReturnNew<T>().
......
...@@ -43,6 +43,8 @@ $$}} This meta comment fixes auto-indentation in editors. ...@@ -43,6 +43,8 @@ $$}} This meta comment fixes auto-indentation in editors.
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_ #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_ #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
#include <utility>
#include "gmock/gmock-actions.h" #include "gmock/gmock-actions.h"
#include "gmock/internal/gmock-port.h" #include "gmock/internal/gmock-port.h"
...@@ -63,19 +65,19 @@ $range j 1..i ...@@ -63,19 +65,19 @@ $range j 1..i
$var types = [[$for j [[, typename A$j]]]] $var types = [[$for j [[, typename A$j]]]]
$var as = [[$for j, [[A$j]]]] $var as = [[$for j, [[A$j]]]]
$var args = [[$if i==0 [[]] $else [[ args]]]] $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> template <typename R$types>
class InvokeHelper<R, ::testing::tuple<$as> > { class InvokeHelper<R, ::std::tuple<$as> > {
public: public:
template <typename Function> 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); return function($gets);
} }
template <class Class, typename MethodPtr> template <class Class, typename MethodPtr>
static R InvokeMethod(Class* obj_ptr, static R InvokeMethod(Class* obj_ptr,
MethodPtr method_ptr, MethodPtr method_ptr,
const ::testing::tuple<$as>&$args) { const ::std::tuple<$as>&$args) {
return (obj_ptr->*method_ptr)($gets); return (obj_ptr->*method_ptr)($gets);
} }
...@@ -83,7 +85,7 @@ class InvokeHelper<R, ::testing::tuple<$as> > { ...@@ -83,7 +85,7 @@ class InvokeHelper<R, ::testing::tuple<$as> > {
$if i <= max_callback_arity [[ $if i <= max_callback_arity [[
template <typename CallbackType> template <typename CallbackType>
static R InvokeCallback(CallbackType* callback, static R InvokeCallback(CallbackType* callback,
const ::testing::tuple<$as>&$args) { const ::std::tuple<$as>&$args) {
return callback->Run($gets); return callback->Run($gets);
} }
]] $else [[ ]] $else [[
...@@ -122,7 +124,7 @@ class InvokeCallbackAction { ...@@ -122,7 +124,7 @@ class InvokeCallbackAction {
// An INTERNAL macro for extracting the type of a tuple field. It's // An INTERNAL macro for extracting the type of a tuple field. It's
// subject to change without notice - DO NOT USE IN USER CODE! // subject to change without notice - DO NOT USE IN USER CODE!
#define GMOCK_FIELD_(Tuple, N) \ #define GMOCK_FIELD_(Tuple, N) \
typename ::testing::tuple_element<N, Tuple>::type typename ::std::tuple_element<N, Tuple>::type
$range i 1..n $range i 1..n
...@@ -130,14 +132,14 @@ $range i 1..n ...@@ -130,14 +132,14 @@ $range i 1..n
// type of an n-ary function whose i-th (1-based) argument 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 // k{i}-th (0-based) field of ArgumentTuple, which must be a tuple
// type, and whose return type is Result. For example, // 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). // is int(bool, long).
// //
// SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::Select(args) // SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::Select(args)
// returns the selected fields (k1, k2, ..., k_n) of args as a tuple. // returns the selected fields (k1, k2, ..., k_n) of args as a tuple.
// For example, // For example,
// SelectArgs<int, tuple<bool, char, double>, 2, 0>::Select( // SelectArgs<int, std::tuple<bool, char, double>, 2, 0>::Select(
// ::testing::make_tuple(true, 'a', 2.5)) // ::std::make_tuple(true, 'a', 2.5))
// returns tuple (2.5, true). // returns tuple (2.5, true).
// //
// The numbers in list k1, k2, ..., k_n must be >= 0, where n can be // The numbers in list k1, k2, ..., k_n must be >= 0, where n can be
...@@ -150,7 +152,7 @@ class SelectArgs { ...@@ -150,7 +152,7 @@ class SelectArgs {
typedef Result type($for i, [[GMOCK_FIELD_(ArgumentTuple, k$i)]]); typedef Result type($for i, [[GMOCK_FIELD_(ArgumentTuple, k$i)]]);
typedef typename Function<type>::ArgumentTuple SelectedArgs; typedef typename Function<type>::ArgumentTuple SelectedArgs;
static SelectedArgs Select(const ArgumentTuple& args) { 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 +168,7 @@ class SelectArgs<Result, ArgumentTuple, ...@@ -166,7 +168,7 @@ class SelectArgs<Result, ArgumentTuple,
typedef typename Function<type>::ArgumentTuple SelectedArgs; typedef typename Function<type>::ArgumentTuple SelectedArgs;
static SelectedArgs Select(const ArgumentTuple& [[]] static SelectedArgs Select(const ArgumentTuple& [[]]
$if i == 1 [[/* args */]] $else [[args]]) { $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 +242,12 @@ $range j 0..i-1 ...@@ -240,12 +242,12 @@ $range j 0..i-1
]]]] ]]]]
$range j 0..i-1 $range j 0..i-1
$var As = [[$for j, [[A$j]]]] $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 $range k 1..n-i
$var eas = [[$for k, [[ExcessiveArg()]]]] $var eas = [[$for k, [[ExcessiveArg()]]]]
$var arg_list = [[$if (i==0) | (i==n) [[$as$eas]] $else [[$as, $eas]]]] $var arg_list = [[$if (i==0) | (i==n) [[$as$eas]] $else [[$as, $eas]]]]
$template $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); return impl->template gmock_PerformImpl<$As>(args, $arg_list);
} }
...@@ -395,8 +397,8 @@ $range j2 2..i ...@@ -395,8 +397,8 @@ $range j2 2..i
// //
// MORE INFORMATION: // MORE INFORMATION:
// //
// To learn more about using these macros, please search for 'ACTION' // To learn more about using these macros, please search for 'ACTION' on
// on https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md // https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md
$range i 0..n $range i 0..n
$range k 0..n-1 $range k 0..n-1
...@@ -432,7 +434,7 @@ $for k [[, \ ...@@ -432,7 +434,7 @@ $for k [[, \
// ACTION_TEMPLATE(DuplicateArg, // ACTION_TEMPLATE(DuplicateArg,
// HAS_2_TEMPLATE_PARAMS(int, k, typename, T), // HAS_2_TEMPLATE_PARAMS(int, k, typename, T),
// AND_1_VALUE_PARAMS(output)) { // AND_1_VALUE_PARAMS(output)) {
// *output = T(::testing::get<k>(args)); // *output = T(::std::get<k>(args));
// } // }
// ... // ...
// int n; // int n;
...@@ -525,7 +527,7 @@ _VALUE_PARAMS($for j, [[p$j]]) $for j [[, typename p$j##_type]] ...@@ -525,7 +527,7 @@ _VALUE_PARAMS($for j, [[p$j]]) $for j [[, typename p$j##_type]]
$for i [[ $for i [[
$range j 0..i-1 $range j 0..i-1
#define GMOCK_INTERNAL_INIT_AND_$i[[]]_VALUE_PARAMS($for j, [[p$j]])\ #define GMOCK_INTERNAL_INIT_AND_$i[[]]_VALUE_PARAMS($for j, [[p$j]])\
($for j, [[p$j##_type gmock_p$j]])$if i>0 [[ : ]]$for j, [[p$j(::testing::internal::move(gmock_p$j))]] ($for j, [[p$j##_type gmock_p$j]])$if i>0 [[ : ]]$for j, [[p$j(::std::move(gmock_p$j))]]
]] ]]
...@@ -658,7 +660,7 @@ $var class_name = [[name##Action[[$if i==0 [[]] $elif i==1 [[P]] ...@@ -658,7 +660,7 @@ $var class_name = [[name##Action[[$if i==0 [[]] $elif i==1 [[P]]
$range j 0..i-1 $range j 0..i-1
$var ctor_param_list = [[$for j, [[p$j##_type gmock_p$j]]]] $var ctor_param_list = [[$for j, [[p$j##_type gmock_p$j]]]]
$var param_types_and_names = [[$for j, [[p$j##_type p$j]]]] $var param_types_and_names = [[$for j, [[p$j##_type p$j]]]]
$var inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(::testing::internal::forward<p$j##_type>(gmock_p$j))]]]]]] $var inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(::std::forward<p$j##_type>(gmock_p$j))]]]]]]
$var param_field_decls = [[$for j $var param_field_decls = [[$for j
[[ [[
...@@ -796,7 +798,7 @@ ACTION_TEMPLATE(InvokeArgument, ...@@ -796,7 +798,7 @@ ACTION_TEMPLATE(InvokeArgument,
using internal::invoke_argument::InvokeArgumentAdl; using internal::invoke_argument::InvokeArgumentAdl;
return InvokeArgumentAdl<return_type>( return InvokeArgumentAdl<return_type>(
internal::invoke_argument::AdlTag(), internal::invoke_argument::AdlTag(),
::testing::get<k>(args)$for j [[, p$j]]); ::std::get<k>(args)$for j [[, p$j]]);
} }
]] ]]
......
...@@ -41,6 +41,8 @@ ...@@ -41,6 +41,8 @@
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_ #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_ #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
#include <utility>
#include "gmock/gmock-spec-builders.h" #include "gmock/gmock-spec-builders.h"
#include "gmock/internal/gmock-internal-utils.h" #include "gmock/internal/gmock-internal-utils.h"
...@@ -70,7 +72,7 @@ class FunctionMocker<R()> : public ...@@ -70,7 +72,7 @@ class FunctionMocker<R()> : public
typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple; typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
MockSpec<F> With() { MockSpec<F> With() {
return MockSpec<F>(this, ::testing::make_tuple()); return MockSpec<F>(this, ::std::make_tuple());
} }
R Invoke() { R Invoke() {
...@@ -90,7 +92,7 @@ class FunctionMocker<R(A1)> : public ...@@ -90,7 +92,7 @@ class FunctionMocker<R(A1)> : public
typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple; typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
MockSpec<F> With(const Matcher<A1>& m1) { 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) { R Invoke(A1 a1) {
...@@ -98,7 +100,7 @@ class FunctionMocker<R(A1)> : public ...@@ -98,7 +100,7 @@ class FunctionMocker<R(A1)> : public
// by the C++ standard [14.6.4] here, as the base class type is // by the C++ standard [14.6.4] here, as the base class type is
// dependent on the template argument (and thus shouldn't be // dependent on the template argument (and thus shouldn't be
// looked into when resolving InvokeWith). // looked into when resolving InvokeWith).
return this->InvokeWith(ArgumentTuple(internal::forward<A1>(a1))); return this->InvokeWith(ArgumentTuple(std::forward<A1>(a1)));
} }
}; };
...@@ -110,7 +112,7 @@ class FunctionMocker<R(A1, A2)> : public ...@@ -110,7 +112,7 @@ class FunctionMocker<R(A1, A2)> : public
typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple; typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
MockSpec<F> With(const Matcher<A1>& m1, const Matcher<A2>& m2) { 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) { R Invoke(A1 a1, A2 a2) {
...@@ -118,8 +120,8 @@ class FunctionMocker<R(A1, A2)> : public ...@@ -118,8 +120,8 @@ class FunctionMocker<R(A1, A2)> : public
// by the C++ standard [14.6.4] here, as the base class type is // by the C++ standard [14.6.4] here, as the base class type is
// dependent on the template argument (and thus shouldn't be // dependent on the template argument (and thus shouldn't be
// looked into when resolving InvokeWith). // looked into when resolving InvokeWith).
return this->InvokeWith(ArgumentTuple(internal::forward<A1>(a1), return this->InvokeWith(ArgumentTuple(std::forward<A1>(a1),
internal::forward<A2>(a2))); std::forward<A2>(a2)));
} }
}; };
...@@ -132,7 +134,7 @@ class FunctionMocker<R(A1, A2, A3)> : public ...@@ -132,7 +134,7 @@ class FunctionMocker<R(A1, A2, A3)> : public
MockSpec<F> With(const Matcher<A1>& m1, const Matcher<A2>& m2, MockSpec<F> With(const Matcher<A1>& m1, const Matcher<A2>& m2,
const Matcher<A3>& m3) { 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) { R Invoke(A1 a1, A2 a2, A3 a3) {
...@@ -140,8 +142,8 @@ class FunctionMocker<R(A1, A2, A3)> : public ...@@ -140,8 +142,8 @@ class FunctionMocker<R(A1, A2, A3)> : public
// by the C++ standard [14.6.4] here, as the base class type is // by the C++ standard [14.6.4] here, as the base class type is
// dependent on the template argument (and thus shouldn't be // dependent on the template argument (and thus shouldn't be
// looked into when resolving InvokeWith). // looked into when resolving InvokeWith).
return this->InvokeWith(ArgumentTuple(internal::forward<A1>(a1), return this->InvokeWith(ArgumentTuple(std::forward<A1>(a1),
internal::forward<A2>(a2), internal::forward<A3>(a3))); std::forward<A2>(a2), std::forward<A3>(a3)));
} }
}; };
...@@ -154,7 +156,7 @@ class FunctionMocker<R(A1, A2, A3, A4)> : public ...@@ -154,7 +156,7 @@ class FunctionMocker<R(A1, A2, A3, A4)> : public
MockSpec<F> With(const Matcher<A1>& m1, const Matcher<A2>& m2, MockSpec<F> With(const Matcher<A1>& m1, const Matcher<A2>& m2,
const Matcher<A3>& m3, const Matcher<A4>& m4) { 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) { R Invoke(A1 a1, A2 a2, A3 a3, A4 a4) {
...@@ -162,9 +164,8 @@ class FunctionMocker<R(A1, A2, A3, A4)> : public ...@@ -162,9 +164,8 @@ class FunctionMocker<R(A1, A2, A3, A4)> : public
// by the C++ standard [14.6.4] here, as the base class type is // by the C++ standard [14.6.4] here, as the base class type is
// dependent on the template argument (and thus shouldn't be // dependent on the template argument (and thus shouldn't be
// looked into when resolving InvokeWith). // looked into when resolving InvokeWith).
return this->InvokeWith(ArgumentTuple(internal::forward<A1>(a1), return this->InvokeWith(ArgumentTuple(std::forward<A1>(a1),
internal::forward<A2>(a2), internal::forward<A3>(a3), std::forward<A2>(a2), std::forward<A3>(a3), std::forward<A4>(a4)));
internal::forward<A4>(a4)));
} }
}; };
...@@ -178,7 +179,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5)> : public ...@@ -178,7 +179,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5)> : public
MockSpec<F> With(const Matcher<A1>& m1, const Matcher<A2>& m2, 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<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) { R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) {
...@@ -186,9 +187,9 @@ class FunctionMocker<R(A1, A2, A3, A4, A5)> : public ...@@ -186,9 +187,9 @@ class FunctionMocker<R(A1, A2, A3, A4, A5)> : public
// by the C++ standard [14.6.4] here, as the base class type is // by the C++ standard [14.6.4] here, as the base class type is
// dependent on the template argument (and thus shouldn't be // dependent on the template argument (and thus shouldn't be
// looked into when resolving InvokeWith). // looked into when resolving InvokeWith).
return this->InvokeWith(ArgumentTuple(internal::forward<A1>(a1), return this->InvokeWith(ArgumentTuple(std::forward<A1>(a1),
internal::forward<A2>(a2), internal::forward<A3>(a3), std::forward<A2>(a2), std::forward<A3>(a3), std::forward<A4>(a4),
internal::forward<A4>(a4), internal::forward<A5>(a5))); std::forward<A5>(a5)));
} }
}; };
...@@ -203,7 +204,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6)> : public ...@@ -203,7 +204,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6)> : public
MockSpec<F> With(const Matcher<A1>& m1, const Matcher<A2>& m2, 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<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
const Matcher<A6>& m6) { 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) { R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) {
...@@ -211,10 +212,9 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6)> : public ...@@ -211,10 +212,9 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6)> : public
// by the C++ standard [14.6.4] here, as the base class type is // by the C++ standard [14.6.4] here, as the base class type is
// dependent on the template argument (and thus shouldn't be // dependent on the template argument (and thus shouldn't be
// looked into when resolving InvokeWith). // looked into when resolving InvokeWith).
return this->InvokeWith(ArgumentTuple(internal::forward<A1>(a1), return this->InvokeWith(ArgumentTuple(std::forward<A1>(a1),
internal::forward<A2>(a2), internal::forward<A3>(a3), std::forward<A2>(a2), std::forward<A3>(a3), std::forward<A4>(a4),
internal::forward<A4>(a4), internal::forward<A5>(a5), std::forward<A5>(a5), std::forward<A6>(a6)));
internal::forward<A6>(a6)));
} }
}; };
...@@ -229,7 +229,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7)> : public ...@@ -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, 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<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
const Matcher<A6>& m6, const Matcher<A7>& m7) { 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) { R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) {
...@@ -237,10 +237,9 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7)> : public ...@@ -237,10 +237,9 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7)> : public
// by the C++ standard [14.6.4] here, as the base class type is // by the C++ standard [14.6.4] here, as the base class type is
// dependent on the template argument (and thus shouldn't be // dependent on the template argument (and thus shouldn't be
// looked into when resolving InvokeWith). // looked into when resolving InvokeWith).
return this->InvokeWith(ArgumentTuple(internal::forward<A1>(a1), return this->InvokeWith(ArgumentTuple(std::forward<A1>(a1),
internal::forward<A2>(a2), internal::forward<A3>(a3), std::forward<A2>(a2), std::forward<A3>(a3), std::forward<A4>(a4),
internal::forward<A4>(a4), internal::forward<A5>(a5), std::forward<A5>(a5), std::forward<A6>(a6), std::forward<A7>(a7)));
internal::forward<A6>(a6), internal::forward<A7>(a7)));
} }
}; };
...@@ -255,8 +254,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8)> : public ...@@ -255,8 +254,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8)> : public
MockSpec<F> With(const Matcher<A1>& m1, const Matcher<A2>& m2, 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<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8) { 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, return MockSpec<F>(this, ::std::make_tuple(m1, m2, m3, m4, m5, m6, m7, m8));
m8));
} }
R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) { R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) {
...@@ -264,11 +262,10 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8)> : public ...@@ -264,11 +262,10 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8)> : public
// by the C++ standard [14.6.4] here, as the base class type is // by the C++ standard [14.6.4] here, as the base class type is
// dependent on the template argument (and thus shouldn't be // dependent on the template argument (and thus shouldn't be
// looked into when resolving InvokeWith). // looked into when resolving InvokeWith).
return this->InvokeWith(ArgumentTuple(internal::forward<A1>(a1), return this->InvokeWith(ArgumentTuple(std::forward<A1>(a1),
internal::forward<A2>(a2), internal::forward<A3>(a3), std::forward<A2>(a2), std::forward<A3>(a3), std::forward<A4>(a4),
internal::forward<A4>(a4), internal::forward<A5>(a5), std::forward<A5>(a5), std::forward<A6>(a6), std::forward<A7>(a7),
internal::forward<A6>(a6), internal::forward<A7>(a7), std::forward<A8>(a8)));
internal::forward<A8>(a8)));
} }
}; };
...@@ -284,8 +281,8 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> : public ...@@ -284,8 +281,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<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8, const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8,
const Matcher<A9>& m9) { const Matcher<A9>& m9) {
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, m8,
m8, m9)); m9));
} }
R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) { R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) {
...@@ -293,11 +290,10 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> : public ...@@ -293,11 +290,10 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> : public
// by the C++ standard [14.6.4] here, as the base class type is // by the C++ standard [14.6.4] here, as the base class type is
// dependent on the template argument (and thus shouldn't be // dependent on the template argument (and thus shouldn't be
// looked into when resolving InvokeWith). // looked into when resolving InvokeWith).
return this->InvokeWith(ArgumentTuple(internal::forward<A1>(a1), return this->InvokeWith(ArgumentTuple(std::forward<A1>(a1),
internal::forward<A2>(a2), internal::forward<A3>(a3), std::forward<A2>(a2), std::forward<A3>(a3), std::forward<A4>(a4),
internal::forward<A4>(a4), internal::forward<A5>(a5), std::forward<A5>(a5), std::forward<A6>(a6), std::forward<A7>(a7),
internal::forward<A6>(a6), internal::forward<A7>(a7), std::forward<A8>(a8), std::forward<A9>(a9)));
internal::forward<A8>(a8), internal::forward<A9>(a9)));
} }
}; };
...@@ -314,8 +310,8 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> : public ...@@ -314,8 +310,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<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8, const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8,
const Matcher<A9>& m9, const Matcher<A10>& m10) { const Matcher<A9>& m9, const Matcher<A10>& m10) {
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, m8,
m8, m9, m10)); m9, m10));
} }
R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9,
...@@ -324,12 +320,10 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> : public ...@@ -324,12 +320,10 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> : public
// by the C++ standard [14.6.4] here, as the base class type is // by the C++ standard [14.6.4] here, as the base class type is
// dependent on the template argument (and thus shouldn't be // dependent on the template argument (and thus shouldn't be
// looked into when resolving InvokeWith). // looked into when resolving InvokeWith).
return this->InvokeWith(ArgumentTuple(internal::forward<A1>(a1), return this->InvokeWith(ArgumentTuple(std::forward<A1>(a1),
internal::forward<A2>(a2), internal::forward<A3>(a3), std::forward<A2>(a2), std::forward<A3>(a3), std::forward<A4>(a4),
internal::forward<A4>(a4), internal::forward<A5>(a5), std::forward<A5>(a5), std::forward<A6>(a6), std::forward<A7>(a7),
internal::forward<A6>(a6), internal::forward<A7>(a7), std::forward<A8>(a8), std::forward<A9>(a9), std::forward<A10>(a10)));
internal::forward<A8>(a8), internal::forward<A9>(a9),
internal::forward<A10>(a10)));
} }
}; };
...@@ -418,534 +412,478 @@ using internal::FunctionMocker; ...@@ -418,534 +412,478 @@ using internal::FunctionMocker;
GTEST_CONCAT_TOKEN_(gmock##constness##arity##_##Method##_, __LINE__) GTEST_CONCAT_TOKEN_(gmock##constness##arity##_##Method##_, __LINE__)
// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
#define GMOCK_METHOD0_(tn, constness, ct, Method, ...) \ #define GMOCK_METHOD0_(tn, constness, ct, Method, ...) \
GMOCK_RESULT_(tn, __VA_ARGS__) ct Method() constness { \ GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
GTEST_COMPILE_ASSERT_( \ ) constness { \
(::testing::tuple_size<tn ::testing::internal::Function< \ GTEST_COMPILE_ASSERT_((::std::tuple_size< \
__VA_ARGS__>::ArgumentTuple>::value == 0), \ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
this_method_does_not_take_0_arguments); \ == 0), \
GMOCK_MOCKER_(0, constness, Method).SetOwnerAndName(this, #Method); \ this_method_does_not_take_0_arguments); \
return GMOCK_MOCKER_(0, constness, Method).Invoke(); \ 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); \ ::testing::MockSpec<__VA_ARGS__> \
return GMOCK_MOCKER_(0, constness, Method).With(); \ gmock_##Method() constness { \
} \ GMOCK_MOCKER_(0, constness, Method).RegisterOwner(this); \
::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ return GMOCK_MOCKER_(0, constness, Method).With(); \
const ::testing::internal::WithoutMatchers&, \ } \
constness ::testing::internal::Function<__VA_ARGS__>*) const { \ ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
return ::testing::internal::AdjustConstness_##constness(this) \ const ::testing::internal::WithoutMatchers&, \
->gmock_##Method(); \ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \
} \ return ::testing::internal::AdjustConstness_##constness(this)-> \
gmock_##Method(); \
} \
mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(0, constness, \ mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(0, constness, \
Method) Method)
// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
#define GMOCK_METHOD1_(tn, constness, ct, Method, ...) \ #define GMOCK_METHOD1_(tn, constness, ct, Method, ...) \
GMOCK_RESULT_(tn, __VA_ARGS__) \ GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1) constness { \ GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1) constness { \
GTEST_COMPILE_ASSERT_( \ GTEST_COMPILE_ASSERT_((::std::tuple_size< \
(::testing::tuple_size<tn ::testing::internal::Function< \ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
__VA_ARGS__>::ArgumentTuple>::value == 1), \ == 1), \
this_method_does_not_take_1_argument); \ this_method_does_not_take_1_argument); \
GMOCK_MOCKER_(1, constness, Method).SetOwnerAndName(this, #Method); \ GMOCK_MOCKER_(1, constness, Method).SetOwnerAndName(this, #Method); \
return GMOCK_MOCKER_(1, constness, Method) \ return GMOCK_MOCKER_(1, constness, \
.Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \ Method).Invoke(::std::forward<GMOCK_ARG_(tn, 1, \
gmock_a1)); \ __VA_ARGS__)>(gmock_a1)); \
} \ } \
::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ ::testing::MockSpec<__VA_ARGS__> \
GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1) constness { \ gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1) constness { \
GMOCK_MOCKER_(1, constness, Method).RegisterOwner(this); \ GMOCK_MOCKER_(1, constness, Method).RegisterOwner(this); \
return GMOCK_MOCKER_(1, constness, Method).With(gmock_a1); \ return GMOCK_MOCKER_(1, constness, Method).With(gmock_a1); \
} \ } \
::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
const ::testing::internal::WithoutMatchers&, \ const ::testing::internal::WithoutMatchers&, \
constness ::testing::internal::Function<__VA_ARGS__>*) const { \ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \
return ::testing::internal::AdjustConstness_##constness(this) \ return ::testing::internal::AdjustConstness_##constness(this)-> \
->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>()); \ gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>()); \
} \ } \
mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(1, constness, \ mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(1, constness, \
Method) Method)
// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
#define GMOCK_METHOD2_(tn, constness, ct, Method, ...) \ #define GMOCK_METHOD2_(tn, constness, ct, Method, ...) \
GMOCK_RESULT_(tn, __VA_ARGS__) \ GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \
GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2) constness { \ __VA_ARGS__) gmock_a2) constness { \
GTEST_COMPILE_ASSERT_( \ GTEST_COMPILE_ASSERT_((::std::tuple_size< \
(::testing::tuple_size<tn ::testing::internal::Function< \ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
__VA_ARGS__>::ArgumentTuple>::value == 2), \ == 2), \
this_method_does_not_take_2_arguments); \ this_method_does_not_take_2_arguments); \
GMOCK_MOCKER_(2, constness, Method).SetOwnerAndName(this, #Method); \ GMOCK_MOCKER_(2, constness, Method).SetOwnerAndName(this, #Method); \
return GMOCK_MOCKER_(2, constness, Method) \ return GMOCK_MOCKER_(2, constness, \
.Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \ Method).Invoke(::std::forward<GMOCK_ARG_(tn, 1, \
gmock_a1), \ __VA_ARGS__)>(gmock_a1), \
::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \ ::std::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2)); \
gmock_a2)); \ } \
} \ ::testing::MockSpec<__VA_ARGS__> \
::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2) constness { \
GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2) constness { \ GMOCK_MOCKER_(2, constness, Method).RegisterOwner(this); \
GMOCK_MOCKER_(2, constness, Method).RegisterOwner(this); \ return GMOCK_MOCKER_(2, constness, Method).With(gmock_a1, gmock_a2); \
return GMOCK_MOCKER_(2, constness, Method).With(gmock_a1, gmock_a2); \ } \
} \ ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ const ::testing::internal::WithoutMatchers&, \
const ::testing::internal::WithoutMatchers&, \ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \
constness ::testing::internal::Function<__VA_ARGS__>*) const { \ return ::testing::internal::AdjustConstness_##constness(this)-> \
return ::testing::internal::AdjustConstness_##constness(this) \ gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>()); \
::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>()); \ } \
} \ mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(2, constness, \
mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(2, constness, \ Method)
Method)
// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
#define GMOCK_METHOD3_(tn, constness, ct, Method, ...) \ #define GMOCK_METHOD3_(tn, constness, ct, Method, ...) \
GMOCK_RESULT_(tn, __VA_ARGS__) \ GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \
GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ __VA_ARGS__) gmock_a2, GMOCK_ARG_(tn, 3, \
GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3) constness { \ __VA_ARGS__) gmock_a3) constness { \
GTEST_COMPILE_ASSERT_( \ GTEST_COMPILE_ASSERT_((::std::tuple_size< \
(::testing::tuple_size<tn ::testing::internal::Function< \ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
__VA_ARGS__>::ArgumentTuple>::value == 3), \ == 3), \
this_method_does_not_take_3_arguments); \ this_method_does_not_take_3_arguments); \
GMOCK_MOCKER_(3, constness, Method).SetOwnerAndName(this, #Method); \ GMOCK_MOCKER_(3, constness, Method).SetOwnerAndName(this, #Method); \
return GMOCK_MOCKER_(3, constness, Method) \ return GMOCK_MOCKER_(3, constness, \
.Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \ Method).Invoke(::std::forward<GMOCK_ARG_(tn, 1, \
gmock_a1), \ __VA_ARGS__)>(gmock_a1), \
::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \ ::std::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \
gmock_a2), \ ::std::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3)); \
::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, \
::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3) constness { \
GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ GMOCK_MOCKER_(3, constness, Method).RegisterOwner(this); \
GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3) constness { \ return GMOCK_MOCKER_(3, constness, Method).With(gmock_a1, gmock_a2, \
GMOCK_MOCKER_(3, constness, Method).RegisterOwner(this); \ gmock_a3); \
return GMOCK_MOCKER_(3, constness, Method) \ } \
.With(gmock_a1, gmock_a2, gmock_a3); \ ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
} \ const ::testing::internal::WithoutMatchers&, \
::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \
const ::testing::internal::WithoutMatchers&, \ return ::testing::internal::AdjustConstness_##constness(this)-> \
constness ::testing::internal::Function<__VA_ARGS__>*) const { \ gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
return ::testing::internal::AdjustConstness_##constness(this) \ ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ ::testing::A<GMOCK_ARG_(tn, 3, __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)
mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(3, constness, \
Method)
// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
#define GMOCK_METHOD4_(tn, constness, ct, Method, ...) \ #define GMOCK_METHOD4_(tn, constness, ct, Method, ...) \
GMOCK_RESULT_(tn, __VA_ARGS__) \ GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \
GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ __VA_ARGS__) gmock_a2, GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4) constness { \
GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4) constness { \ GTEST_COMPILE_ASSERT_((::std::tuple_size< \
GTEST_COMPILE_ASSERT_( \ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
(::testing::tuple_size<tn ::testing::internal::Function< \ == 4), \
__VA_ARGS__>::ArgumentTuple>::value == 4), \ this_method_does_not_take_4_arguments); \
this_method_does_not_take_4_arguments); \ GMOCK_MOCKER_(4, constness, Method).SetOwnerAndName(this, #Method); \
GMOCK_MOCKER_(4, constness, Method).SetOwnerAndName(this, #Method); \ return GMOCK_MOCKER_(4, constness, \
return GMOCK_MOCKER_(4, constness, Method) \ Method).Invoke(::std::forward<GMOCK_ARG_(tn, 1, \
.Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \ __VA_ARGS__)>(gmock_a1), \
gmock_a1), \ ::std::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \
::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \ ::std::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3), \
gmock_a2), \ ::std::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(gmock_a4)); \
::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \ } \
gmock_a3), \ ::testing::MockSpec<__VA_ARGS__> \
::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \ gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
gmock_a4)); \ GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
} \ GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4) constness { \
GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ GMOCK_MOCKER_(4, constness, Method).RegisterOwner(this); \
GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ return GMOCK_MOCKER_(4, constness, Method).With(gmock_a1, gmock_a2, \
GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ gmock_a3, gmock_a4); \
GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4) constness { \ } \
GMOCK_MOCKER_(4, constness, Method).RegisterOwner(this); \ ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
return GMOCK_MOCKER_(4, constness, Method) \ const ::testing::internal::WithoutMatchers&, \
.With(gmock_a1, gmock_a2, gmock_a3, gmock_a4); \ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \
} \ return ::testing::internal::AdjustConstness_##constness(this)-> \
::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
const ::testing::internal::WithoutMatchers&, \ ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
constness ::testing::internal::Function<__VA_ARGS__>*) const { \ ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \
return ::testing::internal::AdjustConstness_##constness(this) \ ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>()); \
->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_(4, constness, \
::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \ Method)
::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!!! // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
#define GMOCK_METHOD5_(tn, constness, ct, Method, ...) \ #define GMOCK_METHOD5_(tn, constness, ct, Method, ...) \
GMOCK_RESULT_(tn, __VA_ARGS__) \ GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \
GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ __VA_ARGS__) gmock_a2, GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, GMOCK_ARG_(tn, 5, \
GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ __VA_ARGS__) gmock_a5) constness { \
GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5) constness { \ GTEST_COMPILE_ASSERT_((::std::tuple_size< \
GTEST_COMPILE_ASSERT_( \ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
(::testing::tuple_size<tn ::testing::internal::Function< \ == 5), \
__VA_ARGS__>::ArgumentTuple>::value == 5), \ this_method_does_not_take_5_arguments); \
this_method_does_not_take_5_arguments); \ GMOCK_MOCKER_(5, constness, Method).SetOwnerAndName(this, #Method); \
GMOCK_MOCKER_(5, constness, Method).SetOwnerAndName(this, #Method); \ return GMOCK_MOCKER_(5, constness, \
return GMOCK_MOCKER_(5, constness, Method) \ Method).Invoke(::std::forward<GMOCK_ARG_(tn, 1, \
.Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \ __VA_ARGS__)>(gmock_a1), \
gmock_a1), \ ::std::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \
::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \ ::std::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3), \
gmock_a2), \ ::std::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(gmock_a4), \
::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \ ::std::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(gmock_a5)); \
gmock_a3), \ } \
::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \ ::testing::MockSpec<__VA_ARGS__> \
gmock_a4), \ gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>( \ GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
gmock_a5)); \ GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
} \ GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5) constness { \
GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ GMOCK_MOCKER_(5, constness, Method).RegisterOwner(this); \
GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ return GMOCK_MOCKER_(5, constness, Method).With(gmock_a1, gmock_a2, \
GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ gmock_a3, gmock_a4, gmock_a5); \
GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ } \
GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5) constness { \ ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
GMOCK_MOCKER_(5, constness, Method).RegisterOwner(this); \ const ::testing::internal::WithoutMatchers&, \
return GMOCK_MOCKER_(5, constness, Method) \ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \
.With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5); \ return ::testing::internal::AdjustConstness_##constness(this)-> \
} \ gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
const ::testing::internal::WithoutMatchers&, \ ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \
constness ::testing::internal::Function<__VA_ARGS__>*) const { \ ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \
return ::testing::internal::AdjustConstness_##constness(this) \ ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>()); \
->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_(5, constness, \
::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \ Method)
::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!!! // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
#define GMOCK_METHOD6_(tn, constness, ct, Method, ...) \ #define GMOCK_METHOD6_(tn, constness, ct, Method, ...) \
GMOCK_RESULT_(tn, __VA_ARGS__) \ GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \
GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ __VA_ARGS__) gmock_a2, GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, GMOCK_ARG_(tn, 5, \
GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ __VA_ARGS__) gmock_a5, GMOCK_ARG_(tn, 6, \
GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \ __VA_ARGS__) gmock_a6) constness { \
GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6) constness { \ GTEST_COMPILE_ASSERT_((::std::tuple_size< \
GTEST_COMPILE_ASSERT_( \ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
(::testing::tuple_size<tn ::testing::internal::Function< \ == 6), \
__VA_ARGS__>::ArgumentTuple>::value == 6), \ this_method_does_not_take_6_arguments); \
this_method_does_not_take_6_arguments); \ GMOCK_MOCKER_(6, constness, Method).SetOwnerAndName(this, #Method); \
GMOCK_MOCKER_(6, constness, Method).SetOwnerAndName(this, #Method); \ return GMOCK_MOCKER_(6, constness, \
return GMOCK_MOCKER_(6, constness, Method) \ Method).Invoke(::std::forward<GMOCK_ARG_(tn, 1, \
.Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \ __VA_ARGS__)>(gmock_a1), \
gmock_a1), \ ::std::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \
::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \ ::std::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3), \
gmock_a2), \ ::std::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(gmock_a4), \
::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \ ::std::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(gmock_a5), \
gmock_a3), \ ::std::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(gmock_a6)); \
::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \ } \
gmock_a4), \ ::testing::MockSpec<__VA_ARGS__> \
::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>( \ gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
gmock_a5), \ GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
::testing::internal::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>( \ GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
gmock_a6)); \ GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
} \ GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6) constness { \
GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ GMOCK_MOCKER_(6, constness, Method).RegisterOwner(this); \
GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ return GMOCK_MOCKER_(6, constness, Method).With(gmock_a1, gmock_a2, \
GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ gmock_a3, gmock_a4, gmock_a5, gmock_a6); \
GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ } \
GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6) constness { \ const ::testing::internal::WithoutMatchers&, \
GMOCK_MOCKER_(6, constness, Method).RegisterOwner(this); \ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \
return GMOCK_MOCKER_(6, constness, Method) \ return ::testing::internal::AdjustConstness_##constness(this)-> \
.With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5, gmock_a6); \ gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
} \ ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \
const ::testing::internal::WithoutMatchers&, \ ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \
constness ::testing::internal::Function<__VA_ARGS__>*) const { \ ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \
return ::testing::internal::AdjustConstness_##constness(this) \ ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>()); \
->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_(6, constness, \
::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \ Method)
::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!!! // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
#define GMOCK_METHOD7_(tn, constness, ct, Method, ...) \ #define GMOCK_METHOD7_(tn, constness, ct, Method, ...) \
GMOCK_RESULT_(tn, __VA_ARGS__) \ GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \
GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ __VA_ARGS__) gmock_a2, GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, GMOCK_ARG_(tn, 5, \
GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ __VA_ARGS__) gmock_a5, GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \ GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7) constness { \
GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \ GTEST_COMPILE_ASSERT_((::std::tuple_size< \
GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7) constness { \ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
GTEST_COMPILE_ASSERT_( \ == 7), \
(::testing::tuple_size<tn ::testing::internal::Function< \ this_method_does_not_take_7_arguments); \
__VA_ARGS__>::ArgumentTuple>::value == 7), \ GMOCK_MOCKER_(7, constness, Method).SetOwnerAndName(this, #Method); \
this_method_does_not_take_7_arguments); \ return GMOCK_MOCKER_(7, constness, \
GMOCK_MOCKER_(7, constness, Method).SetOwnerAndName(this, #Method); \ Method).Invoke(::std::forward<GMOCK_ARG_(tn, 1, \
return GMOCK_MOCKER_(7, constness, Method) \ __VA_ARGS__)>(gmock_a1), \
.Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \ ::std::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \
gmock_a1), \ ::std::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3), \
::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \ ::std::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(gmock_a4), \
gmock_a2), \ ::std::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(gmock_a5), \
::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \ ::std::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(gmock_a6), \
gmock_a3), \ ::std::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(gmock_a7)); \
::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \ } \
gmock_a4), \ ::testing::MockSpec<__VA_ARGS__> \
::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>( \ gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
gmock_a5), \ GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
::testing::internal::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>( \ GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
gmock_a6), \ GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
::testing::internal::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>( \ GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
gmock_a7)); \ GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
} \ GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7) constness { \
::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ GMOCK_MOCKER_(7, constness, Method).RegisterOwner(this); \
GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ return GMOCK_MOCKER_(7, constness, Method).With(gmock_a1, gmock_a2, \
GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7); \
GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ } \
GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ const ::testing::internal::WithoutMatchers&, \
GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \
GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7) constness { \ return ::testing::internal::AdjustConstness_##constness(this)-> \
GMOCK_MOCKER_(7, constness, Method).RegisterOwner(this); \ gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
return GMOCK_MOCKER_(7, constness, Method) \ ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
.With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5, gmock_a6, \ ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \
gmock_a7); \ ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \
} \ ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \
::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(), \
const ::testing::internal::WithoutMatchers&, \ ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>()); \
constness ::testing::internal::Function<__VA_ARGS__>*) const { \ } \
return ::testing::internal::AdjustConstness_##constness(this) \ mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(7, constness, \
->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ Method)
::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!!! // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
#define GMOCK_METHOD8_(tn, constness, ct, Method, ...) \ #define GMOCK_METHOD8_(tn, constness, ct, Method, ...) \
GMOCK_RESULT_(tn, __VA_ARGS__) \ GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \
GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ __VA_ARGS__) gmock_a2, GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, GMOCK_ARG_(tn, 5, \
GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ __VA_ARGS__) gmock_a5, GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \ GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, GMOCK_ARG_(tn, 8, \
GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \ __VA_ARGS__) gmock_a8) constness { \
GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \ GTEST_COMPILE_ASSERT_((::std::tuple_size< \
GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8) constness { \ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
GTEST_COMPILE_ASSERT_( \ == 8), \
(::testing::tuple_size<tn ::testing::internal::Function< \ this_method_does_not_take_8_arguments); \
__VA_ARGS__>::ArgumentTuple>::value == 8), \ GMOCK_MOCKER_(8, constness, Method).SetOwnerAndName(this, #Method); \
this_method_does_not_take_8_arguments); \ return GMOCK_MOCKER_(8, constness, \
GMOCK_MOCKER_(8, constness, Method).SetOwnerAndName(this, #Method); \ Method).Invoke(::std::forward<GMOCK_ARG_(tn, 1, \
return GMOCK_MOCKER_(8, constness, Method) \ __VA_ARGS__)>(gmock_a1), \
.Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \ ::std::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \
gmock_a1), \ ::std::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3), \
::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \ ::std::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(gmock_a4), \
gmock_a2), \ ::std::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(gmock_a5), \
::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \ ::std::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(gmock_a6), \
gmock_a3), \ ::std::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(gmock_a7), \
::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \ ::std::forward<GMOCK_ARG_(tn, 8, __VA_ARGS__)>(gmock_a8)); \
gmock_a4), \ } \
::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>( \ ::testing::MockSpec<__VA_ARGS__> \
gmock_a5), \ gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
::testing::internal::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>( \ GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
gmock_a6), \ GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
::testing::internal::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>( \ GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
gmock_a7), \ GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
::testing::internal::forward<GMOCK_ARG_(tn, 8, __VA_ARGS__)>( \ GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
gmock_a8)); \ GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \
} \ GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8) constness { \
::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ GMOCK_MOCKER_(8, constness, Method).RegisterOwner(this); \
GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ return GMOCK_MOCKER_(8, constness, Method).With(gmock_a1, gmock_a2, \
GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8); \
GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ } \
GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ const ::testing::internal::WithoutMatchers&, \
GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \
GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \ return ::testing::internal::AdjustConstness_##constness(this)-> \
GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8) constness { \ gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
GMOCK_MOCKER_(8, constness, Method).RegisterOwner(this); \ ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
return GMOCK_MOCKER_(8, constness, Method) \ ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \
.With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5, gmock_a6, \ ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \
gmock_a7, gmock_a8); \ ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \
} \ ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(), \
::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(), \
const ::testing::internal::WithoutMatchers&, \ ::testing::A<GMOCK_ARG_(tn, 8, __VA_ARGS__)>()); \
constness ::testing::internal::Function<__VA_ARGS__>*) const { \ } \
return ::testing::internal::AdjustConstness_##constness(this) \ mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(8, constness, \
->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ Method)
::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!!! // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
#define GMOCK_METHOD9_(tn, constness, ct, Method, ...) \ #define GMOCK_METHOD9_(tn, constness, ct, Method, ...) \
GMOCK_RESULT_(tn, __VA_ARGS__) \ GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \
GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ __VA_ARGS__) gmock_a2, GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, GMOCK_ARG_(tn, 5, \
GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ __VA_ARGS__) gmock_a5, GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \ GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, GMOCK_ARG_(tn, 8, \
GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \ __VA_ARGS__) gmock_a8, GMOCK_ARG_(tn, 9, \
GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \ __VA_ARGS__) gmock_a9) constness { \
GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \ GTEST_COMPILE_ASSERT_((::std::tuple_size< \
GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9) constness { \ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
GTEST_COMPILE_ASSERT_( \ == 9), \
(::testing::tuple_size<tn ::testing::internal::Function< \ this_method_does_not_take_9_arguments); \
__VA_ARGS__>::ArgumentTuple>::value == 9), \ GMOCK_MOCKER_(9, constness, Method).SetOwnerAndName(this, #Method); \
this_method_does_not_take_9_arguments); \ return GMOCK_MOCKER_(9, constness, \
GMOCK_MOCKER_(9, constness, Method).SetOwnerAndName(this, #Method); \ Method).Invoke(::std::forward<GMOCK_ARG_(tn, 1, \
return GMOCK_MOCKER_(9, constness, Method) \ __VA_ARGS__)>(gmock_a1), \
.Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \ ::std::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \
gmock_a1), \ ::std::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3), \
::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \ ::std::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(gmock_a4), \
gmock_a2), \ ::std::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(gmock_a5), \
::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \ ::std::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(gmock_a6), \
gmock_a3), \ ::std::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(gmock_a7), \
::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \ ::std::forward<GMOCK_ARG_(tn, 8, __VA_ARGS__)>(gmock_a8), \
gmock_a4), \ ::std::forward<GMOCK_ARG_(tn, 9, __VA_ARGS__)>(gmock_a9)); \
::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>( \ } \
gmock_a5), \ ::testing::MockSpec<__VA_ARGS__> \
::testing::internal::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>( \ gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
gmock_a6), \ GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
::testing::internal::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>( \ GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
gmock_a7), \ GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
::testing::internal::forward<GMOCK_ARG_(tn, 8, __VA_ARGS__)>( \ GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
gmock_a8), \ GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
::testing::internal::forward<GMOCK_ARG_(tn, 9, __VA_ARGS__)>( \ GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \
gmock_a9)); \ GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \
} \ GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9) constness { \
::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ GMOCK_MOCKER_(9, constness, Method).RegisterOwner(this); \
GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ return GMOCK_MOCKER_(9, constness, Method).With(gmock_a1, gmock_a2, \
GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, \
GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ gmock_a9); \
GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ } \
GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ const ::testing::internal::WithoutMatchers&, \
GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \
GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \ return ::testing::internal::AdjustConstness_##constness(this)-> \
GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9) constness { \ gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
GMOCK_MOCKER_(9, constness, Method).RegisterOwner(this); \ ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
return GMOCK_MOCKER_(9, constness, Method) \ ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \
.With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5, gmock_a6, \ ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \
gmock_a7, gmock_a8, gmock_a9); \ ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \
} \ ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(), \
::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(), \
const ::testing::internal::WithoutMatchers&, \ ::testing::A<GMOCK_ARG_(tn, 8, __VA_ARGS__)>(), \
constness ::testing::internal::Function<__VA_ARGS__>*) const { \ ::testing::A<GMOCK_ARG_(tn, 9, __VA_ARGS__)>()); \
return ::testing::internal::AdjustConstness_##constness(this) \ } \
->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(9, constness, \
::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \ Method)
::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!!! // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
#define GMOCK_METHOD10_(tn, constness, ct, Method, ...) \ #define GMOCK_METHOD10_(tn, constness, ct, Method, ...) \
GMOCK_RESULT_(tn, __VA_ARGS__) \ GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \
GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ __VA_ARGS__) gmock_a2, GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, GMOCK_ARG_(tn, 5, \
GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ __VA_ARGS__) gmock_a5, GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \ GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, GMOCK_ARG_(tn, 8, \
GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \ __VA_ARGS__) gmock_a8, GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9, \
GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \ GMOCK_ARG_(tn, 10, __VA_ARGS__) gmock_a10) constness { \
GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \ GTEST_COMPILE_ASSERT_((::std::tuple_size< \
GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9, \ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
GMOCK_ARG_(tn, 10, __VA_ARGS__) gmock_a10) constness { \ == 10), \
GTEST_COMPILE_ASSERT_( \ this_method_does_not_take_10_arguments); \
(::testing::tuple_size<tn ::testing::internal::Function< \ GMOCK_MOCKER_(10, constness, Method).SetOwnerAndName(this, #Method); \
__VA_ARGS__>::ArgumentTuple>::value == 10), \ return GMOCK_MOCKER_(10, constness, \
this_method_does_not_take_10_arguments); \ Method).Invoke(::std::forward<GMOCK_ARG_(tn, 1, \
GMOCK_MOCKER_(10, constness, Method).SetOwnerAndName(this, #Method); \ __VA_ARGS__)>(gmock_a1), \
return GMOCK_MOCKER_(10, constness, Method) \ ::std::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \
.Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \ ::std::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3), \
gmock_a1), \ ::std::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(gmock_a4), \
::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \ ::std::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(gmock_a5), \
gmock_a2), \ ::std::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(gmock_a6), \
::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \ ::std::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(gmock_a7), \
gmock_a3), \ ::std::forward<GMOCK_ARG_(tn, 8, __VA_ARGS__)>(gmock_a8), \
::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \ ::std::forward<GMOCK_ARG_(tn, 9, __VA_ARGS__)>(gmock_a9), \
gmock_a4), \ ::std::forward<GMOCK_ARG_(tn, 10, __VA_ARGS__)>(gmock_a10)); \
::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>( \ } \
gmock_a5), \ ::testing::MockSpec<__VA_ARGS__> \
::testing::internal::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>( \ gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
gmock_a6), \ GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
::testing::internal::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>( \ GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
gmock_a7), \ GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
::testing::internal::forward<GMOCK_ARG_(tn, 8, __VA_ARGS__)>( \ GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
gmock_a8), \ GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
::testing::internal::forward<GMOCK_ARG_(tn, 9, __VA_ARGS__)>( \ GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \
gmock_a9), \ GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \
::testing::internal::forward<GMOCK_ARG_(tn, 10, __VA_ARGS__)>( \ GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9, \
gmock_a10)); \ GMOCK_MATCHER_(tn, 10, \
} \ __VA_ARGS__) gmock_a10) constness { \
::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ GMOCK_MOCKER_(10, constness, Method).RegisterOwner(this); \
GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ return GMOCK_MOCKER_(10, constness, Method).With(gmock_a1, gmock_a2, \
GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, gmock_a9, \
GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ gmock_a10); \
GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ } \
GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ const ::testing::internal::WithoutMatchers&, \
GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \
GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \ return ::testing::internal::AdjustConstness_##constness(this)-> \
GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9, \ gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
GMOCK_MATCHER_(tn, 10, __VA_ARGS__) gmock_a10) constness { \ ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
GMOCK_MOCKER_(10, constness, Method).RegisterOwner(this); \ ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \
return GMOCK_MOCKER_(10, constness, Method) \ ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \
.With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5, gmock_a6, \ ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \
gmock_a7, gmock_a8, gmock_a9, gmock_a10); \ ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(), \
} \ ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(), \
::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ ::testing::A<GMOCK_ARG_(tn, 8, __VA_ARGS__)>(), \
const ::testing::internal::WithoutMatchers&, \ ::testing::A<GMOCK_ARG_(tn, 9, __VA_ARGS__)>(), \
constness ::testing::internal::Function<__VA_ARGS__>*) const { \ ::testing::A<GMOCK_ARG_(tn, 10, __VA_ARGS__)>()); \
return ::testing::internal::AdjustConstness_##constness(this) \ } \
->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(10, constness, \
::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \ Method)
::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_METHOD0(m, ...) GMOCK_METHOD0_(, , , m, __VA_ARGS__)
#define MOCK_METHOD1(m, ...) GMOCK_METHOD1_(, , , m, __VA_ARGS__) #define MOCK_METHOD1(m, ...) GMOCK_METHOD1_(, , , m, __VA_ARGS__)
...@@ -1175,7 +1113,9 @@ class MockFunction<R(A0)> { ...@@ -1175,7 +1113,9 @@ class MockFunction<R(A0)> {
#if GTEST_HAS_STD_FUNCTION_ #if GTEST_HAS_STD_FUNCTION_
::std::function<R(A0)> AsStdFunction() { ::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_ #endif // GTEST_HAS_STD_FUNCTION_
...@@ -1213,7 +1153,7 @@ class MockFunction<R(A0, A1, A2)> { ...@@ -1213,7 +1153,7 @@ class MockFunction<R(A0, A1, A2)> {
::std::function<R(A0, A1, A2)> AsStdFunction() { ::std::function<R(A0, A1, A2)> AsStdFunction() {
return [this](A0 a0, A1 a1, A2 a2) -> R { return [this](A0 a0, A1 a1, A2 a2) -> R {
return this->Call(::std::forward<A0>(a0), ::std::forward<A1>(a1), return this->Call(::std::forward<A0>(a0), ::std::forward<A1>(a1),
::std::forward<A2>(a2)); ::std::forward<A2>(a2));
}; };
} }
#endif // GTEST_HAS_STD_FUNCTION_ #endif // GTEST_HAS_STD_FUNCTION_
...@@ -1233,7 +1173,7 @@ class MockFunction<R(A0, A1, A2, A3)> { ...@@ -1233,7 +1173,7 @@ class MockFunction<R(A0, A1, A2, A3)> {
::std::function<R(A0, A1, A2, A3)> AsStdFunction() { ::std::function<R(A0, A1, A2, A3)> AsStdFunction() {
return [this](A0 a0, A1 a1, A2 a2, A3 a3) -> R { return [this](A0 a0, A1 a1, A2 a2, A3 a3) -> R {
return this->Call(::std::forward<A0>(a0), ::std::forward<A1>(a1), 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_ #endif // GTEST_HAS_STD_FUNCTION_
...@@ -1254,8 +1194,8 @@ class MockFunction<R(A0, A1, A2, A3, A4)> { ...@@ -1254,8 +1194,8 @@ class MockFunction<R(A0, A1, A2, A3, A4)> {
::std::function<R(A0, A1, A2, A3, A4)> AsStdFunction() { ::std::function<R(A0, A1, A2, A3, A4)> AsStdFunction() {
return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) -> R { return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) -> R {
return this->Call(::std::forward<A0>(a0), ::std::forward<A1>(a1), 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),
::std::forward<A4>(a4)); ::std::forward<A4>(a4));
}; };
} }
#endif // GTEST_HAS_STD_FUNCTION_ #endif // GTEST_HAS_STD_FUNCTION_
...@@ -1276,8 +1216,8 @@ class MockFunction<R(A0, A1, A2, A3, A4, A5)> { ...@@ -1276,8 +1216,8 @@ class MockFunction<R(A0, A1, A2, A3, A4, A5)> {
::std::function<R(A0, A1, A2, A3, A4, A5)> AsStdFunction() { ::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](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) -> R {
return this->Call(::std::forward<A0>(a0), ::std::forward<A1>(a1), 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),
::std::forward<A4>(a4), ::std::forward<A5>(a5)); ::std::forward<A4>(a4), ::std::forward<A5>(a5));
}; };
} }
#endif // GTEST_HAS_STD_FUNCTION_ #endif // GTEST_HAS_STD_FUNCTION_
...@@ -1298,9 +1238,9 @@ class MockFunction<R(A0, A1, A2, A3, A4, A5, A6)> { ...@@ -1298,9 +1238,9 @@ class MockFunction<R(A0, A1, A2, A3, A4, A5, A6)> {
::std::function<R(A0, A1, A2, A3, A4, A5, A6)> AsStdFunction() { ::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](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), 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),
::std::forward<A4>(a4), ::std::forward<A5>(a5), ::std::forward<A4>(a4), ::std::forward<A5>(a5),
::std::forward<A6>(a6)); ::std::forward<A6>(a6));
}; };
} }
#endif // GTEST_HAS_STD_FUNCTION_ #endif // GTEST_HAS_STD_FUNCTION_
...@@ -1321,9 +1261,9 @@ class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7)> { ...@@ -1321,9 +1261,9 @@ class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7)> {
::std::function<R(A0, A1, A2, A3, A4, A5, A6, A7)> AsStdFunction() { ::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](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), 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),
::std::forward<A4>(a4), ::std::forward<A5>(a5), ::std::forward<A4>(a4), ::std::forward<A5>(a5),
::std::forward<A6>(a6), ::std::forward<A7>(a7)); ::std::forward<A6>(a6), ::std::forward<A7>(a7));
}; };
} }
#endif // GTEST_HAS_STD_FUNCTION_ #endif // GTEST_HAS_STD_FUNCTION_
...@@ -1343,12 +1283,12 @@ class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8)> { ...@@ -1343,12 +1283,12 @@ class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8)> {
#if GTEST_HAS_STD_FUNCTION_ #if GTEST_HAS_STD_FUNCTION_
::std::function<R(A0, A1, A2, A3, A4, A5, A6, A7, A8)> AsStdFunction() { ::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, 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), 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),
::std::forward<A4>(a4), ::std::forward<A5>(a5), ::std::forward<A4>(a4), ::std::forward<A5>(a5),
::std::forward<A6>(a6), ::std::forward<A7>(a7), ::std::forward<A6>(a6), ::std::forward<A7>(a7),
::std::forward<A8>(a8)); ::std::forward<A8>(a8));
}; };
} }
#endif // GTEST_HAS_STD_FUNCTION_ #endif // GTEST_HAS_STD_FUNCTION_
...@@ -1368,13 +1308,13 @@ class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)> { ...@@ -1368,13 +1308,13 @@ class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
#if GTEST_HAS_STD_FUNCTION_ #if GTEST_HAS_STD_FUNCTION_
::std::function<R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)> AsStdFunction() { ::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, return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7,
A9 a9) -> R { A8 a8, A9 a9) -> R {
return this->Call(::std::forward<A0>(a0), ::std::forward<A1>(a1), 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),
::std::forward<A4>(a4), ::std::forward<A5>(a5), ::std::forward<A4>(a4), ::std::forward<A5>(a5),
::std::forward<A6>(a6), ::std::forward<A7>(a7), ::std::forward<A6>(a6), ::std::forward<A7>(a7),
::std::forward<A8>(a8), ::std::forward<A9>(a9)); ::std::forward<A8>(a8), ::std::forward<A9>(a9));
}; };
} }
#endif // GTEST_HAS_STD_FUNCTION_ #endif // GTEST_HAS_STD_FUNCTION_
......
...@@ -42,6 +42,8 @@ $var n = 10 $$ The maximum arity we support. ...@@ -42,6 +42,8 @@ $var n = 10 $$ The maximum arity we support.
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_ #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_ #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
#include <utility>
#include "gmock/gmock-spec-builders.h" #include "gmock/gmock-spec-builders.h"
#include "gmock/internal/gmock-internal-utils.h" #include "gmock/internal/gmock-internal-utils.h"
...@@ -69,7 +71,7 @@ $for i [[ ...@@ -69,7 +71,7 @@ $for i [[
$range j 1..i $range j 1..i
$var typename_As = [[$for j [[, typename A$j]]]] $var typename_As = [[$for j [[, typename A$j]]]]
$var As = [[$for j, [[A$j]]]] $var As = [[$for j, [[A$j]]]]
$var as = [[$for j, [[internal::forward<A$j>(a$j)]]]] $var as = [[$for j, [[std::forward<A$j>(a$j)]]]]
$var Aas = [[$for j, [[A$j a$j]]]] $var Aas = [[$for j, [[A$j a$j]]]]
$var ms = [[$for j, [[m$j]]]] $var ms = [[$for j, [[m$j]]]]
$var matchers = [[$for j, [[const Matcher<A$j>& m$j]]]] $var matchers = [[$for j, [[const Matcher<A$j>& m$j]]]]
...@@ -81,7 +83,7 @@ class FunctionMocker<R($As)> : public ...@@ -81,7 +83,7 @@ class FunctionMocker<R($As)> : public
typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple; typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
MockSpec<F> With($matchers) { MockSpec<F> With($matchers) {
return MockSpec<F>(this, ::testing::make_tuple($ms)); return MockSpec<F>(this, ::std::make_tuple($ms));
} }
R Invoke($Aas) { R Invoke($Aas) {
...@@ -184,7 +186,7 @@ $for i [[ ...@@ -184,7 +186,7 @@ $for i [[
$range j 1..i $range j 1..i
$var arg_as = [[$for j, [[GMOCK_ARG_(tn, $j, __VA_ARGS__) gmock_a$j]]]] $var arg_as = [[$for j, [[GMOCK_ARG_(tn, $j, __VA_ARGS__) gmock_a$j]]]]
$var as = [[$for j, \ $var as = [[$for j, \
[[::testing::internal::forward<GMOCK_ARG_(tn, $j, __VA_ARGS__)>(gmock_a$j)]]]] [[::std::forward<GMOCK_ARG_(tn, $j, __VA_ARGS__)>(gmock_a$j)]]]]
$var matcher_arg_as = [[$for j, \ $var matcher_arg_as = [[$for j, \
[[GMOCK_MATCHER_(tn, $j, __VA_ARGS__) gmock_a$j]]]] [[GMOCK_MATCHER_(tn, $j, __VA_ARGS__) gmock_a$j]]]]
$var matcher_as = [[$for j, [[gmock_a$j]]]] $var matcher_as = [[$for j, [[gmock_a$j]]]]
...@@ -194,7 +196,7 @@ $var anything_matchers = [[$for j, \ ...@@ -194,7 +196,7 @@ $var anything_matchers = [[$for j, \
#define GMOCK_METHOD$i[[]]_(tn, constness, ct, Method, ...) \ #define GMOCK_METHOD$i[[]]_(tn, constness, ct, Method, ...) \
GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
$arg_as) constness { \ $arg_as) constness { \
GTEST_COMPILE_ASSERT_((::testing::tuple_size< \ GTEST_COMPILE_ASSERT_((::std::tuple_size< \
tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value == $i), \ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value == $i), \
this_method_does_not_take_$i[[]]_argument[[$if i != 1 [[s]]]]); \ this_method_does_not_take_$i[[]]_argument[[$if i != 1 [[s]]]]); \
GMOCK_MOCKER_($i, constness, Method).SetOwnerAndName(this, #Method); \ GMOCK_MOCKER_($i, constness, Method).SetOwnerAndName(this, #Method); \
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include <iterator> #include <iterator>
#include <sstream> #include <sstream>
#include <string> #include <string>
#include <utility>
#include <vector> #include <vector>
#include "gmock/gmock-matchers.h" #include "gmock/gmock-matchers.h"
...@@ -51,7 +52,7 @@ namespace internal { ...@@ -51,7 +52,7 @@ namespace internal {
// The type of the i-th (0-based) field of Tuple. // The type of the i-th (0-based) field of Tuple.
#define GMOCK_FIELD_TYPE_(Tuple, i) \ #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 // TupleFields<Tuple, k0, ..., kn> is for selecting fields from a
// tuple of type Tuple. It has two members: // tuple of type Tuple. It has two members:
...@@ -59,10 +60,11 @@ namespace internal { ...@@ -59,10 +60,11 @@ namespace internal {
// type: a tuple type whose i-th field is the ki-th field of Tuple. // 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. // 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 // type is std::tuple<int, bool>, and
// GetSelectedFields(make_tuple(true, 'a', 42)) is (42, true). // 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, 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, int k4 = -1, int k5 = -1, int k6 = -1, int k7 = -1, int k8 = -1,
...@@ -74,15 +76,15 @@ template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6, ...@@ -74,15 +76,15 @@ template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,
int k7, int k8, int k9> int k7, int k8, int k9>
class TupleFields { class TupleFields {
public: public:
typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), typedef ::std::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), GMOCK_FIELD_TYPE_(Tuple,
GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2), k1), GMOCK_FIELD_TYPE_(Tuple, k2), GMOCK_FIELD_TYPE_(Tuple, k3),
GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4), GMOCK_FIELD_TYPE_(Tuple, k4), GMOCK_FIELD_TYPE_(Tuple, k5),
GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6), GMOCK_FIELD_TYPE_(Tuple, k6), GMOCK_FIELD_TYPE_(Tuple, k7),
GMOCK_FIELD_TYPE_(Tuple, k7), GMOCK_FIELD_TYPE_(Tuple, k8), GMOCK_FIELD_TYPE_(Tuple, k8), GMOCK_FIELD_TYPE_(Tuple, k9)> type;
GMOCK_FIELD_TYPE_(Tuple, k9)> type;
static type GetSelectedFields(const Tuple& t) { 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),
get<k5>(t), get<k6>(t), get<k7>(t), get<k8>(t), get<k9>(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 +93,7 @@ class TupleFields { ...@@ -91,7 +93,7 @@ class TupleFields {
template <class Tuple> template <class Tuple>
class TupleFields<Tuple, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1> { class TupleFields<Tuple, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
public: public:
typedef ::testing::tuple<> type; typedef ::std::tuple<> type;
static type GetSelectedFields(const Tuple& /* t */) { static type GetSelectedFields(const Tuple& /* t */) {
return type(); return type();
} }
...@@ -100,77 +102,77 @@ class TupleFields<Tuple, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1> { ...@@ -100,77 +102,77 @@ class TupleFields<Tuple, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
template <class Tuple, int k0> template <class Tuple, int k0>
class TupleFields<Tuple, k0, -1, -1, -1, -1, -1, -1, -1, -1, -1> { class TupleFields<Tuple, k0, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
public: 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) { static type GetSelectedFields(const Tuple& t) {
return type(get<k0>(t)); return type(std::get<k0>(t));
} }
}; };
template <class Tuple, int k0, int k1> template <class Tuple, int k0, int k1>
class TupleFields<Tuple, k0, k1, -1, -1, -1, -1, -1, -1, -1, -1> { class TupleFields<Tuple, k0, k1, -1, -1, -1, -1, -1, -1, -1, -1> {
public: public:
typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), typedef ::std::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), GMOCK_FIELD_TYPE_(Tuple,
GMOCK_FIELD_TYPE_(Tuple, k1)> type; k1)> type;
static type GetSelectedFields(const Tuple& t) { 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> template <class Tuple, int k0, int k1, int k2>
class TupleFields<Tuple, k0, k1, k2, -1, -1, -1, -1, -1, -1, -1> { class TupleFields<Tuple, k0, k1, k2, -1, -1, -1, -1, -1, -1, -1> {
public: public:
typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), typedef ::std::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), GMOCK_FIELD_TYPE_(Tuple,
GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2)> type; k1), GMOCK_FIELD_TYPE_(Tuple, k2)> type;
static type GetSelectedFields(const Tuple& t) { 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> template <class Tuple, int k0, int k1, int k2, int k3>
class TupleFields<Tuple, k0, k1, k2, k3, -1, -1, -1, -1, -1, -1> { class TupleFields<Tuple, k0, k1, k2, k3, -1, -1, -1, -1, -1, -1> {
public: public:
typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), typedef ::std::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), GMOCK_FIELD_TYPE_(Tuple,
GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2), k1), GMOCK_FIELD_TYPE_(Tuple, k2), GMOCK_FIELD_TYPE_(Tuple, k3)> type;
GMOCK_FIELD_TYPE_(Tuple, k3)> type;
static type GetSelectedFields(const Tuple& t) { 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> 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> { class TupleFields<Tuple, k0, k1, k2, k3, k4, -1, -1, -1, -1, -1> {
public: public:
typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), typedef ::std::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), GMOCK_FIELD_TYPE_(Tuple,
GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2), k1), GMOCK_FIELD_TYPE_(Tuple, k2), GMOCK_FIELD_TYPE_(Tuple, k3),
GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4)> type; GMOCK_FIELD_TYPE_(Tuple, k4)> type;
static type GetSelectedFields(const Tuple& t) { 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> 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> { class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, -1, -1, -1, -1> {
public: public:
typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), typedef ::std::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), GMOCK_FIELD_TYPE_(Tuple,
GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2), k1), GMOCK_FIELD_TYPE_(Tuple, k2), GMOCK_FIELD_TYPE_(Tuple, k3),
GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4), GMOCK_FIELD_TYPE_(Tuple, k4), GMOCK_FIELD_TYPE_(Tuple, k5)> type;
GMOCK_FIELD_TYPE_(Tuple, k5)> type;
static type GetSelectedFields(const Tuple& t) { 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),
get<k5>(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> 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> { class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, -1, -1, -1> {
public: public:
typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), typedef ::std::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), GMOCK_FIELD_TYPE_(Tuple,
GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2), k1), GMOCK_FIELD_TYPE_(Tuple, k2), GMOCK_FIELD_TYPE_(Tuple, k3),
GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4), GMOCK_FIELD_TYPE_(Tuple, k4), GMOCK_FIELD_TYPE_(Tuple, k5),
GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6)> type; GMOCK_FIELD_TYPE_(Tuple, k6)> type;
static type GetSelectedFields(const Tuple& t) { 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),
get<k5>(t), get<k6>(t)); std::get<k3>(t), std::get<k4>(t), std::get<k5>(t), std::get<k6>(t));
} }
}; };
...@@ -178,14 +180,14 @@ template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6, ...@@ -178,14 +180,14 @@ template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,
int k7> int k7>
class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, k7, -1, -1> { class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, k7, -1, -1> {
public: public:
typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), typedef ::std::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), GMOCK_FIELD_TYPE_(Tuple,
GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2), k1), GMOCK_FIELD_TYPE_(Tuple, k2), GMOCK_FIELD_TYPE_(Tuple, k3),
GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4), GMOCK_FIELD_TYPE_(Tuple, k4), GMOCK_FIELD_TYPE_(Tuple, k5),
GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6), GMOCK_FIELD_TYPE_(Tuple, k6), GMOCK_FIELD_TYPE_(Tuple, k7)> type;
GMOCK_FIELD_TYPE_(Tuple, k7)> type;
static type GetSelectedFields(const Tuple& t) { 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),
get<k5>(t), get<k6>(t), get<k7>(t)); std::get<k3>(t), std::get<k4>(t), std::get<k5>(t), std::get<k6>(t),
std::get<k7>(t));
} }
}; };
...@@ -193,14 +195,15 @@ template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6, ...@@ -193,14 +195,15 @@ template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,
int k7, int k8> int k7, int k8>
class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, k7, k8, -1> { class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, k7, k8, -1> {
public: public:
typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), typedef ::std::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), GMOCK_FIELD_TYPE_(Tuple,
GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2), k1), GMOCK_FIELD_TYPE_(Tuple, k2), GMOCK_FIELD_TYPE_(Tuple, k3),
GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4), GMOCK_FIELD_TYPE_(Tuple, k4), GMOCK_FIELD_TYPE_(Tuple, k5),
GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6), GMOCK_FIELD_TYPE_(Tuple, k6), GMOCK_FIELD_TYPE_(Tuple, k7),
GMOCK_FIELD_TYPE_(Tuple, k7), GMOCK_FIELD_TYPE_(Tuple, k8)> type; GMOCK_FIELD_TYPE_(Tuple, k8)> type;
static type GetSelectedFields(const Tuple& t) { 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),
get<k5>(t), get<k6>(t), get<k7>(t), get<k8>(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));
} }
}; };
...@@ -297,182 +300,6 @@ class ArgsMatcher { ...@@ -297,182 +300,6 @@ class ArgsMatcher {
GTEST_DISALLOW_ASSIGN_(ArgsMatcher); GTEST_DISALLOW_ASSIGN_(ArgsMatcher);
}; };
// A set of metafunctions for computing the result type of AllOf.
// AllOf(m1, ..., mN) returns
// AllOfResultN<decltype(m1), ..., decltype(mN)>::type.
// Although AllOf isn't defined for one argument, AllOfResult1 is defined
// to simplify the implementation.
template <typename M1>
struct AllOfResult1 {
typedef M1 type;
};
template <typename M1, typename M2>
struct AllOfResult2 {
typedef BothOfMatcher<
typename AllOfResult1<M1>::type,
typename AllOfResult1<M2>::type
> type;
};
template <typename M1, typename M2, typename M3>
struct AllOfResult3 {
typedef BothOfMatcher<
typename AllOfResult1<M1>::type,
typename AllOfResult2<M2, M3>::type
> type;
};
template <typename M1, typename M2, typename M3, typename M4>
struct AllOfResult4 {
typedef BothOfMatcher<
typename AllOfResult2<M1, M2>::type,
typename AllOfResult2<M3, M4>::type
> type;
};
template <typename M1, typename M2, typename M3, typename M4, typename M5>
struct AllOfResult5 {
typedef BothOfMatcher<
typename AllOfResult2<M1, M2>::type,
typename AllOfResult3<M3, M4, M5>::type
> type;
};
template <typename M1, typename M2, typename M3, typename M4, typename M5,
typename M6>
struct AllOfResult6 {
typedef BothOfMatcher<
typename AllOfResult3<M1, M2, M3>::type,
typename AllOfResult3<M4, M5, M6>::type
> type;
};
template <typename M1, typename M2, typename M3, typename M4, typename M5,
typename M6, typename M7>
struct AllOfResult7 {
typedef BothOfMatcher<
typename AllOfResult3<M1, M2, M3>::type,
typename AllOfResult4<M4, M5, M6, M7>::type
> type;
};
template <typename M1, typename M2, typename M3, typename M4, typename M5,
typename M6, typename M7, typename M8>
struct AllOfResult8 {
typedef BothOfMatcher<
typename AllOfResult4<M1, M2, M3, M4>::type,
typename AllOfResult4<M5, M6, M7, M8>::type
> type;
};
template <typename M1, typename M2, typename M3, typename M4, typename M5,
typename M6, typename M7, typename M8, typename M9>
struct AllOfResult9 {
typedef BothOfMatcher<
typename AllOfResult4<M1, M2, M3, M4>::type,
typename AllOfResult5<M5, M6, M7, M8, M9>::type
> type;
};
template <typename M1, typename M2, typename M3, typename M4, typename M5,
typename M6, typename M7, typename M8, typename M9, typename M10>
struct AllOfResult10 {
typedef BothOfMatcher<
typename AllOfResult5<M1, M2, M3, M4, M5>::type,
typename AllOfResult5<M6, M7, M8, M9, M10>::type
> type;
};
// A set of metafunctions for computing the result type of AnyOf.
// AnyOf(m1, ..., mN) returns
// AnyOfResultN<decltype(m1), ..., decltype(mN)>::type.
// Although AnyOf isn't defined for one argument, AnyOfResult1 is defined
// to simplify the implementation.
template <typename M1>
struct AnyOfResult1 {
typedef M1 type;
};
template <typename M1, typename M2>
struct AnyOfResult2 {
typedef EitherOfMatcher<
typename AnyOfResult1<M1>::type,
typename AnyOfResult1<M2>::type
> type;
};
template <typename M1, typename M2, typename M3>
struct AnyOfResult3 {
typedef EitherOfMatcher<
typename AnyOfResult1<M1>::type,
typename AnyOfResult2<M2, M3>::type
> type;
};
template <typename M1, typename M2, typename M3, typename M4>
struct AnyOfResult4 {
typedef EitherOfMatcher<
typename AnyOfResult2<M1, M2>::type,
typename AnyOfResult2<M3, M4>::type
> type;
};
template <typename M1, typename M2, typename M3, typename M4, typename M5>
struct AnyOfResult5 {
typedef EitherOfMatcher<
typename AnyOfResult2<M1, M2>::type,
typename AnyOfResult3<M3, M4, M5>::type
> type;
};
template <typename M1, typename M2, typename M3, typename M4, typename M5,
typename M6>
struct AnyOfResult6 {
typedef EitherOfMatcher<
typename AnyOfResult3<M1, M2, M3>::type,
typename AnyOfResult3<M4, M5, M6>::type
> type;
};
template <typename M1, typename M2, typename M3, typename M4, typename M5,
typename M6, typename M7>
struct AnyOfResult7 {
typedef EitherOfMatcher<
typename AnyOfResult3<M1, M2, M3>::type,
typename AnyOfResult4<M4, M5, M6, M7>::type
> type;
};
template <typename M1, typename M2, typename M3, typename M4, typename M5,
typename M6, typename M7, typename M8>
struct AnyOfResult8 {
typedef EitherOfMatcher<
typename AnyOfResult4<M1, M2, M3, M4>::type,
typename AnyOfResult4<M5, M6, M7, M8>::type
> type;
};
template <typename M1, typename M2, typename M3, typename M4, typename M5,
typename M6, typename M7, typename M8, typename M9>
struct AnyOfResult9 {
typedef EitherOfMatcher<
typename AnyOfResult4<M1, M2, M3, M4>::type,
typename AnyOfResult5<M5, M6, M7, M8, M9>::type
> type;
};
template <typename M1, typename M2, typename M3, typename M4, typename M5,
typename M6, typename M7, typename M8, typename M9, typename M10>
struct AnyOfResult10 {
typedef EitherOfMatcher<
typename AnyOfResult5<M1, M2, M3, M4, M5>::type,
typename AnyOfResult5<M6, M7, M8, M9, M10>::type
> type;
};
} // namespace internal } // namespace internal
// Args<N1, N2, ..., Nk>(a_matcher) matches a tuple if the selected // Args<N1, N2, ..., Nk>(a_matcher) matches a tuple if the selected
...@@ -553,171 +380,6 @@ Args(const InnerMatcher& matcher) { ...@@ -553,171 +380,6 @@ Args(const InnerMatcher& matcher) {
k9, k10>(matcher); k9, k10>(matcher);
} }
// AllOf(m1, m2, ..., mk) matches any value that matches all of the given
// sub-matchers. AllOf is called fully qualified to prevent ADL from firing.
template <typename M1, typename M2>
inline typename internal::AllOfResult2<M1, M2>::type
AllOf(M1 m1, M2 m2) {
return typename internal::AllOfResult2<M1, M2>::type(
m1,
m2);
}
template <typename M1, typename M2, typename M3>
inline typename internal::AllOfResult3<M1, M2, M3>::type
AllOf(M1 m1, M2 m2, M3 m3) {
return typename internal::AllOfResult3<M1, M2, M3>::type(
m1,
::testing::AllOf(m2, m3));
}
template <typename M1, typename M2, typename M3, typename M4>
inline typename internal::AllOfResult4<M1, M2, M3, M4>::type
AllOf(M1 m1, M2 m2, M3 m3, M4 m4) {
return typename internal::AllOfResult4<M1, M2, M3, M4>::type(
::testing::AllOf(m1, m2),
::testing::AllOf(m3, m4));
}
template <typename M1, typename M2, typename M3, typename M4, typename M5>
inline typename internal::AllOfResult5<M1, M2, M3, M4, M5>::type
AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5) {
return typename internal::AllOfResult5<M1, M2, M3, M4, M5>::type(
::testing::AllOf(m1, m2),
::testing::AllOf(m3, m4, m5));
}
template <typename M1, typename M2, typename M3, typename M4, typename M5,
typename M6>
inline typename internal::AllOfResult6<M1, M2, M3, M4, M5, M6>::type
AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6) {
return typename internal::AllOfResult6<M1, M2, M3, M4, M5, M6>::type(
::testing::AllOf(m1, m2, m3),
::testing::AllOf(m4, m5, m6));
}
template <typename M1, typename M2, typename M3, typename M4, typename M5,
typename M6, typename M7>
inline typename internal::AllOfResult7<M1, M2, M3, M4, M5, M6, M7>::type
AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7) {
return typename internal::AllOfResult7<M1, M2, M3, M4, M5, M6, M7>::type(
::testing::AllOf(m1, m2, m3),
::testing::AllOf(m4, m5, m6, m7));
}
template <typename M1, typename M2, typename M3, typename M4, typename M5,
typename M6, typename M7, typename M8>
inline typename internal::AllOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::type
AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8) {
return typename internal::AllOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::type(
::testing::AllOf(m1, m2, m3, m4),
::testing::AllOf(m5, m6, m7, m8));
}
template <typename M1, typename M2, typename M3, typename M4, typename M5,
typename M6, typename M7, typename M8, typename M9>
inline typename internal::AllOfResult9<M1, M2, M3, M4, M5, M6, M7, M8, M9>::type
AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9) {
return typename internal::AllOfResult9<M1, M2, M3, M4, M5, M6, M7, M8,
M9>::type(
::testing::AllOf(m1, m2, m3, m4),
::testing::AllOf(m5, m6, m7, m8, m9));
}
template <typename M1, typename M2, typename M3, typename M4, typename M5,
typename M6, typename M7, typename M8, typename M9, typename M10>
inline typename internal::AllOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9,
M10>::type
AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
return typename internal::AllOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9,
M10>::type(
::testing::AllOf(m1, m2, m3, m4, m5),
::testing::AllOf(m6, m7, m8, m9, m10));
}
// 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.
template <typename M1, typename M2>
inline typename internal::AnyOfResult2<M1, M2>::type
AnyOf(M1 m1, M2 m2) {
return typename internal::AnyOfResult2<M1, M2>::type(
m1,
m2);
}
template <typename M1, typename M2, typename M3>
inline typename internal::AnyOfResult3<M1, M2, M3>::type
AnyOf(M1 m1, M2 m2, M3 m3) {
return typename internal::AnyOfResult3<M1, M2, M3>::type(
m1,
::testing::AnyOf(m2, m3));
}
template <typename M1, typename M2, typename M3, typename M4>
inline typename internal::AnyOfResult4<M1, M2, M3, M4>::type
AnyOf(M1 m1, M2 m2, M3 m3, M4 m4) {
return typename internal::AnyOfResult4<M1, M2, M3, M4>::type(
::testing::AnyOf(m1, m2),
::testing::AnyOf(m3, m4));
}
template <typename M1, typename M2, typename M3, typename M4, typename M5>
inline typename internal::AnyOfResult5<M1, M2, M3, M4, M5>::type
AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5) {
return typename internal::AnyOfResult5<M1, M2, M3, M4, M5>::type(
::testing::AnyOf(m1, m2),
::testing::AnyOf(m3, m4, m5));
}
template <typename M1, typename M2, typename M3, typename M4, typename M5,
typename M6>
inline typename internal::AnyOfResult6<M1, M2, M3, M4, M5, M6>::type
AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6) {
return typename internal::AnyOfResult6<M1, M2, M3, M4, M5, M6>::type(
::testing::AnyOf(m1, m2, m3),
::testing::AnyOf(m4, m5, m6));
}
template <typename M1, typename M2, typename M3, typename M4, typename M5,
typename M6, typename M7>
inline typename internal::AnyOfResult7<M1, M2, M3, M4, M5, M6, M7>::type
AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7) {
return typename internal::AnyOfResult7<M1, M2, M3, M4, M5, M6, M7>::type(
::testing::AnyOf(m1, m2, m3),
::testing::AnyOf(m4, m5, m6, m7));
}
template <typename M1, typename M2, typename M3, typename M4, typename M5,
typename M6, typename M7, typename M8>
inline typename internal::AnyOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::type
AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8) {
return typename internal::AnyOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::type(
::testing::AnyOf(m1, m2, m3, m4),
::testing::AnyOf(m5, m6, m7, m8));
}
template <typename M1, typename M2, typename M3, typename M4, typename M5,
typename M6, typename M7, typename M8, typename M9>
inline typename internal::AnyOfResult9<M1, M2, M3, M4, M5, M6, M7, M8, M9>::type
AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9) {
return typename internal::AnyOfResult9<M1, M2, M3, M4, M5, M6, M7, M8,
M9>::type(
::testing::AnyOf(m1, m2, m3, m4),
::testing::AnyOf(m5, m6, m7, m8, m9));
}
template <typename M1, typename M2, typename M3, typename M4, typename M5,
typename M6, typename M7, typename M8, typename M9, typename M10>
inline typename internal::AnyOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9,
M10>::type
AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
return typename internal::AnyOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9,
M10>::type(
::testing::AnyOf(m1, m2, m3, m4, m5),
::testing::AnyOf(m6, m7, m8, m9, m10));
}
} // namespace testing } // namespace testing
...@@ -965,7 +627,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { ...@@ -965,7 +627,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(\ return ::testing::internal::FormatMatcherDescription(\
negation, #name, \ negation, #name, \
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
::testing::tuple<>()));\ ::std::tuple<>()));\
}\ }\
};\ };\
template <typename arg_type>\ template <typename arg_type>\
...@@ -995,7 +657,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { ...@@ -995,7 +657,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
GTEST_REFERENCE_TO_CONST_(arg_type)> {\ GTEST_REFERENCE_TO_CONST_(arg_type)> {\
public:\ public:\
explicit gmock_Impl(p0##_type gmock_p0)\ explicit gmock_Impl(p0##_type gmock_p0)\
: p0(::testing::internal::move(gmock_p0)) {}\ : p0(::std::move(gmock_p0)) {}\
virtual bool MatchAndExplain(\ virtual bool MatchAndExplain(\
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
::testing::MatchResultListener* result_listener) const;\ ::testing::MatchResultListener* result_listener) const;\
...@@ -1015,7 +677,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { ...@@ -1015,7 +677,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(\ return ::testing::internal::FormatMatcherDescription(\
negation, #name, \ negation, #name, \
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
::testing::tuple<p0##_type>(p0)));\ ::std::tuple<p0##_type>(p0)));\
}\ }\
};\ };\
template <typename arg_type>\ template <typename arg_type>\
...@@ -1023,8 +685,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { ...@@ -1023,8 +685,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
return ::testing::Matcher<arg_type>(\ return ::testing::Matcher<arg_type>(\
new gmock_Impl<arg_type>(p0));\ new gmock_Impl<arg_type>(p0));\
}\ }\
explicit name##MatcherP(p0##_type gmock_p0) : \ explicit name##MatcherP(p0##_type gmock_p0) : p0(::std::move(gmock_p0)) {\
p0(::testing::internal::move(gmock_p0)) {\
}\ }\
p0##_type const p0;\ p0##_type const p0;\
private:\ private:\
...@@ -1049,8 +710,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { ...@@ -1049,8 +710,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
GTEST_REFERENCE_TO_CONST_(arg_type)> {\ GTEST_REFERENCE_TO_CONST_(arg_type)> {\
public:\ public:\
gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1)\ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1)\
: p0(::testing::internal::move(gmock_p0)), \ : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)) {}\
p1(::testing::internal::move(gmock_p1)) {}\
virtual bool MatchAndExplain(\ virtual bool MatchAndExplain(\
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
::testing::MatchResultListener* result_listener) const;\ ::testing::MatchResultListener* result_listener) const;\
...@@ -1071,7 +731,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { ...@@ -1071,7 +731,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(\ return ::testing::internal::FormatMatcherDescription(\
negation, #name, \ negation, #name, \
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
::testing::tuple<p0##_type, p1##_type>(p0, p1)));\ ::std::tuple<p0##_type, p1##_type>(p0, p1)));\
}\ }\
};\ };\
template <typename arg_type>\ template <typename arg_type>\
...@@ -1080,8 +740,8 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { ...@@ -1080,8 +740,8 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
new gmock_Impl<arg_type>(p0, p1));\ new gmock_Impl<arg_type>(p0, p1));\
}\ }\
name##MatcherP2(p0##_type gmock_p0, \ name##MatcherP2(p0##_type gmock_p0, \
p1##_type gmock_p1) : p0(::testing::internal::move(gmock_p0)), \ p1##_type gmock_p1) : p0(::std::move(gmock_p0)), \
p1(::testing::internal::move(gmock_p1)) {\ p1(::std::move(gmock_p1)) {\
}\ }\
p0##_type const p0;\ p0##_type const p0;\
p1##_type const p1;\ p1##_type const p1;\
...@@ -1109,9 +769,8 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { ...@@ -1109,9 +769,8 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
GTEST_REFERENCE_TO_CONST_(arg_type)> {\ GTEST_REFERENCE_TO_CONST_(arg_type)> {\
public:\ public:\
gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2)\ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2)\
: p0(::testing::internal::move(gmock_p0)), \ : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
p1(::testing::internal::move(gmock_p1)), \ p2(::std::move(gmock_p2)) {}\
p2(::testing::internal::move(gmock_p2)) {}\
virtual bool MatchAndExplain(\ virtual bool MatchAndExplain(\
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
::testing::MatchResultListener* result_listener) const;\ ::testing::MatchResultListener* result_listener) const;\
...@@ -1133,8 +792,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { ...@@ -1133,8 +792,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(\ return ::testing::internal::FormatMatcherDescription(\
negation, #name, \ negation, #name, \
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
::testing::tuple<p0##_type, p1##_type, p2##_type>(p0, p1, \ ::std::tuple<p0##_type, p1##_type, p2##_type>(p0, p1, p2)));\
p2)));\
}\ }\
};\ };\
template <typename arg_type>\ template <typename arg_type>\
...@@ -1143,9 +801,8 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { ...@@ -1143,9 +801,8 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
new gmock_Impl<arg_type>(p0, p1, p2));\ new gmock_Impl<arg_type>(p0, p1, p2));\
}\ }\
name##MatcherP3(p0##_type gmock_p0, p1##_type gmock_p1, \ name##MatcherP3(p0##_type gmock_p0, p1##_type gmock_p1, \
p2##_type gmock_p2) : p0(::testing::internal::move(gmock_p0)), \ p2##_type gmock_p2) : p0(::std::move(gmock_p0)), \
p1(::testing::internal::move(gmock_p1)), \ p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)) {\
p2(::testing::internal::move(gmock_p2)) {\
}\ }\
p0##_type const p0;\ p0##_type const p0;\
p1##_type const p1;\ p1##_type const p1;\
...@@ -1176,10 +833,8 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { ...@@ -1176,10 +833,8 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
public:\ public:\
gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
p3##_type gmock_p3)\ p3##_type gmock_p3)\
: p0(::testing::internal::move(gmock_p0)), \ : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
p1(::testing::internal::move(gmock_p1)), \ p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)) {}\
p2(::testing::internal::move(gmock_p2)), \
p3(::testing::internal::move(gmock_p3)) {}\
virtual bool MatchAndExplain(\ virtual bool MatchAndExplain(\
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
::testing::MatchResultListener* result_listener) const;\ ::testing::MatchResultListener* result_listener) const;\
...@@ -1202,8 +857,8 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { ...@@ -1202,8 +857,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(\ return ::testing::internal::FormatMatcherDescription(\
negation, #name, \ negation, #name, \
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
::testing::tuple<p0##_type, p1##_type, p2##_type, \ ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type>(p0, \
p3##_type>(p0, p1, p2, p3)));\ p1, p2, p3)));\
}\ }\
};\ };\
template <typename arg_type>\ template <typename arg_type>\
...@@ -1212,11 +867,9 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { ...@@ -1212,11 +867,9 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
new gmock_Impl<arg_type>(p0, p1, p2, p3));\ new gmock_Impl<arg_type>(p0, p1, p2, p3));\
}\ }\
name##MatcherP4(p0##_type gmock_p0, p1##_type gmock_p1, \ name##MatcherP4(p0##_type gmock_p0, p1##_type gmock_p1, \
p2##_type gmock_p2, \ p2##_type gmock_p2, p3##_type gmock_p3) : p0(::std::move(gmock_p0)), \
p3##_type gmock_p3) : p0(::testing::internal::move(gmock_p0)), \ p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
p1(::testing::internal::move(gmock_p1)), \ p3(::std::move(gmock_p3)) {\
p2(::testing::internal::move(gmock_p2)), \
p3(::testing::internal::move(gmock_p3)) {\
}\ }\
p0##_type const p0;\ p0##_type const p0;\
p1##_type const p1;\ p1##_type const p1;\
...@@ -1252,11 +905,9 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { ...@@ -1252,11 +905,9 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
public:\ public:\
gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
p3##_type gmock_p3, p4##_type gmock_p4)\ p3##_type gmock_p3, p4##_type gmock_p4)\
: p0(::testing::internal::move(gmock_p0)), \ : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
p1(::testing::internal::move(gmock_p1)), \ p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \
p2(::testing::internal::move(gmock_p2)), \ p4(::std::move(gmock_p4)) {}\
p3(::testing::internal::move(gmock_p3)), \
p4(::testing::internal::move(gmock_p4)) {}\
virtual bool MatchAndExplain(\ virtual bool MatchAndExplain(\
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
::testing::MatchResultListener* result_listener) const;\ ::testing::MatchResultListener* result_listener) const;\
...@@ -1280,7 +931,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { ...@@ -1280,7 +931,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(\ return ::testing::internal::FormatMatcherDescription(\
negation, #name, \ negation, #name, \
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ ::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)));\ p4##_type>(p0, p1, p2, p3, p4)));\
}\ }\
};\ };\
...@@ -1291,11 +942,9 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { ...@@ -1291,11 +942,9 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
}\ }\
name##MatcherP5(p0##_type gmock_p0, p1##_type gmock_p1, \ name##MatcherP5(p0##_type gmock_p0, p1##_type gmock_p1, \
p2##_type gmock_p2, p3##_type gmock_p3, \ p2##_type gmock_p2, p3##_type gmock_p3, \
p4##_type gmock_p4) : p0(::testing::internal::move(gmock_p0)), \ p4##_type gmock_p4) : p0(::std::move(gmock_p0)), \
p1(::testing::internal::move(gmock_p1)), \ p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
p2(::testing::internal::move(gmock_p2)), \ p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)) {\
p3(::testing::internal::move(gmock_p3)), \
p4(::testing::internal::move(gmock_p4)) {\
}\ }\
p0##_type const p0;\ p0##_type const p0;\
p1##_type const p1;\ p1##_type const p1;\
...@@ -1332,12 +981,9 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { ...@@ -1332,12 +981,9 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
public:\ public:\
gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5)\ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5)\
: p0(::testing::internal::move(gmock_p0)), \ : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
p1(::testing::internal::move(gmock_p1)), \ p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \
p2(::testing::internal::move(gmock_p2)), \ p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)) {}\
p3(::testing::internal::move(gmock_p3)), \
p4(::testing::internal::move(gmock_p4)), \
p5(::testing::internal::move(gmock_p5)) {}\
virtual bool MatchAndExplain(\ virtual bool MatchAndExplain(\
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
::testing::MatchResultListener* result_listener) const;\ ::testing::MatchResultListener* result_listener) const;\
...@@ -1362,7 +1008,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { ...@@ -1362,7 +1008,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(\ return ::testing::internal::FormatMatcherDescription(\
negation, #name, \ negation, #name, \
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ ::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)));\ p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5)));\
}\ }\
};\ };\
...@@ -1373,12 +1019,10 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { ...@@ -1373,12 +1019,10 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
}\ }\
name##MatcherP6(p0##_type gmock_p0, p1##_type gmock_p1, \ name##MatcherP6(p0##_type gmock_p0, p1##_type gmock_p1, \
p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
p5##_type gmock_p5) : p0(::testing::internal::move(gmock_p0)), \ p5##_type gmock_p5) : p0(::std::move(gmock_p0)), \
p1(::testing::internal::move(gmock_p1)), \ p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
p2(::testing::internal::move(gmock_p2)), \ p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
p3(::testing::internal::move(gmock_p3)), \ p5(::std::move(gmock_p5)) {\
p4(::testing::internal::move(gmock_p4)), \
p5(::testing::internal::move(gmock_p5)) {\
}\ }\
p0##_type const p0;\ p0##_type const p0;\
p1##_type const p1;\ p1##_type const p1;\
...@@ -1418,13 +1062,10 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { ...@@ -1418,13 +1062,10 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
p6##_type gmock_p6)\ p6##_type gmock_p6)\
: p0(::testing::internal::move(gmock_p0)), \ : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
p1(::testing::internal::move(gmock_p1)), \ p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \
p2(::testing::internal::move(gmock_p2)), \ p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \
p3(::testing::internal::move(gmock_p3)), \ p6(::std::move(gmock_p6)) {}\
p4(::testing::internal::move(gmock_p4)), \
p5(::testing::internal::move(gmock_p5)), \
p6(::testing::internal::move(gmock_p6)) {}\
virtual bool MatchAndExplain(\ virtual bool MatchAndExplain(\
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
::testing::MatchResultListener* result_listener) const;\ ::testing::MatchResultListener* result_listener) const;\
...@@ -1450,7 +1091,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { ...@@ -1450,7 +1091,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(\ return ::testing::internal::FormatMatcherDescription(\
negation, #name, \ negation, #name, \
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ ::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, \ p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, \
p6)));\ p6)));\
}\ }\
...@@ -1462,14 +1103,10 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { ...@@ -1462,14 +1103,10 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
}\ }\
name##MatcherP7(p0##_type gmock_p0, p1##_type gmock_p1, \ name##MatcherP7(p0##_type gmock_p0, p1##_type gmock_p1, \
p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
p5##_type gmock_p5, \ p5##_type gmock_p5, p6##_type gmock_p6) : p0(::std::move(gmock_p0)), \
p6##_type gmock_p6) : p0(::testing::internal::move(gmock_p0)), \ p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
p1(::testing::internal::move(gmock_p1)), \ p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
p2(::testing::internal::move(gmock_p2)), \ p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)) {\
p3(::testing::internal::move(gmock_p3)), \
p4(::testing::internal::move(gmock_p4)), \
p5(::testing::internal::move(gmock_p5)), \
p6(::testing::internal::move(gmock_p6)) {\
}\ }\
p0##_type const p0;\ p0##_type const p0;\
p1##_type const p1;\ p1##_type const p1;\
...@@ -1513,14 +1150,10 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { ...@@ -1513,14 +1150,10 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
p6##_type gmock_p6, p7##_type gmock_p7)\ p6##_type gmock_p6, p7##_type gmock_p7)\
: p0(::testing::internal::move(gmock_p0)), \ : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
p1(::testing::internal::move(gmock_p1)), \ p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \
p2(::testing::internal::move(gmock_p2)), \ p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \
p3(::testing::internal::move(gmock_p3)), \ p6(::std::move(gmock_p6)), p7(::std::move(gmock_p7)) {}\
p4(::testing::internal::move(gmock_p4)), \
p5(::testing::internal::move(gmock_p5)), \
p6(::testing::internal::move(gmock_p6)), \
p7(::testing::internal::move(gmock_p7)) {}\
virtual bool MatchAndExplain(\ virtual bool MatchAndExplain(\
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
::testing::MatchResultListener* result_listener) const;\ ::testing::MatchResultListener* result_listener) const;\
...@@ -1547,7 +1180,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { ...@@ -1547,7 +1180,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(\ return ::testing::internal::FormatMatcherDescription(\
negation, #name, \ negation, #name, \
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ ::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, \ p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, \
p3, p4, p5, p6, p7)));\ p3, p4, p5, p6, p7)));\
}\ }\
...@@ -1560,14 +1193,11 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { ...@@ -1560,14 +1193,11 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
name##MatcherP8(p0##_type gmock_p0, p1##_type gmock_p1, \ name##MatcherP8(p0##_type gmock_p0, p1##_type gmock_p1, \
p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
p5##_type gmock_p5, p6##_type gmock_p6, \ p5##_type gmock_p5, p6##_type gmock_p6, \
p7##_type gmock_p7) : p0(::testing::internal::move(gmock_p0)), \ p7##_type gmock_p7) : p0(::std::move(gmock_p0)), \
p1(::testing::internal::move(gmock_p1)), \ p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
p2(::testing::internal::move(gmock_p2)), \ p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
p3(::testing::internal::move(gmock_p3)), \ p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \
p4(::testing::internal::move(gmock_p4)), \ p7(::std::move(gmock_p7)) {\
p5(::testing::internal::move(gmock_p5)), \
p6(::testing::internal::move(gmock_p6)), \
p7(::testing::internal::move(gmock_p7)) {\
}\ }\
p0##_type const p0;\ p0##_type const p0;\
p1##_type const p1;\ p1##_type const p1;\
...@@ -1614,15 +1244,11 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { ...@@ -1614,15 +1244,11 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8)\ p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8)\
: p0(::testing::internal::move(gmock_p0)), \ : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
p1(::testing::internal::move(gmock_p1)), \ p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \
p2(::testing::internal::move(gmock_p2)), \ p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \
p3(::testing::internal::move(gmock_p3)), \ p6(::std::move(gmock_p6)), p7(::std::move(gmock_p7)), \
p4(::testing::internal::move(gmock_p4)), \ p8(::std::move(gmock_p8)) {}\
p5(::testing::internal::move(gmock_p5)), \
p6(::testing::internal::move(gmock_p6)), \
p7(::testing::internal::move(gmock_p7)), \
p8(::testing::internal::move(gmock_p8)) {}\
virtual bool MatchAndExplain(\ virtual bool MatchAndExplain(\
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
::testing::MatchResultListener* result_listener) const;\ ::testing::MatchResultListener* result_listener) const;\
...@@ -1650,7 +1276,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { ...@@ -1650,7 +1276,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(\ return ::testing::internal::FormatMatcherDescription(\
negation, #name, \ negation, #name, \
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ ::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, \ p4##_type, p5##_type, p6##_type, p7##_type, \
p8##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8)));\ p8##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8)));\
}\ }\
...@@ -1663,15 +1289,11 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { ...@@ -1663,15 +1289,11 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
name##MatcherP9(p0##_type gmock_p0, p1##_type gmock_p1, \ name##MatcherP9(p0##_type gmock_p0, p1##_type gmock_p1, \
p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \ p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
p8##_type gmock_p8) : p0(::testing::internal::move(gmock_p0)), \ p8##_type gmock_p8) : p0(::std::move(gmock_p0)), \
p1(::testing::internal::move(gmock_p1)), \ p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
p2(::testing::internal::move(gmock_p2)), \ p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
p3(::testing::internal::move(gmock_p3)), \ p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \
p4(::testing::internal::move(gmock_p4)), \ p7(::std::move(gmock_p7)), p8(::std::move(gmock_p8)) {\
p5(::testing::internal::move(gmock_p5)), \
p6(::testing::internal::move(gmock_p6)), \
p7(::testing::internal::move(gmock_p7)), \
p8(::testing::internal::move(gmock_p8)) {\
}\ }\
p0##_type const p0;\ p0##_type const p0;\
p1##_type const p1;\ p1##_type const p1;\
...@@ -1722,16 +1344,11 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { ...@@ -1722,16 +1344,11 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \ p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
p9##_type gmock_p9)\ p9##_type gmock_p9)\
: p0(::testing::internal::move(gmock_p0)), \ : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
p1(::testing::internal::move(gmock_p1)), \ p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \
p2(::testing::internal::move(gmock_p2)), \ p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \
p3(::testing::internal::move(gmock_p3)), \ p6(::std::move(gmock_p6)), p7(::std::move(gmock_p7)), \
p4(::testing::internal::move(gmock_p4)), \ p8(::std::move(gmock_p8)), p9(::std::move(gmock_p9)) {}\
p5(::testing::internal::move(gmock_p5)), \
p6(::testing::internal::move(gmock_p6)), \
p7(::testing::internal::move(gmock_p7)), \
p8(::testing::internal::move(gmock_p8)), \
p9(::testing::internal::move(gmock_p9)) {}\
virtual bool MatchAndExplain(\ virtual bool MatchAndExplain(\
GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
::testing::MatchResultListener* result_listener) const;\ ::testing::MatchResultListener* result_listener) const;\
...@@ -1760,7 +1377,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { ...@@ -1760,7 +1377,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(\ return ::testing::internal::FormatMatcherDescription(\
negation, #name, \ negation, #name, \
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ ::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, \ p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
p9##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)));\ p9##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)));\
}\ }\
...@@ -1773,17 +1390,12 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { ...@@ -1773,17 +1390,12 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
name##MatcherP10(p0##_type gmock_p0, p1##_type gmock_p1, \ name##MatcherP10(p0##_type gmock_p0, p1##_type gmock_p1, \
p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \ p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
p8##_type gmock_p8, \ p8##_type gmock_p8, p9##_type gmock_p9) : p0(::std::move(gmock_p0)), \
p9##_type gmock_p9) : p0(::testing::internal::move(gmock_p0)), \ p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
p1(::testing::internal::move(gmock_p1)), \ p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
p2(::testing::internal::move(gmock_p2)), \ p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \
p3(::testing::internal::move(gmock_p3)), \ p7(::std::move(gmock_p7)), p8(::std::move(gmock_p8)), \
p4(::testing::internal::move(gmock_p4)), \ p9(::std::move(gmock_p9)) {\
p5(::testing::internal::move(gmock_p5)), \
p6(::testing::internal::move(gmock_p6)), \
p7(::testing::internal::move(gmock_p7)), \
p8(::testing::internal::move(gmock_p8)), \
p9(::testing::internal::move(gmock_p9)) {\
}\ }\
p0##_type const p0;\ p0##_type const p0;\
p1##_type const p1;\ p1##_type const p1;\
......
...@@ -45,6 +45,7 @@ $$ }} This line fixes auto-indentation of the following code in Emacs. ...@@ -45,6 +45,7 @@ $$ }} This line fixes auto-indentation of the following code in Emacs.
#include <iterator> #include <iterator>
#include <sstream> #include <sstream>
#include <string> #include <string>
#include <utility>
#include <vector> #include <vector>
#include "gmock/gmock-matchers.h" #include "gmock/gmock-matchers.h"
...@@ -55,7 +56,7 @@ $range i 0..n-1 ...@@ -55,7 +56,7 @@ $range i 0..n-1
// The type of the i-th (0-based) field of Tuple. // The type of the i-th (0-based) field of Tuple.
#define GMOCK_FIELD_TYPE_(Tuple, i) \ #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 // TupleFields<Tuple, k0, ..., kn> is for selecting fields from a
// tuple of type Tuple. It has two members: // tuple of type Tuple. It has two members:
...@@ -63,10 +64,11 @@ $range i 0..n-1 ...@@ -63,10 +64,11 @@ $range i 0..n-1
// type: a tuple type whose i-th field is the ki-th field of Tuple. // 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. // 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 // type is std::tuple<int, bool>, and
// GetSelectedFields(make_tuple(true, 'a', 42)) is (42, true). // GetSelectedFields(std::make_tuple(true, 'a', 42)) is (42, true).
template <class Tuple$for i [[, int k$i = -1]]> template <class Tuple$for i [[, int k$i = -1]]>
class TupleFields; class TupleFields;
...@@ -75,9 +77,9 @@ class TupleFields; ...@@ -75,9 +77,9 @@ class TupleFields;
template <class Tuple$for i [[, int k$i]]> template <class Tuple$for i [[, int k$i]]>
class TupleFields { class TupleFields {
public: 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) { 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 +93,9 @@ $range k 0..n-1 ...@@ -91,9 +93,9 @@ $range k 0..n-1
template <class Tuple$for j [[, int k$j]]> template <class Tuple$for j [[, int k$j]]>
class TupleFields<Tuple, $for k, [[$if k < i [[k$k]] $else [[-1]]]]> { class TupleFields<Tuple, $for k, [[$if k < i [[k$k]] $else [[-1]]]]> {
public: 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]]) { 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)]]);
} }
}; };
...@@ -187,66 +189,6 @@ class ArgsMatcher { ...@@ -187,66 +189,6 @@ class ArgsMatcher {
GTEST_DISALLOW_ASSIGN_(ArgsMatcher); GTEST_DISALLOW_ASSIGN_(ArgsMatcher);
}; };
// A set of metafunctions for computing the result type of AllOf.
// AllOf(m1, ..., mN) returns
// AllOfResultN<decltype(m1), ..., decltype(mN)>::type.
// Although AllOf isn't defined for one argument, AllOfResult1 is defined
// to simplify the implementation.
template <typename M1>
struct AllOfResult1 {
typedef M1 type;
};
$range i 1..n
$range i 2..n
$for i [[
$range j 2..i
$var m = i/2
$range k 1..m
$range t m+1..i
template <typename M1$for j [[, typename M$j]]>
struct AllOfResult$i {
typedef BothOfMatcher<
typename AllOfResult$m<$for k, [[M$k]]>::type,
typename AllOfResult$(i-m)<$for t, [[M$t]]>::type
> type;
};
]]
// A set of metafunctions for computing the result type of AnyOf.
// AnyOf(m1, ..., mN) returns
// AnyOfResultN<decltype(m1), ..., decltype(mN)>::type.
// Although AnyOf isn't defined for one argument, AnyOfResult1 is defined
// to simplify the implementation.
template <typename M1>
struct AnyOfResult1 {
typedef M1 type;
};
$range i 1..n
$range i 2..n
$for i [[
$range j 2..i
$var m = i/2
$range k 1..m
$range t m+1..i
template <typename M1$for j [[, typename M$j]]>
struct AnyOfResult$i {
typedef EitherOfMatcher<
typename AnyOfResult$m<$for k, [[M$k]]>::type,
typename AnyOfResult$(i-m)<$for t, [[M$t]]>::type
> type;
};
]]
} // namespace internal } // namespace internal
// Args<N1, N2, ..., Nk>(a_matcher) matches a tuple if the selected // Args<N1, N2, ..., Nk>(a_matcher) matches a tuple if the selected
...@@ -263,46 +205,6 @@ Args(const InnerMatcher& matcher) { ...@@ -263,46 +205,6 @@ Args(const InnerMatcher& matcher) {
} }
]]
// AllOf(m1, m2, ..., mk) matches any value that matches all of the given
// sub-matchers. AllOf is called fully qualified to prevent ADL from firing.
$range i 2..n
$for i [[
$range j 1..i
$var m = i/2
$range k 1..m
$range t m+1..i
template <$for j, [[typename M$j]]>
inline typename internal::AllOfResult$i<$for j, [[M$j]]>::type
AllOf($for j, [[M$j m$j]]) {
return typename internal::AllOfResult$i<$for j, [[M$j]]>::type(
$if m == 1 [[m1]] $else [[::testing::AllOf($for k, [[m$k]])]],
$if m+1 == i [[m$i]] $else [[::testing::AllOf($for t, [[m$t]])]]);
}
]]
// 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.
$range i 2..n
$for i [[
$range j 1..i
$var m = i/2
$range k 1..m
$range t m+1..i
template <$for j, [[typename M$j]]>
inline typename internal::AnyOfResult$i<$for j, [[M$j]]>::type
AnyOf($for j, [[M$j m$j]]) {
return typename internal::AnyOfResult$i<$for j, [[M$j]]>::type(
$if m == 1 [[m1]] $else [[::testing::AnyOf($for k, [[m$k]])]],
$if m+1 == i [[m$i]] $else [[::testing::AnyOf($for t, [[m$t]])]]);
}
]] ]]
} // namespace testing } // namespace testing
...@@ -541,8 +443,8 @@ $var template = [[$if i==0 [[]] $else [[ ...@@ -541,8 +443,8 @@ $var template = [[$if i==0 [[]] $else [[
]]]] ]]]]
$var ctor_param_list = [[$for j, [[p$j##_type gmock_p$j]]]] $var ctor_param_list = [[$for j, [[p$j##_type gmock_p$j]]]]
$var impl_ctor_param_list = [[$for j, [[p$j##_type gmock_p$j]]]] $var impl_ctor_param_list = [[$for j, [[p$j##_type gmock_p$j]]]]
$var impl_inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(::testing::internal::move(gmock_p$j))]]]]]] $var impl_inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(::std::move(gmock_p$j))]]]]]]
$var inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(::testing::internal::move(gmock_p$j))]]]]]] $var inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(::std::move(gmock_p$j))]]]]]]
$var params = [[$for j, [[p$j]]]] $var params = [[$for j, [[p$j]]]]
$var param_types = [[$if i==0 [[]] $else [[<$for j, [[p$j##_type]]>]]]] $var param_types = [[$if i==0 [[]] $else [[<$for j, [[p$j##_type]]>]]]]
$var param_types_and_names = [[$for j, [[p$j##_type p$j]]]] $var param_types_and_names = [[$for j, [[p$j##_type p$j]]]]
...@@ -584,7 +486,7 @@ $var param_field_decls2 = [[$for j ...@@ -584,7 +486,7 @@ $var param_field_decls2 = [[$for j
return ::testing::internal::FormatMatcherDescription(\ return ::testing::internal::FormatMatcherDescription(\
negation, #name, \ negation, #name, \
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ ::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>\ template <typename arg_type>\
......
...@@ -905,8 +905,8 @@ class TuplePrefix { ...@@ -905,8 +905,8 @@ class TuplePrefix {
template <typename MatcherTuple, typename ValueTuple> template <typename MatcherTuple, typename ValueTuple>
static bool Matches(const MatcherTuple& matcher_tuple, static bool Matches(const MatcherTuple& matcher_tuple,
const ValueTuple& value_tuple) { const ValueTuple& value_tuple) {
return TuplePrefix<N - 1>::Matches(matcher_tuple, value_tuple) return TuplePrefix<N - 1>::Matches(matcher_tuple, value_tuple) &&
&& get<N - 1>(matcher_tuple).Matches(get<N - 1>(value_tuple)); std::get<N - 1>(matcher_tuple).Matches(std::get<N - 1>(value_tuple));
} }
// TuplePrefix<N>::ExplainMatchFailuresTo(matchers, values, os) // TuplePrefix<N>::ExplainMatchFailuresTo(matchers, values, os)
...@@ -922,16 +922,16 @@ class TuplePrefix { ...@@ -922,16 +922,16 @@ class TuplePrefix {
// Then describes the failure (if any) in the (N - 1)-th (0-based) // Then describes the failure (if any) in the (N - 1)-th (0-based)
// field. // field.
typename tuple_element<N - 1, MatcherTuple>::type matcher = typename std::tuple_element<N - 1, MatcherTuple>::type matcher =
get<N - 1>(matchers); std::get<N - 1>(matchers);
typedef typename tuple_element<N - 1, ValueTuple>::type Value; typedef typename std::tuple_element<N - 1, ValueTuple>::type Value;
GTEST_REFERENCE_TO_CONST_(Value) value = get<N - 1>(values); GTEST_REFERENCE_TO_CONST_(Value) value = std::get<N - 1>(values);
StringMatchResultListener listener; StringMatchResultListener listener;
if (!matcher.MatchAndExplain(value, &listener)) { if (!matcher.MatchAndExplain(value, &listener)) {
// FIXME: include in the message the name of the parameter // FIXME: include in the message the name of the parameter
// as used in MOCK_METHOD*() when possible. // as used in MOCK_METHOD*() when possible.
*os << " Expected arg #" << N - 1 << ": "; *os << " Expected arg #" << N - 1 << ": ";
get<N - 1>(matchers).DescribeTo(os); std::get<N - 1>(matchers).DescribeTo(os);
*os << "\n Actual: "; *os << "\n Actual: ";
// We remove the reference in type Value to prevent the // We remove the reference in type Value to prevent the
// universal printer from printing the address of value, which // universal printer from printing the address of value, which
...@@ -971,11 +971,11 @@ bool TupleMatches(const MatcherTuple& matcher_tuple, ...@@ -971,11 +971,11 @@ bool TupleMatches(const MatcherTuple& matcher_tuple,
const ValueTuple& value_tuple) { const ValueTuple& value_tuple) {
// Makes sure that matcher_tuple and value_tuple have the same // Makes sure that matcher_tuple and value_tuple have the same
// number of fields. // number of fields.
GTEST_COMPILE_ASSERT_(tuple_size<MatcherTuple>::value == GTEST_COMPILE_ASSERT_(std::tuple_size<MatcherTuple>::value ==
tuple_size<ValueTuple>::value, std::tuple_size<ValueTuple>::value,
matcher_and_value_have_different_numbers_of_fields); matcher_and_value_have_different_numbers_of_fields);
return TuplePrefix<tuple_size<ValueTuple>::value>:: return TuplePrefix<std::tuple_size<ValueTuple>::value>::Matches(matcher_tuple,
Matches(matcher_tuple, value_tuple); value_tuple);
} }
// Describes failures in matching matchers against values. If there // Describes failures in matching matchers against values. If there
...@@ -984,7 +984,7 @@ template <typename MatcherTuple, typename ValueTuple> ...@@ -984,7 +984,7 @@ template <typename MatcherTuple, typename ValueTuple>
void ExplainMatchFailureTupleTo(const MatcherTuple& matchers, void ExplainMatchFailureTupleTo(const MatcherTuple& matchers,
const ValueTuple& values, const ValueTuple& values,
::std::ostream* os) { ::std::ostream* os) {
TuplePrefix<tuple_size<MatcherTuple>::value>::ExplainMatchFailuresTo( TuplePrefix<std::tuple_size<MatcherTuple>::value>::ExplainMatchFailuresTo(
matchers, values, os); matchers, values, os);
} }
...@@ -995,7 +995,7 @@ void ExplainMatchFailureTupleTo(const MatcherTuple& matchers, ...@@ -995,7 +995,7 @@ void ExplainMatchFailureTupleTo(const MatcherTuple& matchers,
template <typename Tuple, typename Func, typename OutIter> template <typename Tuple, typename Func, typename OutIter>
class TransformTupleValuesHelper { class TransformTupleValuesHelper {
private: private:
typedef ::testing::tuple_size<Tuple> TupleSize; typedef ::std::tuple_size<Tuple> TupleSize;
public: public:
// For each member of tuple 't', taken in order, evaluates '*out++ = f(t)'. // For each member of tuple 't', taken in order, evaluates '*out++ = f(t)'.
...@@ -1008,7 +1008,7 @@ class TransformTupleValuesHelper { ...@@ -1008,7 +1008,7 @@ class TransformTupleValuesHelper {
template <typename Tup, size_t kRemainingSize> template <typename Tup, size_t kRemainingSize>
struct IterateOverTuple { struct IterateOverTuple {
OutIter operator() (Func f, const Tup& t, OutIter out) const { 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); return IterateOverTuple<Tup, kRemainingSize - 1>()(f, t, out);
} }
}; };
...@@ -1597,19 +1597,19 @@ class MatchesRegexMatcher { ...@@ -1597,19 +1597,19 @@ class MatchesRegexMatcher {
// compared don't have to have the same type. // compared don't have to have the same type.
// //
// The matcher defined here is polymorphic (for example, Eq() can be // 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 // etc). Therefore we use a template type conversion operator in the
// implementation. // implementation.
template <typename D, typename Op> template <typename D, typename Op>
class PairMatchBase { class PairMatchBase {
public: public:
template <typename T1, typename T2> 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> >); return MakeMatcher(new Impl<::std::tuple<T1, T2>>);
} }
template <typename T1, typename T2> 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>&>); return MakeMatcher(new Impl<const ::std::tuple<T1, T2>&>);
} }
private: private:
...@@ -1623,7 +1623,7 @@ class PairMatchBase { ...@@ -1623,7 +1623,7 @@ class PairMatchBase {
virtual bool MatchAndExplain( virtual bool MatchAndExplain(
Tuple args, Tuple args,
MatchResultListener* /* listener */) const { 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 { virtual void DescribeTo(::std::ostream* os) const {
*os << "are " << GetDesc; *os << "are " << GetDesc;
...@@ -1717,7 +1717,7 @@ class AllOfMatcherImpl ...@@ -1717,7 +1717,7 @@ class AllOfMatcherImpl
: public MatcherInterface<GTEST_REFERENCE_TO_CONST_(T)> { : public MatcherInterface<GTEST_REFERENCE_TO_CONST_(T)> {
public: public:
explicit AllOfMatcherImpl(std::vector<Matcher<T> > matchers) explicit AllOfMatcherImpl(std::vector<Matcher<T> > matchers)
: matchers_(internal::move(matchers)) {} : matchers_(std::move(matchers)) {}
virtual void DescribeTo(::std::ostream* os) const { virtual void DescribeTo(::std::ostream* os) const {
*os << "("; *os << "(";
...@@ -1772,7 +1772,6 @@ class AllOfMatcherImpl ...@@ -1772,7 +1772,6 @@ class AllOfMatcherImpl
GTEST_DISALLOW_ASSIGN_(AllOfMatcherImpl); GTEST_DISALLOW_ASSIGN_(AllOfMatcherImpl);
}; };
#if GTEST_LANG_CXX11
// VariadicMatcher is used for the variadic implementation of // VariadicMatcher is used for the variadic implementation of
// AllOf(m_1, m_2, ...) and AnyOf(m_1, m_2, ...). // AllOf(m_1, m_2, ...) and AnyOf(m_1, m_2, ...).
// CombiningMatcher<T> is used to recursively combine the provided matchers // CombiningMatcher<T> is used to recursively combine the provided matchers
...@@ -1792,7 +1791,7 @@ class VariadicMatcher { ...@@ -1792,7 +1791,7 @@ class VariadicMatcher {
operator Matcher<T>() const { operator Matcher<T>() const {
std::vector<Matcher<T> > values; std::vector<Matcher<T> > values;
CreateVariadicMatcher<T>(&values, std::integral_constant<size_t, 0>()); CreateVariadicMatcher<T>(&values, std::integral_constant<size_t, 0>());
return Matcher<T>(new CombiningMatcher<T>(internal::move(values))); return Matcher<T>(new CombiningMatcher<T>(std::move(values)));
} }
private: private:
...@@ -1808,7 +1807,7 @@ class VariadicMatcher { ...@@ -1808,7 +1807,7 @@ class VariadicMatcher {
std::vector<Matcher<T> >*, std::vector<Matcher<T> >*,
std::integral_constant<size_t, sizeof...(Args)>) const {} std::integral_constant<size_t, sizeof...(Args)>) const {}
tuple<Args...> matchers_; std::tuple<Args...> matchers_;
GTEST_DISALLOW_ASSIGN_(VariadicMatcher); GTEST_DISALLOW_ASSIGN_(VariadicMatcher);
}; };
...@@ -1816,34 +1815,6 @@ class VariadicMatcher { ...@@ -1816,34 +1815,6 @@ class VariadicMatcher {
template <typename... Args> template <typename... Args>
using AllOfMatcher = VariadicMatcher<AllOfMatcherImpl, Args...>; using AllOfMatcher = VariadicMatcher<AllOfMatcherImpl, Args...>;
#endif // GTEST_LANG_CXX11
// Used for implementing the AllOf(m_1, ..., m_n) matcher, which
// matches a value that matches all of the matchers m_1, ..., and m_n.
template <typename Matcher1, typename Matcher2>
class BothOfMatcher {
public:
BothOfMatcher(Matcher1 matcher1, Matcher2 matcher2)
: matcher1_(matcher1), matcher2_(matcher2) {}
// This template type conversion operator allows a
// BothOfMatcher<Matcher1, Matcher2> object to match any type that
// both Matcher1 and Matcher2 can match.
template <typename T>
operator Matcher<T>() const {
std::vector<Matcher<T> > values;
values.push_back(SafeMatcherCast<T>(matcher1_));
values.push_back(SafeMatcherCast<T>(matcher2_));
return Matcher<T>(new AllOfMatcherImpl<T>(internal::move(values)));
}
private:
Matcher1 matcher1_;
Matcher2 matcher2_;
GTEST_DISALLOW_ASSIGN_(BothOfMatcher);
};
// Implements the AnyOf(m1, m2) matcher for a particular argument type // Implements the AnyOf(m1, m2) matcher for a particular argument type
// T. We do not nest it inside the AnyOfMatcher class template, as // T. We do not nest it inside the AnyOfMatcher class template, as
// that will prevent different instantiations of AnyOfMatcher from // that will prevent different instantiations of AnyOfMatcher from
...@@ -1853,7 +1824,7 @@ class AnyOfMatcherImpl ...@@ -1853,7 +1824,7 @@ class AnyOfMatcherImpl
: public MatcherInterface<GTEST_REFERENCE_TO_CONST_(T)> { : public MatcherInterface<GTEST_REFERENCE_TO_CONST_(T)> {
public: public:
explicit AnyOfMatcherImpl(std::vector<Matcher<T> > matchers) explicit AnyOfMatcherImpl(std::vector<Matcher<T> > matchers)
: matchers_(internal::move(matchers)) {} : matchers_(std::move(matchers)) {}
virtual void DescribeTo(::std::ostream* os) const { virtual void DescribeTo(::std::ostream* os) const {
*os << "("; *os << "(";
...@@ -1908,40 +1879,10 @@ class AnyOfMatcherImpl ...@@ -1908,40 +1879,10 @@ class AnyOfMatcherImpl
GTEST_DISALLOW_ASSIGN_(AnyOfMatcherImpl); GTEST_DISALLOW_ASSIGN_(AnyOfMatcherImpl);
}; };
#if GTEST_LANG_CXX11
// AnyOfMatcher is used for the variadic implementation of AnyOf(m_1, m_2, ...). // AnyOfMatcher is used for the variadic implementation of AnyOf(m_1, m_2, ...).
template <typename... Args> template <typename... Args>
using AnyOfMatcher = VariadicMatcher<AnyOfMatcherImpl, Args...>; using AnyOfMatcher = VariadicMatcher<AnyOfMatcherImpl, Args...>;
#endif // GTEST_LANG_CXX11
// Used for implementing the AnyOf(m_1, ..., m_n) matcher, which
// matches a value that matches at least one of the matchers m_1, ...,
// and m_n.
template <typename Matcher1, typename Matcher2>
class EitherOfMatcher {
public:
EitherOfMatcher(Matcher1 matcher1, Matcher2 matcher2)
: matcher1_(matcher1), matcher2_(matcher2) {}
// This template type conversion operator allows a
// EitherOfMatcher<Matcher1, Matcher2> object to match any type that
// both Matcher1 and Matcher2 can match.
template <typename T>
operator Matcher<T>() const {
std::vector<Matcher<T> > values;
values.push_back(SafeMatcherCast<T>(matcher1_));
values.push_back(SafeMatcherCast<T>(matcher2_));
return Matcher<T>(new AnyOfMatcherImpl<T>(internal::move(values)));
}
private:
Matcher1 matcher1_;
Matcher2 matcher2_;
GTEST_DISALLOW_ASSIGN_(EitherOfMatcher);
};
// Used for implementing Truly(pred), which turns a predicate into a // Used for implementing Truly(pred), which turns a predicate into a
// matcher. // matcher.
template <typename Predicate> template <typename Predicate>
...@@ -2024,7 +1965,7 @@ class MatcherAsPredicate { ...@@ -2024,7 +1965,7 @@ class MatcherAsPredicate {
template <typename M> template <typename M>
class PredicateFormatterFromMatcher { class PredicateFormatterFromMatcher {
public: public:
explicit PredicateFormatterFromMatcher(M m) : matcher_(internal::move(m)) {} explicit PredicateFormatterFromMatcher(M m) : matcher_(std::move(m)) {}
// This template () operator allows a PredicateFormatterFromMatcher // This template () operator allows a PredicateFormatterFromMatcher
// object to act as a predicate-formatter suitable for using with // object to act as a predicate-formatter suitable for using with
...@@ -2068,7 +2009,7 @@ class PredicateFormatterFromMatcher { ...@@ -2068,7 +2009,7 @@ class PredicateFormatterFromMatcher {
template <typename M> template <typename M>
inline PredicateFormatterFromMatcher<M> inline PredicateFormatterFromMatcher<M>
MakePredicateFormatterFromMatcher(M matcher) { MakePredicateFormatterFromMatcher(M matcher) {
return PredicateFormatterFromMatcher<M>(internal::move(matcher)); return PredicateFormatterFromMatcher<M>(std::move(matcher));
} }
// Implements the polymorphic floating point equality matcher, which matches // Implements the polymorphic floating point equality matcher, which matches
...@@ -2249,14 +2190,14 @@ class FloatingEq2Matcher { ...@@ -2249,14 +2190,14 @@ class FloatingEq2Matcher {
} }
template <typename T1, typename T2> template <typename T1, typename T2>
operator Matcher< ::testing::tuple<T1, T2> >() const { operator Matcher<::std::tuple<T1, T2>>() const {
return MakeMatcher( 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> template <typename T1, typename T2>
operator Matcher<const ::testing::tuple<T1, T2>&>() const { operator Matcher<const ::std::tuple<T1, T2>&>() const {
return MakeMatcher( 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: private:
...@@ -2274,14 +2215,14 @@ class FloatingEq2Matcher { ...@@ -2274,14 +2215,14 @@ class FloatingEq2Matcher {
virtual bool MatchAndExplain(Tuple args, virtual bool MatchAndExplain(Tuple args,
MatchResultListener* listener) const { MatchResultListener* listener) const {
if (max_abs_error_ == -1) { if (max_abs_error_ == -1) {
FloatingEqMatcher<FloatType> fm(::testing::get<0>(args), nan_eq_nan_); FloatingEqMatcher<FloatType> fm(::std::get<0>(args), nan_eq_nan_);
return static_cast<Matcher<FloatType> >(fm).MatchAndExplain( return static_cast<Matcher<FloatType>>(fm).MatchAndExplain(
::testing::get<1>(args), listener); ::std::get<1>(args), listener);
} else { } else {
FloatingEqMatcher<FloatType> fm(::testing::get<0>(args), nan_eq_nan_, FloatingEqMatcher<FloatType> fm(::std::get<0>(args), nan_eq_nan_,
max_abs_error_); max_abs_error_);
return static_cast<Matcher<FloatType> >(fm).MatchAndExplain( return static_cast<Matcher<FloatType>>(fm).MatchAndExplain(
::testing::get<1>(args), listener); ::std::get<1>(args), listener);
} }
} }
virtual void DescribeTo(::std::ostream* os) const { virtual void DescribeTo(::std::ostream* os) const {
...@@ -2628,7 +2569,7 @@ template <typename Callable, typename InnerMatcher> ...@@ -2628,7 +2569,7 @@ template <typename Callable, typename InnerMatcher>
class ResultOfMatcher { class ResultOfMatcher {
public: public:
ResultOfMatcher(Callable callable, InnerMatcher matcher) ResultOfMatcher(Callable callable, InnerMatcher matcher)
: callable_(internal::move(callable)), matcher_(internal::move(matcher)) { : callable_(std::move(callable)), matcher_(std::move(matcher)) {
CallableTraits<Callable>::CheckIsValid(callable_); CallableTraits<Callable>::CheckIsValid(callable_);
} }
...@@ -2985,7 +2926,7 @@ class WhenSortedByMatcher { ...@@ -2985,7 +2926,7 @@ class WhenSortedByMatcher {
}; };
// Implements Pointwise(tuple_matcher, rhs_container). tuple_matcher // 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 // T2&> >, where T1 and T2 are the types of elements in the LHS
// container and the RHS container respectively. // container and the RHS container respectively.
template <typename TupleMatcher, typename RhsContainer> template <typename TupleMatcher, typename RhsContainer>
...@@ -3030,7 +2971,7 @@ class PointwiseMatcher { ...@@ -3030,7 +2971,7 @@ class PointwiseMatcher {
// reference, as they may be expensive to copy. We must use tuple // reference, as they may be expensive to copy. We must use tuple
// instead of pair here, as a pair cannot hold references (C++ 98, // instead of pair here, as a pair cannot hold references (C++ 98,
// 20.2.2 [lib.pairs]). // 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) Impl(const TupleMatcher& tuple_matcher, const RhsStlContainer& rhs)
// mono_tuple_matcher_ holds a monomorphic version of the tuple matcher. // mono_tuple_matcher_ holds a monomorphic version of the tuple matcher.
...@@ -3829,7 +3770,7 @@ class UnorderedElementsAreMatcher { ...@@ -3829,7 +3770,7 @@ class UnorderedElementsAreMatcher {
typedef typename View::value_type Element; typedef typename View::value_type Element;
typedef ::std::vector<Matcher<const Element&> > MatcherVec; typedef ::std::vector<Matcher<const Element&> > MatcherVec;
MatcherVec matchers; MatcherVec matchers;
matchers.reserve(::testing::tuple_size<MatcherTuple>::value); matchers.reserve(::std::tuple_size<MatcherTuple>::value);
TransformTupleValues(CastAndAppendTransform<const Element&>(), matchers_, TransformTupleValues(CastAndAppendTransform<const Element&>(), matchers_,
::std::back_inserter(matchers)); ::std::back_inserter(matchers));
return MakeMatcher(new UnorderedElementsAreMatcherImpl<Container>( return MakeMatcher(new UnorderedElementsAreMatcherImpl<Container>(
...@@ -3851,7 +3792,7 @@ class ElementsAreMatcher { ...@@ -3851,7 +3792,7 @@ class ElementsAreMatcher {
operator Matcher<Container>() const { operator Matcher<Container>() const {
GTEST_COMPILE_ASSERT_( GTEST_COMPILE_ASSERT_(
!IsHashTable<GTEST_REMOVE_REFERENCE_AND_CONST_(Container)>::value || !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); use_UnorderedElementsAre_with_hash_tables);
typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer; typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
...@@ -3859,7 +3800,7 @@ class ElementsAreMatcher { ...@@ -3859,7 +3800,7 @@ class ElementsAreMatcher {
typedef typename View::value_type Element; typedef typename View::value_type Element;
typedef ::std::vector<Matcher<const Element&> > MatcherVec; typedef ::std::vector<Matcher<const Element&> > MatcherVec;
MatcherVec matchers; MatcherVec matchers;
matchers.reserve(::testing::tuple_size<MatcherTuple>::value); matchers.reserve(::std::tuple_size<MatcherTuple>::value);
TransformTupleValues(CastAndAppendTransform<const Element&>(), matchers_, TransformTupleValues(CastAndAppendTransform<const Element&>(), matchers_,
::std::back_inserter(matchers)); ::std::back_inserter(matchers));
return MakeMatcher(new ElementsAreMatcherImpl<Container>( return MakeMatcher(new ElementsAreMatcherImpl<Container>(
...@@ -3952,7 +3893,7 @@ class BoundSecondMatcher { ...@@ -3952,7 +3893,7 @@ class BoundSecondMatcher {
template <typename T> template <typename T>
class Impl : public MatcherInterface<T> { class Impl : public MatcherInterface<T> {
public: public:
typedef ::testing::tuple<T, Second> ArgTuple; typedef ::std::tuple<T, Second> ArgTuple;
Impl(const Tuple2Matcher& tm, const Second& second) Impl(const Tuple2Matcher& tm, const Second& second)
: mono_tuple2_matcher_(SafeMatcherCast<const ArgTuple&>(tm)), : mono_tuple2_matcher_(SafeMatcherCast<const ArgTuple&>(tm)),
...@@ -4067,11 +4008,12 @@ template <typename T> ...@@ -4067,11 +4008,12 @@ template <typename T>
class VariantMatcher { class VariantMatcher {
public: public:
explicit VariantMatcher(::testing::Matcher<const T&> matcher) explicit VariantMatcher(::testing::Matcher<const T&> matcher)
: matcher_(internal::move(matcher)) {} : matcher_(std::move(matcher)) {}
template <typename Variant> template <typename Variant>
bool MatchAndExplain(const Variant& value, bool MatchAndExplain(const Variant& value,
::testing::MatchResultListener* listener) const { ::testing::MatchResultListener* listener) const {
using std::get;
if (!listener->IsInterested()) { if (!listener->IsInterested()) {
return holds_alternative<T>(value) && matcher_.Matches(get<T>(value)); return holds_alternative<T>(value) && matcher_.Matches(get<T>(value));
} }
...@@ -4562,7 +4504,7 @@ template <typename Callable, typename InnerMatcher> ...@@ -4562,7 +4504,7 @@ template <typename Callable, typename InnerMatcher>
internal::ResultOfMatcher<Callable, InnerMatcher> ResultOf( internal::ResultOfMatcher<Callable, InnerMatcher> ResultOf(
Callable callable, InnerMatcher matcher) { Callable callable, InnerMatcher matcher) {
return internal::ResultOfMatcher<Callable, InnerMatcher>( return internal::ResultOfMatcher<Callable, InnerMatcher>(
internal::move(callable), internal::move(matcher)); std::move(callable), std::move(matcher));
} }
// String matchers. // String matchers.
...@@ -4846,7 +4788,7 @@ WhenSorted(const ContainerMatcher& container_matcher) { ...@@ -4846,7 +4788,7 @@ WhenSorted(const ContainerMatcher& container_matcher) {
// Matches an STL-style container or a native array that contains the // 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 // 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. // 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 // T1&, const T2&> >, where T1 and T2 are the types of elements in the
// LHS container and the RHS container respectively. // LHS container and the RHS container respectively.
template <typename TupleMatcher, typename Container> template <typename TupleMatcher, typename Container>
...@@ -4877,7 +4819,7 @@ inline internal::PointwiseMatcher<TupleMatcher, std::vector<T> > Pointwise( ...@@ -4877,7 +4819,7 @@ inline internal::PointwiseMatcher<TupleMatcher, std::vector<T> > Pointwise(
// elements as in rhs, where in some permutation of the container, its // 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 // 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 // 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 // the types of elements in the LHS container and the RHS container
// respectively. // respectively.
// //
...@@ -5169,25 +5111,24 @@ std::string DescribeMatcher(const M& matcher, bool negation = false) { ...@@ -5169,25 +5111,24 @@ std::string DescribeMatcher(const M& matcher, bool negation = false) {
} }
template <typename... Args> 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) { ElementsAre(const Args&... matchers) {
return internal::ElementsAreMatcher< return internal::ElementsAreMatcher<
tuple<typename std::decay<const Args&>::type...>>( std::tuple<typename std::decay<const Args&>::type...>>(
make_tuple(matchers...)); std::make_tuple(matchers...));
} }
template <typename... Args> template <typename... Args>
internal::UnorderedElementsAreMatcher< internal::UnorderedElementsAreMatcher<
tuple<typename std::decay<const Args&>::type...>> std::tuple<typename std::decay<const Args&>::type...>>
UnorderedElementsAre(const Args&... matchers) { UnorderedElementsAre(const Args&... matchers) {
return internal::UnorderedElementsAreMatcher< return internal::UnorderedElementsAreMatcher<
tuple<typename std::decay<const Args&>::type...>>( std::tuple<typename std::decay<const Args&>::type...>>(
make_tuple(matchers...)); std::make_tuple(matchers...));
} }
#if GTEST_LANG_CXX11 // Define variadic matcher versions.
// Define variadic matcher versions. They are overloaded in
// gmock-generated-matchers.h for the cases supported by pre C++11 compilers.
template <typename... Args> template <typename... Args>
internal::AllOfMatcher<typename std::decay<const Args&>::type...> AllOf( internal::AllOfMatcher<typename std::decay<const Args&>::type...> AllOf(
const Args&... matchers) { const Args&... matchers) {
...@@ -5202,8 +5143,6 @@ internal::AnyOfMatcher<typename std::decay<const Args&>::type...> AnyOf( ...@@ -5202,8 +5143,6 @@ internal::AnyOfMatcher<typename std::decay<const Args&>::type...> AnyOf(
matchers...); matchers...);
} }
#endif // GTEST_LANG_CXX11
// AllArgs(m) is a synonym of m. This is useful in // AllArgs(m) is a synonym of m. This is useful in
// //
// EXPECT_CALL(foo, Bar(_, _)).With(AllArgs(Eq())); // EXPECT_CALL(foo, Bar(_, _)).With(AllArgs(Eq()));
......
...@@ -162,7 +162,7 @@ WithArg(const InnerAction& action) { ...@@ -162,7 +162,7 @@ WithArg(const InnerAction& action) {
ACTION_TEMPLATE(ReturnArg, ACTION_TEMPLATE(ReturnArg,
HAS_1_TEMPLATE_PARAMS(int, k), HAS_1_TEMPLATE_PARAMS(int, k),
AND_0_VALUE_PARAMS()) { 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 // Action SaveArg<k>(pointer) saves the k-th (0-based) argument of the
...@@ -170,7 +170,7 @@ ACTION_TEMPLATE(ReturnArg, ...@@ -170,7 +170,7 @@ ACTION_TEMPLATE(ReturnArg,
ACTION_TEMPLATE(SaveArg, ACTION_TEMPLATE(SaveArg,
HAS_1_TEMPLATE_PARAMS(int, k), HAS_1_TEMPLATE_PARAMS(int, k),
AND_1_VALUE_PARAMS(pointer)) { AND_1_VALUE_PARAMS(pointer)) {
*pointer = ::testing::get<k>(args); *pointer = ::std::get<k>(args);
} }
// Action SaveArgPointee<k>(pointer) saves the value pointed to // Action SaveArgPointee<k>(pointer) saves the value pointed to
...@@ -178,7 +178,7 @@ ACTION_TEMPLATE(SaveArg, ...@@ -178,7 +178,7 @@ ACTION_TEMPLATE(SaveArg,
ACTION_TEMPLATE(SaveArgPointee, ACTION_TEMPLATE(SaveArgPointee,
HAS_1_TEMPLATE_PARAMS(int, k), HAS_1_TEMPLATE_PARAMS(int, k),
AND_1_VALUE_PARAMS(pointer)) { AND_1_VALUE_PARAMS(pointer)) {
*pointer = *::testing::get<k>(args); *pointer = *::std::get<k>(args);
} }
// Action SetArgReferee<k>(value) assigns 'value' to the variable // Action SetArgReferee<k>(value) assigns 'value' to the variable
...@@ -186,13 +186,13 @@ ACTION_TEMPLATE(SaveArgPointee, ...@@ -186,13 +186,13 @@ ACTION_TEMPLATE(SaveArgPointee,
ACTION_TEMPLATE(SetArgReferee, ACTION_TEMPLATE(SetArgReferee,
HAS_1_TEMPLATE_PARAMS(int, k), HAS_1_TEMPLATE_PARAMS(int, k),
AND_1_VALUE_PARAMS(value)) { 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 // Ensures that argument #k is a reference. If you get a compiler
// error on the next line, you are using SetArgReferee<k>(value) in // 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. // a mock function whose k-th (0-based) argument is not a reference.
GTEST_COMPILE_ASSERT_(internal::is_reference<argk_type>::value, GTEST_COMPILE_ASSERT_(internal::is_reference<argk_type>::value,
SetArgReferee_must_be_used_with_a_reference_argument); 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 // Action SetArrayArgument<k>(first, last) copies the elements in
...@@ -205,9 +205,9 @@ ACTION_TEMPLATE(SetArrayArgument, ...@@ -205,9 +205,9 @@ ACTION_TEMPLATE(SetArrayArgument,
AND_2_VALUE_PARAMS(first, last)) { AND_2_VALUE_PARAMS(first, last)) {
// Visual Studio deprecates ::std::copy, so we use our own copy in that case. // Visual Studio deprecates ::std::copy, so we use our own copy in that case.
#ifdef _MSC_VER #ifdef _MSC_VER
internal::CopyElements(first, last, ::testing::get<k>(args)); internal::CopyElements(first, last, ::std::get<k>(args));
#else #else
::std::copy(first, last, ::testing::get<k>(args)); ::std::copy(first, last, ::std::get<k>(args));
#endif #endif
} }
...@@ -216,7 +216,7 @@ ACTION_TEMPLATE(SetArrayArgument, ...@@ -216,7 +216,7 @@ ACTION_TEMPLATE(SetArrayArgument,
ACTION_TEMPLATE(DeleteArg, ACTION_TEMPLATE(DeleteArg,
HAS_1_TEMPLATE_PARAMS(int, k), HAS_1_TEMPLATE_PARAMS(int, k),
AND_0_VALUE_PARAMS()) { AND_0_VALUE_PARAMS()) {
delete ::testing::get<k>(args); delete ::std::get<k>(args);
} }
// This action returns the value pointed to by 'pointer'. // This action returns the value pointed to by 'pointer'.
......
...@@ -65,6 +65,7 @@ ...@@ -65,6 +65,7 @@
#include <set> #include <set>
#include <sstream> #include <sstream>
#include <string> #include <string>
#include <utility>
#include <vector> #include <vector>
#include "gmock/gmock-actions.h" #include "gmock/gmock-actions.h"
#include "gmock/gmock-cardinalities.h" #include "gmock/gmock-cardinalities.h"
...@@ -1184,9 +1185,10 @@ class TypedExpectation : public ExpectationBase { ...@@ -1184,9 +1185,10 @@ class TypedExpectation : public ExpectationBase {
Log(kWarning, ss.str(), 1); Log(kWarning, ss.str(), 1);
} }
return count <= action_count ? return count <= action_count
*static_cast<const Action<F>*>(untyped_actions_[count - 1]) : ? *static_cast<const Action<F>*>(
repeated_action(); untyped_actions_[static_cast<size_t>(count - 1)])
: repeated_action();
} }
// Given the arguments of a mock function call, if the call will // Given the arguments of a mock function call, if the call will
...@@ -1319,13 +1321,13 @@ class ReferenceOrValueWrapper { ...@@ -1319,13 +1321,13 @@ class ReferenceOrValueWrapper {
public: public:
// Constructs a wrapper from the given value/reference. // Constructs a wrapper from the given value/reference.
explicit ReferenceOrValueWrapper(T value) explicit ReferenceOrValueWrapper(T value)
: value_(::testing::internal::move(value)) { : value_(std::move(value)) {
} }
// Unwraps and returns the underlying value/reference, exactly as // Unwraps and returns the underlying value/reference, exactly as
// originally passed. The behavior of calling this more than once on // originally passed. The behavior of calling this more than once on
// the same object is unspecified. // the same object is unspecified.
T Unwrap() { return ::testing::internal::move(value_); } T Unwrap() { return std::move(value_); }
// Provides nondestructive access to the underlying value/reference. // Provides nondestructive access to the underlying value/reference.
// Always returns a const reference (more precisely, // Always returns a const reference (more precisely,
...@@ -1400,27 +1402,26 @@ class ActionResultHolder : public UntypedActionResultHolderBase { ...@@ -1400,27 +1402,26 @@ class ActionResultHolder : public UntypedActionResultHolderBase {
template <typename F> template <typename F>
static ActionResultHolder* PerformDefaultAction( static ActionResultHolder* PerformDefaultAction(
const FunctionMockerBase<F>* func_mocker, const FunctionMockerBase<F>* func_mocker,
typename RvalueRef<typename Function<F>::ArgumentTuple>::type args, typename Function<F>::ArgumentTuple&& args,
const std::string& call_description) { const std::string& call_description) {
return new ActionResultHolder(Wrapper(func_mocker->PerformDefaultAction( return new ActionResultHolder(Wrapper(func_mocker->PerformDefaultAction(
internal::move(args), call_description))); std::move(args), call_description)));
} }
// Performs the given action and returns the result in a new-ed // Performs the given action and returns the result in a new-ed
// ActionResultHolder. // ActionResultHolder.
template <typename F> template <typename F>
static ActionResultHolder* PerformAction( static ActionResultHolder* PerformAction(
const Action<F>& action, const Action<F>& action, typename Function<F>::ArgumentTuple&& args) {
typename RvalueRef<typename Function<F>::ArgumentTuple>::type args) {
return new ActionResultHolder( return new ActionResultHolder(
Wrapper(action.Perform(internal::move(args)))); Wrapper(action.Perform(std::move(args))));
} }
private: private:
typedef ReferenceOrValueWrapper<T> Wrapper; typedef ReferenceOrValueWrapper<T> Wrapper;
explicit ActionResultHolder(Wrapper result) explicit ActionResultHolder(Wrapper result)
: result_(::testing::internal::move(result)) { : result_(std::move(result)) {
} }
Wrapper result_; Wrapper result_;
...@@ -1441,9 +1442,9 @@ class ActionResultHolder<void> : public UntypedActionResultHolderBase { ...@@ -1441,9 +1442,9 @@ class ActionResultHolder<void> : public UntypedActionResultHolderBase {
template <typename F> template <typename F>
static ActionResultHolder* PerformDefaultAction( static ActionResultHolder* PerformDefaultAction(
const FunctionMockerBase<F>* func_mocker, const FunctionMockerBase<F>* func_mocker,
typename RvalueRef<typename Function<F>::ArgumentTuple>::type args, typename Function<F>::ArgumentTuple&& args,
const std::string& call_description) { const std::string& call_description) {
func_mocker->PerformDefaultAction(internal::move(args), call_description); func_mocker->PerformDefaultAction(std::move(args), call_description);
return new ActionResultHolder; return new ActionResultHolder;
} }
...@@ -1451,9 +1452,8 @@ class ActionResultHolder<void> : public UntypedActionResultHolderBase { ...@@ -1451,9 +1452,8 @@ class ActionResultHolder<void> : public UntypedActionResultHolderBase {
// ActionResultHolder*. // ActionResultHolder*.
template <typename F> template <typename F>
static ActionResultHolder* PerformAction( static ActionResultHolder* PerformAction(
const Action<F>& action, const Action<F>& action, typename Function<F>::ArgumentTuple&& args) {
typename RvalueRef<typename Function<F>::ArgumentTuple>::type args) { action.Perform(std::move(args));
action.Perform(internal::move(args));
return new ActionResultHolder; return new ActionResultHolder;
} }
...@@ -1508,13 +1508,12 @@ class FunctionMockerBase : public UntypedFunctionMockerBase { ...@@ -1508,13 +1508,12 @@ class FunctionMockerBase : public UntypedFunctionMockerBase {
// mutable state of this object, and thus can be called concurrently // mutable state of this object, and thus can be called concurrently
// without locking. // without locking.
// L = * // L = *
Result PerformDefaultAction( Result PerformDefaultAction(typename Function<F>::ArgumentTuple&& args,
typename RvalueRef<typename Function<F>::ArgumentTuple>::type args, const std::string& call_description) const {
const std::string& call_description) const {
const OnCallSpec<F>* const spec = const OnCallSpec<F>* const spec =
this->FindOnCallSpec(args); this->FindOnCallSpec(args);
if (spec != nullptr) { if (spec != nullptr) {
return spec->GetAction().Perform(internal::move(args)); return spec->GetAction().Perform(std::move(args));
} }
const std::string message = const std::string message =
call_description + call_description +
...@@ -1539,7 +1538,7 @@ class FunctionMockerBase : public UntypedFunctionMockerBase { ...@@ -1539,7 +1538,7 @@ class FunctionMockerBase : public UntypedFunctionMockerBase {
void* untyped_args, // must point to an ArgumentTuple void* untyped_args, // must point to an ArgumentTuple
const std::string& call_description) const { const std::string& call_description) const {
ArgumentTuple* args = static_cast<ArgumentTuple*>(untyped_args); ArgumentTuple* args = static_cast<ArgumentTuple*>(untyped_args);
return ResultHolder::PerformDefaultAction(this, internal::move(*args), return ResultHolder::PerformDefaultAction(this, std::move(*args),
call_description); call_description);
} }
...@@ -1553,7 +1552,7 @@ class FunctionMockerBase : public UntypedFunctionMockerBase { ...@@ -1553,7 +1552,7 @@ class FunctionMockerBase : public UntypedFunctionMockerBase {
// action deletes the mock object (and thus deletes itself). // action deletes the mock object (and thus deletes itself).
const Action<F> action = *static_cast<const Action<F>*>(untyped_action); const Action<F> action = *static_cast<const Action<F>*>(untyped_action);
ArgumentTuple* args = static_cast<ArgumentTuple*>(untyped_args); ArgumentTuple* args = static_cast<ArgumentTuple*>(untyped_args);
return ResultHolder::PerformAction(action, internal::move(*args)); return ResultHolder::PerformAction(action, std::move(*args));
} }
// Implements UntypedFunctionMockerBase::ClearDefaultActionsLocked(): // Implements UntypedFunctionMockerBase::ClearDefaultActionsLocked():
...@@ -1593,8 +1592,7 @@ class FunctionMockerBase : public UntypedFunctionMockerBase { ...@@ -1593,8 +1592,7 @@ class FunctionMockerBase : public UntypedFunctionMockerBase {
// Returns the result of invoking this mock function with the given // Returns the result of invoking this mock function with the given
// arguments. This function can be safely called from multiple // arguments. This function can be safely called from multiple
// threads concurrently. // threads concurrently.
Result InvokeWith( Result InvokeWith(typename Function<F>::ArgumentTuple&& args)
typename RvalueRef<typename Function<F>::ArgumentTuple>::type args)
GTEST_LOCK_EXCLUDED_(g_gmock_mutex) { GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
// const_cast is required since in C++98 we still pass ArgumentTuple around // const_cast is required since in C++98 we still pass ArgumentTuple around
// by const& instead of rvalue reference. // by const& instead of rvalue reference.
...@@ -1762,12 +1760,12 @@ class FunctionMockerBase : public UntypedFunctionMockerBase { ...@@ -1762,12 +1760,12 @@ class FunctionMockerBase : public UntypedFunctionMockerBase {
::std::ostream* why) const ::std::ostream* why) const
GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) { GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
g_gmock_mutex.AssertHeld(); g_gmock_mutex.AssertHeld();
const int count = static_cast<int>(untyped_expectations_.size()); const size_t count = untyped_expectations_.size();
*why << "Google Mock tried the following " << count << " " *why << "Google Mock tried the following " << count << " "
<< (count == 1 ? "expectation, but it didn't match" : << (count == 1 ? "expectation, but it didn't match" :
"expectations, but none matched") "expectations, but none matched")
<< ":\n"; << ":\n";
for (int i = 0; i < count; i++) { for (size_t i = 0; i < count; i++) {
TypedExpectation<F>* const expectation = TypedExpectation<F>* const expectation =
static_cast<TypedExpectation<F>*>(untyped_expectations_[i].get()); static_cast<TypedExpectation<F>*>(untyped_expectations_[i].get());
*why << "\n"; *why << "\n";
......
...@@ -70,79 +70,71 @@ template <typename Tuple> ...@@ -70,79 +70,71 @@ template <typename Tuple>
struct MatcherTuple; struct MatcherTuple;
template <> template <>
struct MatcherTuple< ::testing::tuple<> > { struct MatcherTuple< ::std::tuple<> > {
typedef ::testing::tuple< > type; typedef ::std::tuple< > type;
}; };
template <typename A1> template <typename A1>
struct MatcherTuple< ::testing::tuple<A1> > { struct MatcherTuple< ::std::tuple<A1> > {
typedef ::testing::tuple<Matcher<A1> > type; typedef ::std::tuple<Matcher<A1> > type;
}; };
template <typename A1, typename A2> template <typename A1, typename A2>
struct MatcherTuple< ::testing::tuple<A1, A2> > { struct MatcherTuple< ::std::tuple<A1, A2> > {
typedef ::testing::tuple<Matcher<A1>, Matcher<A2> > type; typedef ::std::tuple<Matcher<A1>, Matcher<A2> > type;
}; };
template <typename A1, typename A2, typename A3> template <typename A1, typename A2, typename A3>
struct MatcherTuple< ::testing::tuple<A1, A2, A3> > { struct MatcherTuple< ::std::tuple<A1, A2, A3> > {
typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3> > type; typedef ::std::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3> > type;
}; };
template <typename A1, typename A2, typename A3, typename A4> template <typename A1, typename A2, typename A3, typename A4>
struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4> > { struct MatcherTuple< ::std::tuple<A1, A2, A3, A4> > {
typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4> > typedef ::std::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>,
type; Matcher<A4> > type;
}; };
template <typename A1, typename A2, typename A3, typename A4, typename A5> template <typename A1, typename A2, typename A3, typename A4, typename A5>
struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5> > { struct MatcherTuple< ::std::tuple<A1, A2, A3, A4, A5> > {
typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>, typedef ::std::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
Matcher<A5> > Matcher<A5> > type;
type;
}; };
template <typename A1, typename A2, typename A3, typename A4, typename A5, template <typename A1, typename A2, typename A3, typename A4, typename A5,
typename A6> typename A6>
struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6> > { struct MatcherTuple< ::std::tuple<A1, A2, A3, A4, A5, A6> > {
typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>, typedef ::std::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
Matcher<A5>, Matcher<A6> > Matcher<A5>, Matcher<A6> > type;
type;
}; };
template <typename A1, typename A2, typename A3, typename A4, typename A5, template <typename A1, typename A2, typename A3, typename A4, typename A5,
typename A6, typename A7> typename A6, typename A7>
struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> > { struct MatcherTuple< ::std::tuple<A1, A2, A3, A4, A5, A6, A7> > {
typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>, typedef ::std::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
Matcher<A5>, Matcher<A6>, Matcher<A7> > Matcher<A5>, Matcher<A6>, Matcher<A7> > type;
type;
}; };
template <typename A1, typename A2, typename A3, typename A4, typename A5, template <typename A1, typename A2, typename A3, typename A4, typename A5,
typename A6, typename A7, typename A8> typename A6, typename A7, typename A8>
struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > { struct MatcherTuple< ::std::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > {
typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>, typedef ::std::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8> > Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8> > type;
type;
}; };
template <typename A1, typename A2, typename A3, typename A4, typename A5, template <typename A1, typename A2, typename A3, typename A4, typename A5,
typename A6, typename A7, typename A8, typename A9> typename A6, typename A7, typename A8, typename A9>
struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > { struct MatcherTuple< ::std::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {
typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>, typedef ::std::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8>, Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8>, Matcher<A9> > type;
Matcher<A9> >
type;
}; };
template <typename A1, typename A2, typename A3, typename A4, typename A5, template <typename A1, typename A2, typename A3, typename A4, typename A5,
typename A6, typename A7, typename A8, typename A9, typename A10> typename A6, typename A7, typename A8, typename A9, typename A10>
struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9, struct MatcherTuple< ::std::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10> > {
A10> > { typedef ::std::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>, Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8>, Matcher<A9>,
Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8>, Matcher<A10> > type;
Matcher<A9>, Matcher<A10> >
type;
}; };
// Template struct Function<F>, where F must be a function type, contains // Template struct Function<F>, where F must be a function type, contains
...@@ -164,7 +156,7 @@ struct Function; ...@@ -164,7 +156,7 @@ struct Function;
template <typename R> template <typename R>
struct Function<R()> { struct Function<R()> {
typedef R Result; typedef R Result;
typedef ::testing::tuple<> ArgumentTuple; typedef ::std::tuple<> ArgumentTuple;
typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple; typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
typedef void MakeResultVoid(); typedef void MakeResultVoid();
typedef IgnoredValue MakeResultIgnoredValue(); typedef IgnoredValue MakeResultIgnoredValue();
...@@ -174,7 +166,7 @@ template <typename R, typename A1> ...@@ -174,7 +166,7 @@ template <typename R, typename A1>
struct Function<R(A1)> struct Function<R(A1)>
: Function<R()> { : Function<R()> {
typedef A1 Argument1; typedef A1 Argument1;
typedef ::testing::tuple<A1> ArgumentTuple; typedef ::std::tuple<A1> ArgumentTuple;
typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple; typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
typedef void MakeResultVoid(A1); typedef void MakeResultVoid(A1);
typedef IgnoredValue MakeResultIgnoredValue(A1); typedef IgnoredValue MakeResultIgnoredValue(A1);
...@@ -184,7 +176,7 @@ template <typename R, typename A1, typename A2> ...@@ -184,7 +176,7 @@ template <typename R, typename A1, typename A2>
struct Function<R(A1, A2)> struct Function<R(A1, A2)>
: Function<R(A1)> { : Function<R(A1)> {
typedef A2 Argument2; typedef A2 Argument2;
typedef ::testing::tuple<A1, A2> ArgumentTuple; typedef ::std::tuple<A1, A2> ArgumentTuple;
typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple; typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
typedef void MakeResultVoid(A1, A2); typedef void MakeResultVoid(A1, A2);
typedef IgnoredValue MakeResultIgnoredValue(A1, A2); typedef IgnoredValue MakeResultIgnoredValue(A1, A2);
...@@ -194,7 +186,7 @@ template <typename R, typename A1, typename A2, typename A3> ...@@ -194,7 +186,7 @@ template <typename R, typename A1, typename A2, typename A3>
struct Function<R(A1, A2, A3)> struct Function<R(A1, A2, A3)>
: Function<R(A1, A2)> { : Function<R(A1, A2)> {
typedef A3 Argument3; typedef A3 Argument3;
typedef ::testing::tuple<A1, A2, A3> ArgumentTuple; typedef ::std::tuple<A1, A2, A3> ArgumentTuple;
typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple; typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
typedef void MakeResultVoid(A1, A2, A3); typedef void MakeResultVoid(A1, A2, A3);
typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3); typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3);
...@@ -204,7 +196,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4> ...@@ -204,7 +196,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4>
struct Function<R(A1, A2, A3, A4)> struct Function<R(A1, A2, A3, A4)>
: Function<R(A1, A2, A3)> { : Function<R(A1, A2, A3)> {
typedef A4 Argument4; 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 typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
typedef void MakeResultVoid(A1, A2, A3, A4); typedef void MakeResultVoid(A1, A2, A3, A4);
typedef IgnoredValue MakeResultIgnoredValue(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, ...@@ -215,7 +207,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4,
struct Function<R(A1, A2, A3, A4, A5)> struct Function<R(A1, A2, A3, A4, A5)>
: Function<R(A1, A2, A3, A4)> { : Function<R(A1, A2, A3, A4)> {
typedef A5 Argument5; 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 typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
typedef void MakeResultVoid(A1, A2, A3, A4, A5); typedef void MakeResultVoid(A1, A2, A3, A4, A5);
typedef IgnoredValue MakeResultIgnoredValue(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, ...@@ -226,7 +218,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4,
struct Function<R(A1, A2, A3, A4, A5, A6)> struct Function<R(A1, A2, A3, A4, A5, A6)>
: Function<R(A1, A2, A3, A4, A5)> { : Function<R(A1, A2, A3, A4, A5)> {
typedef A6 Argument6; 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 typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6); typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6);
typedef IgnoredValue MakeResultIgnoredValue(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, ...@@ -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)> struct Function<R(A1, A2, A3, A4, A5, A6, A7)>
: Function<R(A1, A2, A3, A4, A5, A6)> { : Function<R(A1, A2, A3, A4, A5, A6)> {
typedef A7 Argument7; 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 typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7); typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7);
typedef IgnoredValue MakeResultIgnoredValue(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, ...@@ -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)> struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8)>
: Function<R(A1, A2, A3, A4, A5, A6, A7)> { : Function<R(A1, A2, A3, A4, A5, A6, A7)> {
typedef A8 Argument8; 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 typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8); typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8);
typedef IgnoredValue MakeResultIgnoredValue(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, ...@@ -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)> struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)>
: Function<R(A1, A2, A3, A4, A5, A6, A7, A8)> { : Function<R(A1, A2, A3, A4, A5, A6, A7, A8)> {
typedef A9 Argument9; 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 typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8, A9); typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8, A9);
typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8, 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, ...@@ -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)> struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>
: Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> { : Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
typedef A10 Argument10; typedef A10 Argument10;
typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9, typedef ::std::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10> ArgumentTuple;
A10> ArgumentTuple;
typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple; typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10); typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10);
typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8, typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8,
......
...@@ -78,8 +78,8 @@ $var typename_As = [[$for j, [[typename A$j]]]] ...@@ -78,8 +78,8 @@ $var typename_As = [[$for j, [[typename A$j]]]]
$var As = [[$for j, [[A$j]]]] $var As = [[$for j, [[A$j]]]]
$var matcher_As = [[$for j, [[Matcher<A$j>]]]] $var matcher_As = [[$for j, [[Matcher<A$j>]]]]
template <$typename_As> template <$typename_As>
struct MatcherTuple< ::testing::tuple<$As> > { struct MatcherTuple< ::std::tuple<$As> > {
typedef ::testing::tuple<$matcher_As > type; typedef ::std::tuple<$matcher_As > type;
}; };
...@@ -103,7 +103,7 @@ struct Function; ...@@ -103,7 +103,7 @@ struct Function;
template <typename R> template <typename R>
struct Function<R()> { struct Function<R()> {
typedef R Result; typedef R Result;
typedef ::testing::tuple<> ArgumentTuple; typedef ::std::tuple<> ArgumentTuple;
typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple; typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
typedef void MakeResultVoid(); typedef void MakeResultVoid();
typedef IgnoredValue MakeResultIgnoredValue(); typedef IgnoredValue MakeResultIgnoredValue();
...@@ -122,7 +122,7 @@ template <typename R$typename_As> ...@@ -122,7 +122,7 @@ template <typename R$typename_As>
struct Function<R($As)> struct Function<R($As)>
: Function<R($prev_As)> { : Function<R($prev_As)> {
typedef A$i Argument$i; typedef A$i Argument$i;
typedef ::testing::tuple<$As> ArgumentTuple; typedef ::std::tuple<$As> ArgumentTuple;
typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple; typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
typedef void MakeResultVoid($As); typedef void MakeResultVoid($As);
typedef IgnoredValue MakeResultIgnoredValue($As); typedef IgnoredValue MakeResultIgnoredValue($As);
......
...@@ -493,7 +493,7 @@ class StlContainerView<Element[N]> { ...@@ -493,7 +493,7 @@ class StlContainerView<Element[N]> {
// This specialization is used when RawContainer is a native array // This specialization is used when RawContainer is a native array
// represented as a (pointer, size) tuple. // represented as a (pointer, size) tuple.
template <typename ElementPointer, typename Size> template <typename ElementPointer, typename Size>
class StlContainerView< ::testing::tuple<ElementPointer, Size> > { class StlContainerView< ::std::tuple<ElementPointer, Size> > {
public: public:
typedef GTEST_REMOVE_CONST_( typedef GTEST_REMOVE_CONST_(
typename internal::PointeeOf<ElementPointer>::type) RawElement; typename internal::PointeeOf<ElementPointer>::type) RawElement;
...@@ -501,11 +501,12 @@ class StlContainerView< ::testing::tuple<ElementPointer, Size> > { ...@@ -501,11 +501,12 @@ class StlContainerView< ::testing::tuple<ElementPointer, Size> > {
typedef const type const_reference; typedef const type const_reference;
static const_reference ConstReference( static const_reference ConstReference(
const ::testing::tuple<ElementPointer, Size>& array) { const ::std::tuple<ElementPointer, Size>& array) {
return type(get<0>(array), get<1>(array), RelationToSourceReference()); return type(std::get<0>(array), std::get<1>(array),
RelationToSourceReference());
} }
static type Copy(const ::testing::tuple<ElementPointer, Size>& array) { static type Copy(const ::std::tuple<ElementPointer, Size>& array) {
return type(get<0>(array), get<1>(array), RelationToSourceCopy()); return type(std::get<0>(array), std::get<1>(array), RelationToSourceCopy());
} }
}; };
......
...@@ -75,13 +75,9 @@ using testing::SetArgPointee; ...@@ -75,13 +75,9 @@ using testing::SetArgPointee;
using testing::SetArgumentPointee; using testing::SetArgumentPointee;
using testing::Unused; using testing::Unused;
using testing::_; using testing::_;
using testing::get;
using testing::internal::BuiltInDefaultValue; using testing::internal::BuiltInDefaultValue;
using testing::internal::Int64; using testing::internal::Int64;
using testing::internal::UInt64; using testing::internal::UInt64;
using testing::make_tuple;
using testing::tuple;
using testing::tuple_element;
#if !GTEST_OS_WINDOWS_MOBILE #if !GTEST_OS_WINDOWS_MOBILE
using testing::SetErrnoAndReturn; using testing::SetErrnoAndReturn;
...@@ -382,8 +378,8 @@ typedef int MyGlobalFunction(bool, int); ...@@ -382,8 +378,8 @@ typedef int MyGlobalFunction(bool, int);
class MyActionImpl : public ActionInterface<MyGlobalFunction> { class MyActionImpl : public ActionInterface<MyGlobalFunction> {
public: public:
virtual int Perform(const tuple<bool, int>& args) { virtual int Perform(const std::tuple<bool, int>& args) {
return get<0>(args) ? get<1>(args) : 0; return std::get<0>(args) ? std::get<1>(args) : 0;
} }
}; };
...@@ -399,8 +395,8 @@ TEST(ActionInterfaceTest, MakeAction) { ...@@ -399,8 +395,8 @@ TEST(ActionInterfaceTest, MakeAction) {
// it a tuple whose size and type are compatible with F's argument // it a tuple whose size and type are compatible with F's argument
// types. For example, if F is int(), then Perform() takes a // types. For example, if F is int(), then Perform() takes a
// 0-tuple; if F is void(bool, int), then Perform() takes a // 0-tuple; if F is void(bool, int), then Perform() takes a
// tuple<bool, int>, and so on. // std::tuple<bool, int>, and so on.
EXPECT_EQ(5, action.Perform(make_tuple(true, 5))); EXPECT_EQ(5, action.Perform(std::make_tuple(true, 5)));
} }
// Tests that Action<F> can be contructed from a pointer to // Tests that Action<F> can be contructed from a pointer to
...@@ -413,8 +409,8 @@ TEST(ActionTest, CanBeConstructedFromActionInterface) { ...@@ -413,8 +409,8 @@ TEST(ActionTest, CanBeConstructedFromActionInterface) {
TEST(ActionTest, DelegatesWorkToActionInterface) { TEST(ActionTest, DelegatesWorkToActionInterface) {
const Action<MyGlobalFunction> action(new MyActionImpl); const Action<MyGlobalFunction> action(new MyActionImpl);
EXPECT_EQ(5, action.Perform(make_tuple(true, 5))); EXPECT_EQ(5, action.Perform(std::make_tuple(true, 5)));
EXPECT_EQ(0, action.Perform(make_tuple(false, 1))); EXPECT_EQ(0, action.Perform(std::make_tuple(false, 1)));
} }
// Tests that Action<F> can be copied. // Tests that Action<F> can be copied.
...@@ -423,22 +419,22 @@ TEST(ActionTest, IsCopyable) { ...@@ -423,22 +419,22 @@ TEST(ActionTest, IsCopyable) {
Action<MyGlobalFunction> a2(a1); // Tests the copy constructor. Action<MyGlobalFunction> a2(a1); // Tests the copy constructor.
// a1 should continue to work after being copied from. // a1 should continue to work after being copied from.
EXPECT_EQ(5, a1.Perform(make_tuple(true, 5))); EXPECT_EQ(5, a1.Perform(std::make_tuple(true, 5)));
EXPECT_EQ(0, a1.Perform(make_tuple(false, 1))); EXPECT_EQ(0, a1.Perform(std::make_tuple(false, 1)));
// a2 should work like the action it was copied from. // a2 should work like the action it was copied from.
EXPECT_EQ(5, a2.Perform(make_tuple(true, 5))); EXPECT_EQ(5, a2.Perform(std::make_tuple(true, 5)));
EXPECT_EQ(0, a2.Perform(make_tuple(false, 1))); EXPECT_EQ(0, a2.Perform(std::make_tuple(false, 1)));
a2 = a1; // Tests the assignment operator. a2 = a1; // Tests the assignment operator.
// a1 should continue to work after being copied from. // a1 should continue to work after being copied from.
EXPECT_EQ(5, a1.Perform(make_tuple(true, 5))); EXPECT_EQ(5, a1.Perform(std::make_tuple(true, 5)));
EXPECT_EQ(0, a1.Perform(make_tuple(false, 1))); EXPECT_EQ(0, a1.Perform(std::make_tuple(false, 1)));
// a2 should work like the action it was copied from. // a2 should work like the action it was copied from.
EXPECT_EQ(5, a2.Perform(make_tuple(true, 5))); EXPECT_EQ(5, a2.Perform(std::make_tuple(true, 5)));
EXPECT_EQ(0, a2.Perform(make_tuple(false, 1))); EXPECT_EQ(0, a2.Perform(std::make_tuple(false, 1)));
} }
// Tests that an Action<From> object can be converted to a // Tests that an Action<From> object can be converted to a
...@@ -446,8 +442,8 @@ TEST(ActionTest, IsCopyable) { ...@@ -446,8 +442,8 @@ TEST(ActionTest, IsCopyable) {
class IsNotZero : public ActionInterface<bool(int)> { // NOLINT class IsNotZero : public ActionInterface<bool(int)> { // NOLINT
public: public:
virtual bool Perform(const tuple<int>& arg) { virtual bool Perform(const std::tuple<int>& arg) {
return get<0>(arg) != 0; return std::get<0>(arg) != 0;
} }
}; };
...@@ -460,8 +456,8 @@ class IsNotZero : public ActionInterface<bool(int)> { // NOLINT ...@@ -460,8 +456,8 @@ class IsNotZero : public ActionInterface<bool(int)> { // NOLINT
TEST(ActionTest, CanBeConvertedToOtherActionType) { TEST(ActionTest, CanBeConvertedToOtherActionType) {
const Action<bool(int)> a1(new IsNotZero); // NOLINT const Action<bool(int)> a1(new IsNotZero); // NOLINT
const Action<int(char)> a2 = Action<int(char)>(a1); // NOLINT const Action<int(char)> a2 = Action<int(char)>(a1); // NOLINT
EXPECT_EQ(1, a2.Perform(make_tuple('a'))); EXPECT_EQ(1, a2.Perform(std::make_tuple('a')));
EXPECT_EQ(0, a2.Perform(make_tuple('\0'))); EXPECT_EQ(0, a2.Perform(std::make_tuple('\0')));
} }
#endif // !GTEST_OS_SYMBIAN #endif // !GTEST_OS_SYMBIAN
...@@ -475,7 +471,9 @@ class ReturnSecondArgumentAction { ...@@ -475,7 +471,9 @@ class ReturnSecondArgumentAction {
// polymorphic action whose Perform() method template is either // polymorphic action whose Perform() method template is either
// const or not. This lets us verify the non-const case. // const or not. This lets us verify the non-const case.
template <typename Result, typename ArgumentTuple> 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 // Implements a polymorphic action that can be used in a nullary
...@@ -490,7 +488,9 @@ class ReturnZeroFromNullaryFunctionAction { ...@@ -490,7 +488,9 @@ class ReturnZeroFromNullaryFunctionAction {
// polymorphic action whose Perform() method template is either // polymorphic action whose Perform() method template is either
// const or not. This lets us verify the const case. // const or not. This lets us verify the const case.
template <typename Result> 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 // These functions verify that MakePolymorphicAction() returns a
...@@ -509,42 +509,42 @@ ReturnZeroFromNullaryFunction() { ...@@ -509,42 +509,42 @@ ReturnZeroFromNullaryFunction() {
// implementation class into a polymorphic action. // implementation class into a polymorphic action.
TEST(MakePolymorphicActionTest, ConstructsActionFromImpl) { TEST(MakePolymorphicActionTest, ConstructsActionFromImpl) {
Action<int(bool, int, double)> a1 = ReturnSecondArgument(); // NOLINT 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 // Tests that MakePolymorphicAction() works when the implementation
// class' Perform() method template has only one template parameter. // class' Perform() method template has only one template parameter.
TEST(MakePolymorphicActionTest, WorksWhenPerformHasOneTemplateParameter) { TEST(MakePolymorphicActionTest, WorksWhenPerformHasOneTemplateParameter) {
Action<int()> a1 = ReturnZeroFromNullaryFunction(); Action<int()> a1 = ReturnZeroFromNullaryFunction();
EXPECT_EQ(0, a1.Perform(make_tuple())); EXPECT_EQ(0, a1.Perform(std::make_tuple()));
Action<void*()> a2 = ReturnZeroFromNullaryFunction(); 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 // Tests that Return() works as an action for void-returning
// functions. // functions.
TEST(ReturnTest, WorksForVoid) { TEST(ReturnTest, WorksForVoid) {
const Action<void(int)> ret = Return(); // NOLINT 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. // Tests that Return(v) returns v.
TEST(ReturnTest, ReturnsGivenValue) { TEST(ReturnTest, ReturnsGivenValue) {
Action<int()> ret = Return(1); // NOLINT Action<int()> ret = Return(1); // NOLINT
EXPECT_EQ(1, ret.Perform(make_tuple())); EXPECT_EQ(1, ret.Perform(std::make_tuple()));
ret = Return(-5); ret = Return(-5);
EXPECT_EQ(-5, ret.Perform(make_tuple())); EXPECT_EQ(-5, ret.Perform(std::make_tuple()));
} }
// Tests that Return("string literal") works. // Tests that Return("string literal") works.
TEST(ReturnTest, AcceptsStringLiteral) { TEST(ReturnTest, AcceptsStringLiteral) {
Action<const char*()> a1 = Return("Hello"); 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"); 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 // Test struct which wraps a vector of integers. Used in
...@@ -563,7 +563,7 @@ TEST(ReturnTest, SupportsWrapperReturnType) { ...@@ -563,7 +563,7 @@ TEST(ReturnTest, SupportsWrapperReturnType) {
// Return() called with 'v' as argument. The Action will return the same data // Return() called with 'v' as argument. The Action will return the same data
// as 'v' (copy) but it will be wrapped in an IntegerVectorWrapper. // as 'v' (copy) but it will be wrapped in an IntegerVectorWrapper.
Action<IntegerVectorWrapper()> a = Return(v); 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)); EXPECT_THAT(result, ::testing::ElementsAre(0, 1, 2, 3, 4));
} }
...@@ -581,10 +581,10 @@ TEST(ReturnTest, IsCovariant) { ...@@ -581,10 +581,10 @@ TEST(ReturnTest, IsCovariant) {
Base base; Base base;
Derived derived; Derived derived;
Action<Base*()> ret = Return(&base); Action<Base*()> ret = Return(&base);
EXPECT_EQ(&base, ret.Perform(make_tuple())); EXPECT_EQ(&base, ret.Perform(std::make_tuple()));
ret = Return(&derived); 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 // Tests that the type of the value passed into Return is converted into T
...@@ -615,7 +615,7 @@ TEST(ReturnTest, ConvertsArgumentWhenConverted) { ...@@ -615,7 +615,7 @@ TEST(ReturnTest, ConvertsArgumentWhenConverted) {
EXPECT_TRUE(converted) << "Return must convert its argument in its own " EXPECT_TRUE(converted) << "Return must convert its argument in its own "
<< "conversion operator."; << "conversion operator.";
converted = false; converted = false;
action.Perform(tuple<>()); action.Perform(std::tuple<>());
EXPECT_FALSE(converted) << "Action must NOT convert its argument " EXPECT_FALSE(converted) << "Action must NOT convert its argument "
<< "when performed."; << "when performed.";
} }
...@@ -636,10 +636,10 @@ TEST(ReturnTest, CanConvertArgumentUsingNonConstTypeCastOperator) { ...@@ -636,10 +636,10 @@ TEST(ReturnTest, CanConvertArgumentUsingNonConstTypeCastOperator) {
// Tests that ReturnNull() returns NULL in a pointer-returning function. // Tests that ReturnNull() returns NULL in a pointer-returning function.
TEST(ReturnNullTest, WorksInPointerReturningFunction) { TEST(ReturnNullTest, WorksInPointerReturningFunction) {
const Action<int*()> a1 = ReturnNull(); 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 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_ #if GTEST_HAS_STD_UNIQUE_PTR_
...@@ -647,10 +647,10 @@ TEST(ReturnNullTest, WorksInPointerReturningFunction) { ...@@ -647,10 +647,10 @@ TEST(ReturnNullTest, WorksInPointerReturningFunction) {
// functions. // functions.
TEST(ReturnNullTest, WorksInSmartPointerReturningFunction) { TEST(ReturnNullTest, WorksInSmartPointerReturningFunction) {
const Action<std::unique_ptr<const int>()> a1 = ReturnNull(); 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(); 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_ #endif // GTEST_HAS_STD_UNIQUE_PTR_
...@@ -659,7 +659,7 @@ TEST(ReturnRefTest, WorksForReference) { ...@@ -659,7 +659,7 @@ TEST(ReturnRefTest, WorksForReference) {
const int n = 0; const int n = 0;
const Action<const int&(bool)> ret = ReturnRef(n); // NOLINT 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. // Tests that ReturnRef(v) is covariant.
...@@ -667,10 +667,10 @@ TEST(ReturnRefTest, IsCovariant) { ...@@ -667,10 +667,10 @@ TEST(ReturnRefTest, IsCovariant) {
Base base; Base base;
Derived derived; Derived derived;
Action<Base&()> a = ReturnRef(base); Action<Base&()> a = ReturnRef(base);
EXPECT_EQ(&base, &a.Perform(make_tuple())); EXPECT_EQ(&base, &a.Perform(std::make_tuple()));
a = ReturnRef(derived); 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. // Tests that ReturnRefOfCopy(v) works for reference types.
...@@ -678,12 +678,12 @@ TEST(ReturnRefOfCopyTest, WorksForReference) { ...@@ -678,12 +678,12 @@ TEST(ReturnRefOfCopyTest, WorksForReference) {
int n = 42; int n = 42;
const Action<const int&()> ret = ReturnRefOfCopy(n); const Action<const int&()> ret = ReturnRefOfCopy(n);
EXPECT_NE(&n, &ret.Perform(make_tuple())); EXPECT_NE(&n, &ret.Perform(std::make_tuple()));
EXPECT_EQ(42, ret.Perform(make_tuple())); EXPECT_EQ(42, ret.Perform(std::make_tuple()));
n = 43; n = 43;
EXPECT_NE(&n, &ret.Perform(make_tuple())); EXPECT_NE(&n, &ret.Perform(std::make_tuple()));
EXPECT_EQ(42, ret.Perform(make_tuple())); EXPECT_EQ(42, ret.Perform(std::make_tuple()));
} }
// Tests that ReturnRefOfCopy(v) is covariant. // Tests that ReturnRefOfCopy(v) is covariant.
...@@ -691,10 +691,10 @@ TEST(ReturnRefOfCopyTest, IsCovariant) { ...@@ -691,10 +691,10 @@ TEST(ReturnRefOfCopyTest, IsCovariant) {
Base base; Base base;
Derived derived; Derived derived;
Action<Base&()> a = ReturnRefOfCopy(base); Action<Base&()> a = ReturnRefOfCopy(base);
EXPECT_NE(&base, &a.Perform(make_tuple())); EXPECT_NE(&base, &a.Perform(std::make_tuple()));
a = ReturnRefOfCopy(derived); 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. // Tests that DoDefault() does the default action for the mock method.
...@@ -800,14 +800,14 @@ TEST(SetArgPointeeTest, SetsTheNthPointee) { ...@@ -800,14 +800,14 @@ TEST(SetArgPointeeTest, SetsTheNthPointee) {
int n = 0; int n = 0;
char ch = '\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(2, n);
EXPECT_EQ('\0', ch); EXPECT_EQ('\0', ch);
a = SetArgPointee<2>('a'); a = SetArgPointee<2>('a');
n = 0; n = 0;
ch = '\0'; ch = '\0';
a.Perform(make_tuple(true, &n, &ch)); a.Perform(std::make_tuple(true, &n, &ch));
EXPECT_EQ(0, n); EXPECT_EQ(0, n);
EXPECT_EQ('a', ch); EXPECT_EQ('a', ch);
} }
...@@ -820,13 +820,13 @@ TEST(SetArgPointeeTest, AcceptsStringLiteral) { ...@@ -820,13 +820,13 @@ TEST(SetArgPointeeTest, AcceptsStringLiteral) {
Action<MyFunction> a = SetArgPointee<0>("hi"); Action<MyFunction> a = SetArgPointee<0>("hi");
std::string str; std::string str;
const char* ptr = nullptr; const char* ptr = nullptr;
a.Perform(make_tuple(&str, &ptr)); a.Perform(std::make_tuple(&str, &ptr));
EXPECT_EQ("hi", str); EXPECT_EQ("hi", str);
EXPECT_TRUE(ptr == nullptr); EXPECT_TRUE(ptr == nullptr);
a = SetArgPointee<1>("world"); a = SetArgPointee<1>("world");
str = ""; str = "";
a.Perform(make_tuple(&str, &ptr)); a.Perform(std::make_tuple(&str, &ptr));
EXPECT_EQ("", str); EXPECT_EQ("", str);
EXPECT_STREQ("world", ptr); EXPECT_STREQ("world", ptr);
} }
...@@ -835,7 +835,7 @@ TEST(SetArgPointeeTest, AcceptsWideStringLiteral) { ...@@ -835,7 +835,7 @@ TEST(SetArgPointeeTest, AcceptsWideStringLiteral) {
typedef void MyFunction(const wchar_t**); typedef void MyFunction(const wchar_t**);
Action<MyFunction> a = SetArgPointee<0>(L"world"); Action<MyFunction> a = SetArgPointee<0>(L"world");
const wchar_t* ptr = nullptr; const wchar_t* ptr = nullptr;
a.Perform(make_tuple(&ptr)); a.Perform(std::make_tuple(&ptr));
EXPECT_STREQ(L"world", ptr); EXPECT_STREQ(L"world", ptr);
# if GTEST_HAS_STD_WSTRING # if GTEST_HAS_STD_WSTRING
...@@ -843,7 +843,7 @@ TEST(SetArgPointeeTest, AcceptsWideStringLiteral) { ...@@ -843,7 +843,7 @@ TEST(SetArgPointeeTest, AcceptsWideStringLiteral) {
typedef void MyStringFunction(std::wstring*); typedef void MyStringFunction(std::wstring*);
Action<MyStringFunction> a2 = SetArgPointee<0>(L"world"); Action<MyStringFunction> a2 = SetArgPointee<0>(L"world");
std::wstring str = L""; std::wstring str = L"";
a2.Perform(make_tuple(&str)); a2.Perform(std::make_tuple(&str));
EXPECT_EQ(L"world", str); EXPECT_EQ(L"world", str);
# endif # endif
...@@ -857,7 +857,7 @@ TEST(SetArgPointeeTest, AcceptsCharPointer) { ...@@ -857,7 +857,7 @@ TEST(SetArgPointeeTest, AcceptsCharPointer) {
Action<MyFunction> a = SetArgPointee<1>(hi); Action<MyFunction> a = SetArgPointee<1>(hi);
std::string str; std::string str;
const char* ptr = nullptr; const char* ptr = nullptr;
a.Perform(make_tuple(true, &str, &ptr)); a.Perform(std::make_tuple(true, &str, &ptr));
EXPECT_EQ("hi", str); EXPECT_EQ("hi", str);
EXPECT_TRUE(ptr == nullptr); EXPECT_TRUE(ptr == nullptr);
...@@ -865,7 +865,7 @@ TEST(SetArgPointeeTest, AcceptsCharPointer) { ...@@ -865,7 +865,7 @@ TEST(SetArgPointeeTest, AcceptsCharPointer) {
char* const world = world_array; char* const world = world_array;
a = SetArgPointee<2>(world); a = SetArgPointee<2>(world);
str = ""; str = "";
a.Perform(make_tuple(true, &str, &ptr)); a.Perform(std::make_tuple(true, &str, &ptr));
EXPECT_EQ("", str); EXPECT_EQ("", str);
EXPECT_EQ(world, ptr); EXPECT_EQ(world, ptr);
} }
...@@ -875,7 +875,7 @@ TEST(SetArgPointeeTest, AcceptsWideCharPointer) { ...@@ -875,7 +875,7 @@ TEST(SetArgPointeeTest, AcceptsWideCharPointer) {
const wchar_t* const hi = L"hi"; const wchar_t* const hi = L"hi";
Action<MyFunction> a = SetArgPointee<1>(hi); Action<MyFunction> a = SetArgPointee<1>(hi);
const wchar_t* ptr = nullptr; const wchar_t* ptr = nullptr;
a.Perform(make_tuple(true, &ptr)); a.Perform(std::make_tuple(true, &ptr));
EXPECT_EQ(hi, ptr); EXPECT_EQ(hi, ptr);
# if GTEST_HAS_STD_WSTRING # if GTEST_HAS_STD_WSTRING
...@@ -885,7 +885,7 @@ TEST(SetArgPointeeTest, AcceptsWideCharPointer) { ...@@ -885,7 +885,7 @@ TEST(SetArgPointeeTest, AcceptsWideCharPointer) {
wchar_t* const world = world_array; wchar_t* const world = world_array;
Action<MyStringFunction> a2 = SetArgPointee<1>(world); Action<MyStringFunction> a2 = SetArgPointee<1>(world);
std::wstring str; std::wstring str;
a2.Perform(make_tuple(true, &str)); a2.Perform(std::make_tuple(true, &str));
EXPECT_EQ(world_array, str); EXPECT_EQ(world_array, str);
# endif # endif
} }
...@@ -898,14 +898,14 @@ TEST(SetArgumentPointeeTest, SetsTheNthPointee) { ...@@ -898,14 +898,14 @@ TEST(SetArgumentPointeeTest, SetsTheNthPointee) {
int n = 0; int n = 0;
char ch = '\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(2, n);
EXPECT_EQ('\0', ch); EXPECT_EQ('\0', ch);
a = SetArgumentPointee<2>('a'); a = SetArgumentPointee<2>('a');
n = 0; n = 0;
ch = '\0'; ch = '\0';
a.Perform(make_tuple(true, &n, &ch)); a.Perform(std::make_tuple(true, &n, &ch));
EXPECT_EQ(0, n); EXPECT_EQ(0, n);
EXPECT_EQ('a', ch); EXPECT_EQ('a', ch);
} }
...@@ -940,16 +940,16 @@ class Foo { ...@@ -940,16 +940,16 @@ class Foo {
TEST(InvokeWithoutArgsTest, Function) { TEST(InvokeWithoutArgsTest, Function) {
// As an action that takes one argument. // As an action that takes one argument.
Action<int(int)> a = InvokeWithoutArgs(Nullary); // NOLINT 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. // As an action that takes two arguments.
Action<int(int, double)> a2 = InvokeWithoutArgs(Nullary); // NOLINT 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. // As an action that returns void.
Action<void(int)> a3 = InvokeWithoutArgs(VoidNullary); // NOLINT Action<void(int)> a3 = InvokeWithoutArgs(VoidNullary); // NOLINT
g_done = false; g_done = false;
a3.Perform(make_tuple(1)); a3.Perform(std::make_tuple(1));
EXPECT_TRUE(g_done); EXPECT_TRUE(g_done);
} }
...@@ -957,17 +957,17 @@ TEST(InvokeWithoutArgsTest, Function) { ...@@ -957,17 +957,17 @@ TEST(InvokeWithoutArgsTest, Function) {
TEST(InvokeWithoutArgsTest, Functor) { TEST(InvokeWithoutArgsTest, Functor) {
// As an action that takes no argument. // As an action that takes no argument.
Action<int()> a = InvokeWithoutArgs(NullaryFunctor()); // NOLINT 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. // As an action that takes three arguments.
Action<int(int, double, char)> a2 = // NOLINT Action<int(int, double, char)> a2 = // NOLINT
InvokeWithoutArgs(NullaryFunctor()); 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. // As an action that returns void.
Action<void()> a3 = InvokeWithoutArgs(VoidNullaryFunctor()); Action<void()> a3 = InvokeWithoutArgs(VoidNullaryFunctor());
g_done = false; g_done = false;
a3.Perform(make_tuple()); a3.Perform(std::make_tuple());
EXPECT_TRUE(g_done); EXPECT_TRUE(g_done);
} }
...@@ -976,13 +976,13 @@ TEST(InvokeWithoutArgsTest, Method) { ...@@ -976,13 +976,13 @@ TEST(InvokeWithoutArgsTest, Method) {
Foo foo; Foo foo;
Action<int(bool, char)> a = // NOLINT Action<int(bool, char)> a = // NOLINT
InvokeWithoutArgs(&foo, &Foo::Nullary); 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. // Tests using IgnoreResult() on a polymorphic action.
TEST(IgnoreResultTest, PolymorphicAction) { TEST(IgnoreResultTest, PolymorphicAction) {
Action<void(int)> a = IgnoreResult(Return(5)); // NOLINT 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. // Tests using IgnoreResult() on a monomorphic action.
...@@ -995,7 +995,7 @@ int ReturnOne() { ...@@ -995,7 +995,7 @@ int ReturnOne() {
TEST(IgnoreResultTest, MonomorphicAction) { TEST(IgnoreResultTest, MonomorphicAction) {
g_done = false; g_done = false;
Action<void()> a = IgnoreResult(Invoke(ReturnOne)); Action<void()> a = IgnoreResult(Invoke(ReturnOne));
a.Perform(make_tuple()); a.Perform(std::make_tuple());
EXPECT_TRUE(g_done); EXPECT_TRUE(g_done);
} }
...@@ -1010,28 +1010,28 @@ TEST(IgnoreResultTest, ActionReturningClass) { ...@@ -1010,28 +1010,28 @@ TEST(IgnoreResultTest, ActionReturningClass) {
g_done = false; g_done = false;
Action<void(int)> a = Action<void(int)> a =
IgnoreResult(Invoke(ReturnMyNonDefaultConstructible)); // NOLINT IgnoreResult(Invoke(ReturnMyNonDefaultConstructible)); // NOLINT
a.Perform(make_tuple(2)); a.Perform(std::make_tuple(2));
EXPECT_TRUE(g_done); EXPECT_TRUE(g_done);
} }
TEST(AssignTest, Int) { TEST(AssignTest, Int) {
int x = 0; int x = 0;
Action<void(int)> a = Assign(&x, 5); Action<void(int)> a = Assign(&x, 5);
a.Perform(make_tuple(0)); a.Perform(std::make_tuple(0));
EXPECT_EQ(5, x); EXPECT_EQ(5, x);
} }
TEST(AssignTest, String) { TEST(AssignTest, String) {
::std::string x; ::std::string x;
Action<void(void)> a = Assign(&x, "Hello, world"); Action<void(void)> a = Assign(&x, "Hello, world");
a.Perform(make_tuple()); a.Perform(std::make_tuple());
EXPECT_EQ("Hello, world", x); EXPECT_EQ("Hello, world", x);
} }
TEST(AssignTest, CompatibleTypes) { TEST(AssignTest, CompatibleTypes) {
double x = 0; double x = 0;
Action<void(int)> a = Assign(&x, 5); Action<void(int)> a = Assign(&x, 5);
a.Perform(make_tuple(0)); a.Perform(std::make_tuple(0));
EXPECT_DOUBLE_EQ(5, x); EXPECT_DOUBLE_EQ(5, x);
} }
...@@ -1045,20 +1045,20 @@ class SetErrnoAndReturnTest : public testing::Test { ...@@ -1045,20 +1045,20 @@ class SetErrnoAndReturnTest : public testing::Test {
TEST_F(SetErrnoAndReturnTest, Int) { TEST_F(SetErrnoAndReturnTest, Int) {
Action<int(void)> a = SetErrnoAndReturn(ENOTTY, -5); 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); EXPECT_EQ(ENOTTY, errno);
} }
TEST_F(SetErrnoAndReturnTest, Ptr) { TEST_F(SetErrnoAndReturnTest, Ptr) {
int x; int x;
Action<int*(void)> a = SetErrnoAndReturn(ENOTTY, &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); EXPECT_EQ(ENOTTY, errno);
} }
TEST_F(SetErrnoAndReturnTest, CompatibleTypes) { TEST_F(SetErrnoAndReturnTest, CompatibleTypes) {
Action<double()> a = SetErrnoAndReturn(EINVAL, 5); 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); EXPECT_EQ(EINVAL, errno);
} }
...@@ -1298,47 +1298,47 @@ TEST(FunctorActionTest, ActionFromFunction) { ...@@ -1298,47 +1298,47 @@ TEST(FunctorActionTest, ActionFromFunction) {
TEST(FunctorActionTest, ActionFromLambda) { TEST(FunctorActionTest, ActionFromLambda) {
Action<int(bool, int)> a1 = [](bool b, int i) { return b ? i : 0; }; Action<int(bool, int)> a1 = [](bool b, int i) { return b ? i : 0; };
EXPECT_EQ(5, a1.Perform(make_tuple(true, 5))); EXPECT_EQ(5, a1.Perform(std::make_tuple(true, 5)));
EXPECT_EQ(0, a1.Perform(make_tuple(false, 5))); EXPECT_EQ(0, a1.Perform(std::make_tuple(false, 5)));
std::unique_ptr<int> saved; std::unique_ptr<int> saved;
Action<void(std::unique_ptr<int>)> a2 = [&saved](std::unique_ptr<int> p) { Action<void(std::unique_ptr<int>)> a2 = [&saved](std::unique_ptr<int> p) {
saved = std::move(p); saved = std::move(p);
}; };
a2.Perform(make_tuple(UniqueInt(5))); a2.Perform(std::make_tuple(UniqueInt(5)));
EXPECT_EQ(5, *saved); EXPECT_EQ(5, *saved);
} }
TEST(FunctorActionTest, PolymorphicFunctor) { TEST(FunctorActionTest, PolymorphicFunctor) {
Action<int(int)> ai = Double(); 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! 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) { TEST(FunctorActionTest, TypeConversion) {
// Numeric promotions are allowed. // Numeric promotions are allowed.
const Action<bool(int)> a1 = [](int i) { return i > 1; }; const Action<bool(int)> a1 = [](int i) { return i > 1; };
const Action<int(bool)> a2 = Action<int(bool)>(a1); const Action<int(bool)> a2 = Action<int(bool)>(a1);
EXPECT_EQ(1, a1.Perform(make_tuple(42))); EXPECT_EQ(1, a1.Perform(std::make_tuple(42)));
EXPECT_EQ(0, a2.Perform(make_tuple(42))); EXPECT_EQ(0, a2.Perform(std::make_tuple(42)));
// Implicit constructors are allowed. // Implicit constructors are allowed.
const Action<bool(std::string)> s1 = [](std::string s) { return !s.empty(); }; const Action<bool(std::string)> s1 = [](std::string s) { return !s.empty(); };
const Action<int(const char*)> s2 = Action<int(const char*)>(s1); const Action<int(const char*)> s2 = Action<int(const char*)>(s1);
EXPECT_EQ(0, s2.Perform(make_tuple(""))); EXPECT_EQ(0, s2.Perform(std::make_tuple("")));
EXPECT_EQ(1, s2.Perform(make_tuple("hello"))); EXPECT_EQ(1, s2.Perform(std::make_tuple("hello")));
// Also between the lambda and the action itself. // Also between the lambda and the action itself.
const Action<bool(std::string)> x = [](Unused) { return 42; }; 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) { TEST(FunctorActionTest, UnusedArguments) {
// Verify that users can ignore uninteresting arguments. // Verify that users can ignore uninteresting arguments.
Action<int(int, double y, double z)> a = Action<int(int, double y, double z)> a =
[](int i, Unused, Unused) { return 2 * i; }; [](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)); EXPECT_EQ(6, a.Perform(dummy));
} }
...@@ -1349,14 +1349,14 @@ TEST(FunctorActionTest, UnusedArguments) { ...@@ -1349,14 +1349,14 @@ TEST(FunctorActionTest, UnusedArguments) {
// so maybe it's better to make users use lambdas instead. // so maybe it's better to make users use lambdas instead.
TEST(MoveOnlyArgumentsTest, ReturningActions) { TEST(MoveOnlyArgumentsTest, ReturningActions) {
Action<int(std::unique_ptr<int>)> a = Return(1); 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; }); 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); Action<void(std::unique_ptr<int>, int*)> a2 = testing::SetArgPointee<1>(3);
int x = 0; int x = 0;
a2.Perform(make_tuple(nullptr, &x)); a2.Perform(std::make_tuple(nullptr, &x));
EXPECT_EQ(x, 3); EXPECT_EQ(x, 3);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment