Commit 530a94a6 authored by stoyan@google.com's avatar stoyan@google.com

Move helper_gmock.h from ChromFrame subrtee to testing directory.


BUG=none
TEST=builds ok
Review URL: http://codereview.chromium.org/295049

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30132 0039d316-1c4b-4281-b951-d872f2087c98
parent cfd55769
...@@ -24,11 +24,12 @@ ...@@ -24,11 +24,12 @@
#include "chrome_frame/chrome_frame_delegate.h" #include "chrome_frame/chrome_frame_delegate.h"
#include "chrome_frame/crash_reporting/vectored_handler-impl.h" #include "chrome_frame/crash_reporting/vectored_handler-impl.h"
#include "chrome_frame/test/chrome_frame_test_utils.h" #include "chrome_frame/test/chrome_frame_test_utils.h"
#include "chrome_frame/test/helper_gmock.h"
#include "chrome_frame/test_utils.h" #include "chrome_frame/test_utils.h"
#include "chrome_frame/utils.h" #include "chrome_frame/utils.h"
#include "chrome/installer/util/install_util.h" #include "chrome/installer/util/install_util.h"
#include "chrome/installer/util/helper.h" #include "chrome/installer/util/helper.h"
#include "testing/gmock_mutant.h"
using testing::CreateFunctor;
const wchar_t kDocRoot[] = L"chrome_frame\\test\\data"; const wchar_t kDocRoot[] = L"chrome_frame\\test\\data";
const int kLongWaitTimeout = 60 * 1000; const int kLongWaitTimeout = 60 * 1000;
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
'gmock/src/gmock-printers.cc', 'gmock/src/gmock-printers.cc',
'gmock/src/gmock-spec-builders.cc', 'gmock/src/gmock-spec-builders.cc',
'gmock/src/gmock.cc', 'gmock/src/gmock.cc',
'gmock_mutant.h', # gMock helpers
], ],
'sources!': [ 'sources!': [
'gmock/src/gmock-all.cc', # Not needed by our build. 'gmock/src/gmock-all.cc', # Not needed by our build.
......
// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. // Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CHROME_FRAME_TEST_HELPER_GMOCK_H_
#define CHROME_FRAME_TEST_HELPER_GMOCK_H_ #ifndef TESTING_GMOCK_MUTANT_H_
#define TESTING_GMOCK_MUTANT_H_
// The intention of this file is to make possible using GMock actions in // The intention of this file is to make possible using GMock actions in
// all of its syntactic beauty. Classes and helper functions could be used as // all of its syntactic beauty. Classes and helper functions can be used as
// more generic variants of Task and Callback classes (see base/task.h) // more generic variants of Task and Callback classes (see base/task.h)
// Mutant supports both pre-bound arguments (like Task) and call-time arguments // Mutant supports both pre-bound arguments (like Task) and call-time
// (like Callback) - hence the name. :-) // arguments (like Callback) - hence the name. :-)
// DispatchToMethod supporting two sets of arguments - //
// pre-bound (P) and call-time (C) as well as return value type is templatized // DispatchToMethod supports two sets of arguments: pre-bound (P) and
// It will also try to call the selected method even if provided pre-bound args // call-time (C). The arguments as well as the return type are templatized.
// does not match exactly with the function signature - hence the X1, X2 // DispatchToMethod will also try to call the selected method even if provided
// parameters in CreateFunctor. // pre-bound arguments does not match exactly with the function signature
// hence the X1, X2 ... XN parameters in CreateFunctor.
//
// Additionally you can bind the object at calltime by binding a pointer to
// pointer to the object at creation time - before including this file you
// have to #define GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING.
//
// TODO(stoyan): It's yet not clear to me should we use T& and T&* instead
// of T* and T** when we invoke CreateFunctor to match the EXPECT_CALL style.
//
//
// Sample usage with gMock:
//
// struct Mock : public ObjectDelegate {
// MOCK_METHOD2(string, OnRequest(int n, const string& request));
// MOCK_METHOD1(void, OnQuit(int exit_code));
// MOCK_METHOD2(void, LogMessage(int level, const string& message));
//
// string HandleFlowers(const string& reply, int n, const string& request) {
// string result = SStringPrintf("In request of %d %s ", n, request);
// for (int i = 0; i < n; ++i) result.append(reply)
// return result;
// }
//
// void DoLogMessage(int level, const string& message) {
// }
//
// void QuitMessageLoop(int seconds) {
// MessageLoop* loop = MessageLoop::current();
// loop->PostDelayedTask(FROM_HERE, new MessageLoop::QuitTask,
// 1000 * seconds);
// }
// };
//
// Mock mock;
// // Will invoke mock.HandleFlowers("orchids", n, request)
// // "orchids" is a pre-bound argument, and <n> and <request> are call-time
// // arguments - they are not known until the OnRequest mock is invoked.
// EXPECT_CALL(mock, OnRequest(Ge(5), StartsWith("flower"))
// .Times(1)
// .WillOnce(Invoke(CreateFunctor(&mock, &Mock::HandleFlowers,
// string("orchids"))));
//
//
// // No pre-bound arguments, two call-time arguments passed
// // directly to DoLogMessage
// EXPECT_CALL(mock, OnLogMessage(_, _))
// .Times(AnyNumber())
// .WillAlways(Invoke(CreateFunctor, &mock, &Mock::DoLogMessage));
//
//
// // In this case we have a single pre-bound argument - 3. We ignore
// // all of the arguments of OnQuit.
// EXCEPT_CALL(mock, OnQuit(_))
// .Times(1)
// .WillOnce(InvokeWithoutArgs(CreateFunctor(
// &mock, &Mock::QuitMessageLoop, 3)));
//
// MessageLoop loop;
// loop.Run();
//
//
// // Here is another example of how we can set an action that invokes
// // method of an object that is not yet created.
// struct Mock : public ObjectDelegate {
// MOCK_METHOD1(void, DemiurgeCreated(Demiurge*));
// MOCK_METHOD2(void, OnRequest(int count, const string&));
//
// void StoreDemiurge(Demiurge* w) {
// demiurge_ = w;
// }
//
// Demiurge* demiurge;
// }
//
// EXPECT_CALL(mock, DemiurgeCreated(_)).Times(1)
// .WillOnce(Invoke(CreateFunctor(&mock, &Mock::StoreDemiurge)));
//
// EXPECT_CALL(mock, OnRequest(_, StrEq("Moby Dick")))
// .Times(AnyNumber())
// .WillAlways(WithArgs<0>(Invoke(
// CreateFunctor(&mock->demiurge_, &Demiurge::DecreaseMonsters))));
//
#include "base/linked_ptr.h" #include "base/linked_ptr.h"
#include "base/task.h" // for CallBackStorage
#include "base/tuple.h" // for Tuple #include "base/tuple.h" // for Tuple
namespace testing {
// 0 - 0 // 0 - 0
template <typename R, typename T, typename Method> template <typename R, typename T, typename Method>
...@@ -248,26 +332,53 @@ class MutantRunner { ...@@ -248,26 +332,53 @@ class MutantRunner {
virtual ~MutantRunner() {} virtual ~MutantRunner() {}
}; };
// MutantImpl holds pre-bound arguments (like Task) and like Callback // Mutant holds pre-bound arguments (like Task). Like Callback
// allows call-time arguments. // allows call-time arguments. You bind a pointer to the object
// at creation time.
template <typename R, typename T, typename Method, template <typename R, typename T, typename Method,
typename PreBound, typename Params> typename PreBound, typename Params>
class MutantImpl : public CallbackStorage<T, Method>, class Mutant : public MutantRunner<R, Params> {
public MutantRunner<R, Params> {
public: public:
MutantImpl(T* obj, Method meth, const PreBound& pb) Mutant(T* obj, Method method, const PreBound& pb)
: CallbackStorage<T, Method>(obj, meth), : obj_(obj), method_(method), pb_(pb) {
pb_(pb) {
} }
// MutantRunner implementation // MutantRunner implementation
virtual R RunWithParams(const Params& params) { virtual R RunWithParams(const Params& params) {
return DispatchToMethod<R>(this->obj_, this->meth_, pb_, params); return DispatchToMethod<R>(this->obj_, this->method_, pb_, params);
} }
T* obj_;
Method method_;
PreBound pb_; PreBound pb_;
}; };
#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
// MutantLateBind is like Mutant, but you bind a pointer to a pointer
// to the object. This way you can create actions for an object
// that is not yet created (has only storage for a pointer to it).
template <typename R, typename T, typename Method,
typename PreBound, typename Params>
class MutantLateObjectBind : public MutantRunner<R, Params> {
public:
MutantLateObjectBind(T** obj, Method method, const PreBound& pb)
: obj_(obj), method_(method), pb_(pb) {
}
// MutantRunner implementation.
virtual R RunWithParams(const Params& params) {
EXPECT_THAT(*this->obj_, testing::NotNull());
if (NULL == *this->obj_)
return R();
return DispatchToMethod<R>( *this->obj_, this->method_, pb_, params);
}
T** obj_;
Method method_;
PreBound pb_;
};
#endif
// Simple MutantRunner<> wrapper acting as a functor. // Simple MutantRunner<> wrapper acting as a functor.
// Redirects operator() to MutantRunner<Params>::Run() // Redirects operator() to MutantRunner<Params>::Run()
template <typename R, typename Params> template <typename R, typename Params>
...@@ -316,152 +427,329 @@ struct MutantFunctor { ...@@ -316,152 +427,329 @@ struct MutantFunctor {
template <typename R, typename T> template <typename R, typename T>
inline MutantFunctor<R, Tuple0> inline MutantFunctor<R, Tuple0>
CreateFunctor(T* obj, R (T::*method)()) { CreateFunctor(T* obj, R (T::*method)()) {
MutantRunner<R, Tuple0> *t = new MutantImpl<R, T, MutantRunner<R, Tuple0> *t =
R (T::*)(), new Mutant<R, T, R (T::*)(),
Tuple0, Tuple0> Tuple0, Tuple0>
(obj, method, MakeTuple()); (obj, method, MakeTuple());
return MutantFunctor<R, Tuple0>(t);
}
#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
// 0 - 0
template <typename R, typename T>
inline MutantFunctor<R, Tuple0>
CreateFunctor(T** obj, R (T::*method)()) {
MutantRunner<R, Tuple0> *t =
new MutantLateObjectBind<R, T, R (T::*)(),
Tuple0, Tuple0>
(obj, method, MakeTuple());
return MutantFunctor<R, Tuple0>(t); return MutantFunctor<R, Tuple0>(t);
} }
#endif
// 0 - 1 // 0 - 1
template <typename R, typename T, typename A1> template <typename R, typename T, typename A1>
inline MutantFunctor<R, Tuple1<A1> > inline MutantFunctor<R, Tuple1<A1> >
CreateFunctor(T* obj, R (T::*method)(A1)) { CreateFunctor(T* obj, R (T::*method)(A1)) {
MutantRunner<R, Tuple1<A1> > *t = new MutantImpl<R, T, MutantRunner<R, Tuple1<A1> > *t =
R (T::*)(A1), new Mutant<R, T, R (T::*)(A1),
Tuple0, Tuple1<A1> > Tuple0, Tuple1<A1> >
(obj, method, MakeTuple()); (obj, method, MakeTuple());
return MutantFunctor<R, Tuple1<A1> >(t); return MutantFunctor<R, Tuple1<A1> >(t);
} }
#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
// 0 - 1
template <typename R, typename T, typename A1>
inline MutantFunctor<R, Tuple1<A1> >
CreateFunctor(T** obj, R (T::*method)(A1)) {
MutantRunner<R, Tuple1<A1> > *t =
new MutantLateObjectBind<R, T, R (T::*)(A1),
Tuple0, Tuple1<A1> >
(obj, method, MakeTuple());
return MutantFunctor<R, Tuple1<A1> >(t);
}
#endif
// 0 - 2 // 0 - 2
template <typename R, typename T, typename A1, typename A2> template <typename R, typename T, typename A1, typename A2>
inline MutantFunctor<R, Tuple2<A1, A2> > inline MutantFunctor<R, Tuple2<A1, A2> >
CreateFunctor(T* obj, R (T::*method)(A1, A2)) { CreateFunctor(T* obj, R (T::*method)(A1, A2)) {
MutantRunner<R, Tuple2<A1, A2> > *t = new MutantImpl<R, T, MutantRunner<R, Tuple2<A1, A2> > *t =
R (T::*)(A1, A2), new Mutant<R, T, R (T::*)(A1, A2),
Tuple0, Tuple2<A1, A2> > Tuple0, Tuple2<A1, A2> >
(obj, method, MakeTuple()); (obj, method, MakeTuple());
return MutantFunctor<R, Tuple2<A1, A2> >(t); return MutantFunctor<R, Tuple2<A1, A2> >(t);
} }
#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
// 0 - 2
template <typename R, typename T, typename A1, typename A2>
inline MutantFunctor<R, Tuple2<A1, A2> >
CreateFunctor(T** obj, R (T::*method)(A1, A2)) {
MutantRunner<R, Tuple2<A1, A2> > *t =
new MutantLateObjectBind<R, T, R (T::*)(A1, A2),
Tuple0, Tuple2<A1, A2> >
(obj, method, MakeTuple());
return MutantFunctor<R, Tuple2<A1, A2> >(t);
}
#endif
// 0 - 3 // 0 - 3
template <typename R, typename T, typename A1, typename A2, typename A3> template <typename R, typename T, typename A1, typename A2, typename A3>
inline MutantFunctor<R, Tuple3<A1, A2, A3> > inline MutantFunctor<R, Tuple3<A1, A2, A3> >
CreateFunctor(T* obj, R (T::*method)(A1, A2, A3)) { CreateFunctor(T* obj, R (T::*method)(A1, A2, A3)) {
MutantRunner<R, Tuple3<A1, A2, A3> > *t = new MutantImpl<R, T, MutantRunner<R, Tuple3<A1, A2, A3> > *t =
R (T::*)(A1, A2, A3), new Mutant<R, T, R (T::*)(A1, A2, A3),
Tuple0, Tuple3<A1, A2, A3> > Tuple0, Tuple3<A1, A2, A3> >
(obj, method, MakeTuple()); (obj, method, MakeTuple());
return MutantFunctor<R, Tuple3<A1, A2, A3> >(t); return MutantFunctor<R, Tuple3<A1, A2, A3> >(t);
} }
#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
// 0 - 3
template <typename R, typename T, typename A1, typename A2, typename A3>
inline MutantFunctor<R, Tuple3<A1, A2, A3> >
CreateFunctor(T** obj, R (T::*method)(A1, A2, A3)) {
MutantRunner<R, Tuple3<A1, A2, A3> > *t =
new MutantLateObjectBind<R, T, R (T::*)(A1, A2, A3),
Tuple0, Tuple3<A1, A2, A3> >
(obj, method, MakeTuple());
return MutantFunctor<R, Tuple3<A1, A2, A3> >(t);
}
#endif
// 0 - 4 // 0 - 4
template <typename R, typename T, typename A1, typename A2, typename A3, template <typename R, typename T, typename A1, typename A2, typename A3,
typename A4> typename A4>
inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> > inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> >
CreateFunctor(T* obj, R (T::*method)(A1, A2, A3, A4)) { CreateFunctor(T* obj, R (T::*method)(A1, A2, A3, A4)) {
MutantRunner<R, Tuple4<A1, A2, A3, A4> > *t = new MutantImpl<R, T, MutantRunner<R, Tuple4<A1, A2, A3, A4> > *t =
R (T::*)(A1, A2, A3, A4), new Mutant<R, T, R (T::*)(A1, A2, A3, A4),
Tuple0, Tuple4<A1, A2, A3, A4> > Tuple0, Tuple4<A1, A2, A3, A4> >
(obj, method, MakeTuple()); (obj, method, MakeTuple());
return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t); return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t);
} }
#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
// 0 - 4
template <typename R, typename T, typename A1, typename A2, typename A3,
typename A4>
inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> >
CreateFunctor(T** obj, R (T::*method)(A1, A2, A3, A4)) {
MutantRunner<R, Tuple4<A1, A2, A3, A4> > *t =
new MutantLateObjectBind<R, T, R (T::*)(A1, A2, A3, A4),
Tuple0, Tuple4<A1, A2, A3, A4> >
(obj, method, MakeTuple());
return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t);
}
#endif
// 1 - 0 // 1 - 0
template <typename R, typename T, typename P1, typename X1> template <typename R, typename T, typename P1, typename X1>
inline MutantFunctor<R, Tuple0> inline MutantFunctor<R, Tuple0>
CreateFunctor(T* obj, R (T::*method)(X1), const P1& p1) { CreateFunctor(T* obj, R (T::*method)(X1), const P1& p1) {
MutantRunner<R, Tuple0> *t = new MutantImpl<R, T, MutantRunner<R, Tuple0> *t =
R (T::*)(X1), new Mutant<R, T, R (T::*)(X1),
Tuple1<P1>, Tuple0> Tuple1<P1>, Tuple0>
(obj, method, MakeTuple(p1)); (obj, method, MakeTuple(p1));
return MutantFunctor<R, Tuple0>(t);
}
#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
// 1 - 0
template <typename R, typename T, typename P1, typename X1>
inline MutantFunctor<R, Tuple0>
CreateFunctor(T** obj, R (T::*method)(X1), const P1& p1) {
MutantRunner<R, Tuple0> *t =
new MutantLateObjectBind<R, T, R (T::*)(X1),
Tuple1<P1>, Tuple0>
(obj, method, MakeTuple(p1));
return MutantFunctor<R, Tuple0>(t); return MutantFunctor<R, Tuple0>(t);
} }
#endif
// 1 - 1 // 1 - 1
template <typename R, typename T, typename P1, typename A1, typename X1> template <typename R, typename T, typename P1, typename A1, typename X1>
inline MutantFunctor<R, Tuple1<A1> > inline MutantFunctor<R, Tuple1<A1> >
CreateFunctor(T* obj, R (T::*method)(X1, A1), const P1& p1) { CreateFunctor(T* obj, R (T::*method)(X1, A1), const P1& p1) {
MutantRunner<R, Tuple1<A1> > *t = new MutantImpl<R, T, MutantRunner<R, Tuple1<A1> > *t =
R (T::*)(X1, A1), new Mutant<R, T, R (T::*)(X1, A1),
Tuple1<P1>, Tuple1<A1> > Tuple1<P1>, Tuple1<A1> >
(obj, method, MakeTuple(p1)); (obj, method, MakeTuple(p1));
return MutantFunctor<R, Tuple1<A1> >(t); return MutantFunctor<R, Tuple1<A1> >(t);
} }
#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
// 1 - 1
template <typename R, typename T, typename P1, typename A1, typename X1>
inline MutantFunctor<R, Tuple1<A1> >
CreateFunctor(T** obj, R (T::*method)(X1, A1), const P1& p1) {
MutantRunner<R, Tuple1<A1> > *t =
new MutantLateObjectBind<R, T, R (T::*)(X1, A1),
Tuple1<P1>, Tuple1<A1> >
(obj, method, MakeTuple(p1));
return MutantFunctor<R, Tuple1<A1> >(t);
}
#endif
// 1 - 2 // 1 - 2
template <typename R, typename T, typename P1, typename A1, typename A2, template <typename R, typename T, typename P1, typename A1, typename A2,
typename X1> typename X1>
inline MutantFunctor<R, Tuple2<A1, A2> > inline MutantFunctor<R, Tuple2<A1, A2> >
CreateFunctor(T* obj, R (T::*method)(X1, A1, A2), const P1& p1) { CreateFunctor(T* obj, R (T::*method)(X1, A1, A2), const P1& p1) {
MutantRunner<R, Tuple2<A1, A2> > *t = new MutantImpl<R, T, MutantRunner<R, Tuple2<A1, A2> > *t =
R (T::*)(X1, A1, A2), new Mutant<R, T, R (T::*)(X1, A1, A2),
Tuple1<P1>, Tuple2<A1, A2> > Tuple1<P1>, Tuple2<A1, A2> >
(obj, method, MakeTuple(p1)); (obj, method, MakeTuple(p1));
return MutantFunctor<R, Tuple2<A1, A2> >(t); return MutantFunctor<R, Tuple2<A1, A2> >(t);
} }
#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
// 1 - 2
template <typename R, typename T, typename P1, typename A1, typename A2,
typename X1>
inline MutantFunctor<R, Tuple2<A1, A2> >
CreateFunctor(T** obj, R (T::*method)(X1, A1, A2), const P1& p1) {
MutantRunner<R, Tuple2<A1, A2> > *t =
new MutantLateObjectBind<R, T, R (T::*)(X1, A1, A2),
Tuple1<P1>, Tuple2<A1, A2> >
(obj, method, MakeTuple(p1));
return MutantFunctor<R, Tuple2<A1, A2> >(t);
}
#endif
// 1 - 3 // 1 - 3
template <typename R, typename T, typename P1, typename A1, typename A2, template <typename R, typename T, typename P1, typename A1, typename A2,
typename A3, typename X1> typename A3, typename X1>
inline MutantFunctor<R, Tuple3<A1, A2, A3> > inline MutantFunctor<R, Tuple3<A1, A2, A3> >
CreateFunctor(T* obj, R (T::*method)(X1, A1, A2, A3), const P1& p1) { CreateFunctor(T* obj, R (T::*method)(X1, A1, A2, A3), const P1& p1) {
MutantRunner<R, Tuple3<A1, A2, A3> > *t = new MutantImpl<R, T, MutantRunner<R, Tuple3<A1, A2, A3> > *t =
R (T::*)(X1, A1, A2, A3), new Mutant<R, T, R (T::*)(X1, A1, A2, A3),
Tuple1<P1>, Tuple3<A1, A2, A3> > Tuple1<P1>, Tuple3<A1, A2, A3> >
(obj, method, MakeTuple(p1)); (obj, method, MakeTuple(p1));
return MutantFunctor<R, Tuple3<A1, A2, A3> >(t); return MutantFunctor<R, Tuple3<A1, A2, A3> >(t);
} }
#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
// 1 - 3
template <typename R, typename T, typename P1, typename A1, typename A2,
typename A3, typename X1>
inline MutantFunctor<R, Tuple3<A1, A2, A3> >
CreateFunctor(T** obj, R (T::*method)(X1, A1, A2, A3), const P1& p1) {
MutantRunner<R, Tuple3<A1, A2, A3> > *t =
new MutantLateObjectBind<R, T, R (T::*)(X1, A1, A2, A3),
Tuple1<P1>, Tuple3<A1, A2, A3> >
(obj, method, MakeTuple(p1));
return MutantFunctor<R, Tuple3<A1, A2, A3> >(t);
}
#endif
// 1 - 4 // 1 - 4
template <typename R, typename T, typename P1, typename A1, typename A2, template <typename R, typename T, typename P1, typename A1, typename A2,
typename A3, typename A4, typename X1> typename A3, typename A4, typename X1>
inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> > inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> >
CreateFunctor(T* obj, R (T::*method)(X1, A1, A2, A3, A4), const P1& p1) { CreateFunctor(T* obj, R (T::*method)(X1, A1, A2, A3, A4), const P1& p1) {
MutantRunner<R, Tuple4<A1, A2, A3, A4> > *t = new MutantImpl<R, T, MutantRunner<R, Tuple4<A1, A2, A3, A4> > *t =
R (T::*)(X1, A1, A2, A3, A4), new Mutant<R, T, R (T::*)(X1, A1, A2, A3, A4),
Tuple1<P1>, Tuple4<A1, A2, A3, A4> > Tuple1<P1>, Tuple4<A1, A2, A3, A4> >
(obj, method, MakeTuple(p1)); (obj, method, MakeTuple(p1));
return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t);
}
#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
// 1 - 4
template <typename R, typename T, typename P1, typename A1, typename A2,
typename A3, typename A4, typename X1>
inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> >
CreateFunctor(T** obj, R (T::*method)(X1, A1, A2, A3, A4), const P1& p1) {
MutantRunner<R, Tuple4<A1, A2, A3, A4> > *t =
new MutantLateObjectBind<R, T, R (T::*)(X1, A1, A2, A3, A4),
Tuple1<P1>, Tuple4<A1, A2, A3, A4> >
(obj, method, MakeTuple(p1));
return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t); return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t);
} }
#endif
// 2 - 0 // 2 - 0
template <typename R, typename T, typename P1, typename P2, typename X1, template <typename R, typename T, typename P1, typename P2, typename X1,
typename X2> typename X2>
inline MutantFunctor<R, Tuple0> inline MutantFunctor<R, Tuple0>
CreateFunctor(T* obj, R (T::*method)(X1, X2), const P1& p1, const P2& p2) { CreateFunctor(T* obj, R (T::*method)(X1, X2), const P1& p1, const P2& p2) {
MutantRunner<R, Tuple0> *t = new MutantImpl<R, T, MutantRunner<R, Tuple0> *t =
R (T::*)(X1, X2), new Mutant<R, T, R (T::*)(X1, X2),
Tuple2<P1, P2>, Tuple0> Tuple2<P1, P2>, Tuple0>
(obj, method, MakeTuple(p1, p2)); (obj, method, MakeTuple(p1, p2));
return MutantFunctor<R, Tuple0>(t); return MutantFunctor<R, Tuple0>(t);
} }
#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
// 2 - 0
template <typename R, typename T, typename P1, typename P2, typename X1,
typename X2>
inline MutantFunctor<R, Tuple0>
CreateFunctor(T** obj, R (T::*method)(X1, X2), const P1& p1, const P2& p2) {
MutantRunner<R, Tuple0> *t =
new MutantLateObjectBind<R, T, R (T::*)(X1, X2),
Tuple2<P1, P2>, Tuple0>
(obj, method, MakeTuple(p1, p2));
return MutantFunctor<R, Tuple0>(t);
}
#endif
// 2 - 1 // 2 - 1
template <typename R, typename T, typename P1, typename P2, typename A1, template <typename R, typename T, typename P1, typename P2, typename A1,
typename X1, typename X2> typename X1, typename X2>
inline MutantFunctor<R, Tuple1<A1> > inline MutantFunctor<R, Tuple1<A1> >
CreateFunctor(T* obj, R (T::*method)(X1, X2, A1), const P1& p1, const P2& p2) { CreateFunctor(T* obj, R (T::*method)(X1, X2, A1), const P1& p1, const P2& p2) {
MutantRunner<R, Tuple1<A1> > *t = new MutantImpl<R, T, MutantRunner<R, Tuple1<A1> > *t =
R (T::*)(X1, X2, A1), new Mutant<R, T, R (T::*)(X1, X2, A1),
Tuple2<P1, P2>, Tuple1<A1> > Tuple2<P1, P2>, Tuple1<A1> >
(obj, method, MakeTuple(p1, p2)); (obj, method, MakeTuple(p1, p2));
return MutantFunctor<R, Tuple1<A1> >(t); return MutantFunctor<R, Tuple1<A1> >(t);
} }
#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
// 2 - 1
template <typename R, typename T, typename P1, typename P2, typename A1,
typename X1, typename X2>
inline MutantFunctor<R, Tuple1<A1> >
CreateFunctor(T** obj, R (T::*method)(X1, X2, A1), const P1& p1, const P2& p2) {
MutantRunner<R, Tuple1<A1> > *t =
new MutantLateObjectBind<R, T, R (T::*)(X1, X2, A1),
Tuple2<P1, P2>, Tuple1<A1> >
(obj, method, MakeTuple(p1, p2));
return MutantFunctor<R, Tuple1<A1> >(t);
}
#endif
// 2 - 2 // 2 - 2
template <typename R, typename T, typename P1, typename P2, typename A1, template <typename R, typename T, typename P1, typename P2, typename A1,
typename A2, typename X1, typename X2> typename A2, typename X1, typename X2>
inline MutantFunctor<R, Tuple2<A1, A2> > inline MutantFunctor<R, Tuple2<A1, A2> >
CreateFunctor(T* obj, R (T::*method)(X1, X2, A1, A2), const P1& p1, CreateFunctor(T* obj, R (T::*method)(X1, X2, A1, A2), const P1& p1,
const P2& p2) { const P2& p2) {
MutantRunner<R, Tuple2<A1, A2> > *t = new MutantImpl<R, T, MutantRunner<R, Tuple2<A1, A2> > *t =
R (T::*)(X1, X2, A1, A2), new Mutant<R, T, R (T::*)(X1, X2, A1, A2),
Tuple2<P1, P2>, Tuple2<A1, A2> > Tuple2<P1, P2>, Tuple2<A1, A2> >
(obj, method, MakeTuple(p1, p2)); (obj, method, MakeTuple(p1, p2));
return MutantFunctor<R, Tuple2<A1, A2> >(t);
}
#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
// 2 - 2
template <typename R, typename T, typename P1, typename P2, typename A1,
typename A2, typename X1, typename X2>
inline MutantFunctor<R, Tuple2<A1, A2> >
CreateFunctor(T** obj, R (T::*method)(X1, X2, A1, A2), const P1& p1,
const P2& p2) {
MutantRunner<R, Tuple2<A1, A2> > *t =
new MutantLateObjectBind<R, T, R (T::*)(X1, X2, A1, A2),
Tuple2<P1, P2>, Tuple2<A1, A2> >
(obj, method, MakeTuple(p1, p2));
return MutantFunctor<R, Tuple2<A1, A2> >(t); return MutantFunctor<R, Tuple2<A1, A2> >(t);
} }
#endif
// 2 - 3 // 2 - 3
template <typename R, typename T, typename P1, typename P2, typename A1, template <typename R, typename T, typename P1, typename P2, typename A1,
...@@ -469,12 +757,27 @@ template <typename R, typename T, typename P1, typename P2, typename A1, ...@@ -469,12 +757,27 @@ template <typename R, typename T, typename P1, typename P2, typename A1,
inline MutantFunctor<R, Tuple3<A1, A2, A3> > inline MutantFunctor<R, Tuple3<A1, A2, A3> >
CreateFunctor(T* obj, R (T::*method)(X1, X2, A1, A2, A3), const P1& p1, CreateFunctor(T* obj, R (T::*method)(X1, X2, A1, A2, A3), const P1& p1,
const P2& p2) { const P2& p2) {
MutantRunner<R, Tuple3<A1, A2, A3> > *t = new MutantImpl<R, T, MutantRunner<R, Tuple3<A1, A2, A3> > *t =
R (T::*)(X1, X2, A1, A2, A3), new Mutant<R, T, R (T::*)(X1, X2, A1, A2, A3),
Tuple2<P1, P2>, Tuple3<A1, A2, A3> > Tuple2<P1, P2>, Tuple3<A1, A2, A3> >
(obj, method, MakeTuple(p1, p2)); (obj, method, MakeTuple(p1, p2));
return MutantFunctor<R, Tuple3<A1, A2, A3> >(t);
}
#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
// 2 - 3
template <typename R, typename T, typename P1, typename P2, typename A1,
typename A2, typename A3, typename X1, typename X2>
inline MutantFunctor<R, Tuple3<A1, A2, A3> >
CreateFunctor(T** obj, R (T::*method)(X1, X2, A1, A2, A3), const P1& p1,
const P2& p2) {
MutantRunner<R, Tuple3<A1, A2, A3> > *t =
new MutantLateObjectBind<R, T, R (T::*)(X1, X2, A1, A2, A3),
Tuple2<P1, P2>, Tuple3<A1, A2, A3> >
(obj, method, MakeTuple(p1, p2));
return MutantFunctor<R, Tuple3<A1, A2, A3> >(t); return MutantFunctor<R, Tuple3<A1, A2, A3> >(t);
} }
#endif
// 2 - 4 // 2 - 4
template <typename R, typename T, typename P1, typename P2, typename A1, template <typename R, typename T, typename P1, typename P2, typename A1,
...@@ -482,12 +785,27 @@ template <typename R, typename T, typename P1, typename P2, typename A1, ...@@ -482,12 +785,27 @@ template <typename R, typename T, typename P1, typename P2, typename A1,
inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> > inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> >
CreateFunctor(T* obj, R (T::*method)(X1, X2, A1, A2, A3, A4), const P1& p1, CreateFunctor(T* obj, R (T::*method)(X1, X2, A1, A2, A3, A4), const P1& p1,
const P2& p2) { const P2& p2) {
MutantRunner<R, Tuple4<A1, A2, A3, A4> > *t = new MutantImpl<R, T, MutantRunner<R, Tuple4<A1, A2, A3, A4> > *t =
R (T::*)(X1, X2, A1, A2, A3, A4), new Mutant<R, T, R (T::*)(X1, X2, A1, A2, A3, A4),
Tuple2<P1, P2>, Tuple4<A1, A2, A3, A4> > Tuple2<P1, P2>, Tuple4<A1, A2, A3, A4> >
(obj, method, MakeTuple(p1, p2)); (obj, method, MakeTuple(p1, p2));
return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t);
}
#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
// 2 - 4
template <typename R, typename T, typename P1, typename P2, typename A1,
typename A2, typename A3, typename A4, typename X1, typename X2>
inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> >
CreateFunctor(T** obj, R (T::*method)(X1, X2, A1, A2, A3, A4), const P1& p1,
const P2& p2) {
MutantRunner<R, Tuple4<A1, A2, A3, A4> > *t =
new MutantLateObjectBind<R, T, R (T::*)(X1, X2, A1, A2, A3, A4),
Tuple2<P1, P2>, Tuple4<A1, A2, A3, A4> >
(obj, method, MakeTuple(p1, p2));
return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t); return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t);
} }
#endif
// 3 - 0 // 3 - 0
template <typename R, typename T, typename P1, typename P2, typename P3, template <typename R, typename T, typename P1, typename P2, typename P3,
...@@ -495,39 +813,84 @@ template <typename R, typename T, typename P1, typename P2, typename P3, ...@@ -495,39 +813,84 @@ template <typename R, typename T, typename P1, typename P2, typename P3,
inline MutantFunctor<R, Tuple0> inline MutantFunctor<R, Tuple0>
CreateFunctor(T* obj, R (T::*method)(X1, X2, X3), const P1& p1, const P2& p2, CreateFunctor(T* obj, R (T::*method)(X1, X2, X3), const P1& p1, const P2& p2,
const P3& p3) { const P3& p3) {
MutantRunner<R, Tuple0> *t = new MutantImpl<R, T, MutantRunner<R, Tuple0> *t =
R (T::*)(X1, X2, X3), new Mutant<R, T, R (T::*)(X1, X2, X3),
Tuple3<P1, P2, P3>, Tuple0> Tuple3<P1, P2, P3>, Tuple0>
(obj, method, MakeTuple(p1, p2, p3)); (obj, method, MakeTuple(p1, p2, p3));
return MutantFunctor<R, Tuple0>(t); return MutantFunctor<R, Tuple0>(t);
} }
#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
// 3 - 0
template <typename R, typename T, typename P1, typename P2, typename P3,
typename X1, typename X2, typename X3>
inline MutantFunctor<R, Tuple0>
CreateFunctor(T** obj, R (T::*method)(X1, X2, X3), const P1& p1, const P2& p2,
const P3& p3) {
MutantRunner<R, Tuple0> *t =
new MutantLateObjectBind<R, T, R (T::*)(X1, X2, X3),
Tuple3<P1, P2, P3>, Tuple0>
(obj, method, MakeTuple(p1, p2, p3));
return MutantFunctor<R, Tuple0>(t);
}
#endif
// 3 - 1 // 3 - 1
template <typename R, typename T, typename P1, typename P2, typename P3, template <typename R, typename T, typename P1, typename P2, typename P3,
typename A1, typename X1, typename X2, typename X3> typename A1, typename X1, typename X2, typename X3>
inline MutantFunctor<R, Tuple1<A1> > inline MutantFunctor<R, Tuple1<A1> >
CreateFunctor(T* obj, R (T::*method)(X1, X2, X3, A1), const P1& p1, CreateFunctor(T* obj, R (T::*method)(X1, X2, X3, A1), const P1& p1,
const P2& p2, const P3& p3) { const P2& p2, const P3& p3) {
MutantRunner<R, Tuple1<A1> > *t = new MutantImpl<R, T, MutantRunner<R, Tuple1<A1> > *t =
R (T::*)(X1, X2, X3, A1), new Mutant<R, T, R (T::*)(X1, X2, X3, A1),
Tuple3<P1, P2, P3>, Tuple1<A1> > Tuple3<P1, P2, P3>, Tuple1<A1> >
(obj, method, MakeTuple(p1, p2, p3)); (obj, method, MakeTuple(p1, p2, p3));
return MutantFunctor<R, Tuple1<A1> >(t); return MutantFunctor<R, Tuple1<A1> >(t);
} }
#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
// 3 - 1
template <typename R, typename T, typename P1, typename P2, typename P3,
typename A1, typename X1, typename X2, typename X3>
inline MutantFunctor<R, Tuple1<A1> >
CreateFunctor(T** obj, R (T::*method)(X1, X2, X3, A1), const P1& p1,
const P2& p2, const P3& p3) {
MutantRunner<R, Tuple1<A1> > *t =
new MutantLateObjectBind<R, T, R (T::*)(X1, X2, X3, A1),
Tuple3<P1, P2, P3>, Tuple1<A1> >
(obj, method, MakeTuple(p1, p2, p3));
return MutantFunctor<R, Tuple1<A1> >(t);
}
#endif
// 3 - 2 // 3 - 2
template <typename R, typename T, typename P1, typename P2, typename P3, template <typename R, typename T, typename P1, typename P2, typename P3,
typename A1, typename A2, typename X1, typename X2, typename X3> typename A1, typename A2, typename X1, typename X2, typename X3>
inline MutantFunctor<R, Tuple2<A1, A2> > inline MutantFunctor<R, Tuple2<A1, A2> >
CreateFunctor(T* obj, R (T::*method)(X1, X2, X3, A1, A2), const P1& p1, CreateFunctor(T* obj, R (T::*method)(X1, X2, X3, A1, A2), const P1& p1,
const P2& p2, const P3& p3) { const P2& p2, const P3& p3) {
MutantRunner<R, Tuple2<A1, A2> > *t = new MutantImpl<R, T, MutantRunner<R, Tuple2<A1, A2> > *t =
R (T::*)(X1, X2, X3, A1, A2), new Mutant<R, T, R (T::*)(X1, X2, X3, A1, A2),
Tuple3<P1, P2, P3>, Tuple2<A1, A2> > Tuple3<P1, P2, P3>, Tuple2<A1, A2> >
(obj, method, MakeTuple(p1, p2, p3)); (obj, method, MakeTuple(p1, p2, p3));
return MutantFunctor<R, Tuple2<A1, A2> >(t); return MutantFunctor<R, Tuple2<A1, A2> >(t);
} }
#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
// 3 - 2
template <typename R, typename T, typename P1, typename P2, typename P3,
typename A1, typename A2, typename X1, typename X2, typename X3>
inline MutantFunctor<R, Tuple2<A1, A2> >
CreateFunctor(T** obj, R (T::*method)(X1, X2, X3, A1, A2), const P1& p1,
const P2& p2, const P3& p3) {
MutantRunner<R, Tuple2<A1, A2> > *t =
new MutantLateObjectBind<R, T, R (T::*)(X1, X2, X3, A1, A2),
Tuple3<P1, P2, P3>, Tuple2<A1, A2> >
(obj, method, MakeTuple(p1, p2, p3));
return MutantFunctor<R, Tuple2<A1, A2> >(t);
}
#endif
// 3 - 3 // 3 - 3
template <typename R, typename T, typename P1, typename P2, typename P3, template <typename R, typename T, typename P1, typename P2, typename P3,
typename A1, typename A2, typename A3, typename X1, typename X2, typename A1, typename A2, typename A3, typename X1, typename X2,
...@@ -535,13 +898,29 @@ template <typename R, typename T, typename P1, typename P2, typename P3, ...@@ -535,13 +898,29 @@ template <typename R, typename T, typename P1, typename P2, typename P3,
inline MutantFunctor<R, Tuple3<A1, A2, A3> > inline MutantFunctor<R, Tuple3<A1, A2, A3> >
CreateFunctor(T* obj, R (T::*method)(X1, X2, X3, A1, A2, A3), const P1& p1, CreateFunctor(T* obj, R (T::*method)(X1, X2, X3, A1, A2, A3), const P1& p1,
const P2& p2, const P3& p3) { const P2& p2, const P3& p3) {
MutantRunner<R, Tuple3<A1, A2, A3> > *t = new MutantImpl<R, T, MutantRunner<R, Tuple3<A1, A2, A3> > *t =
R (T::*)(X1, X2, X3, A1, A2, A3), new Mutant<R, T, R (T::*)(X1, X2, X3, A1, A2, A3),
Tuple3<P1, P2, P3>, Tuple3<A1, A2, A3> > Tuple3<P1, P2, P3>, Tuple3<A1, A2, A3> >
(obj, method, MakeTuple(p1, p2, p3)); (obj, method, MakeTuple(p1, p2, p3));
return MutantFunctor<R, Tuple3<A1, A2, A3> >(t); return MutantFunctor<R, Tuple3<A1, A2, A3> >(t);
} }
#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
// 3 - 3
template <typename R, typename T, typename P1, typename P2, typename P3,
typename A1, typename A2, typename A3, typename X1, typename X2,
typename X3>
inline MutantFunctor<R, Tuple3<A1, A2, A3> >
CreateFunctor(T** obj, R (T::*method)(X1, X2, X3, A1, A2, A3), const P1& p1,
const P2& p2, const P3& p3) {
MutantRunner<R, Tuple3<A1, A2, A3> > *t =
new MutantLateObjectBind<R, T, R (T::*)(X1, X2, X3, A1, A2, A3),
Tuple3<P1, P2, P3>, Tuple3<A1, A2, A3> >
(obj, method, MakeTuple(p1, p2, p3));
return MutantFunctor<R, Tuple3<A1, A2, A3> >(t);
}
#endif
// 3 - 4 // 3 - 4
template <typename R, typename T, typename P1, typename P2, typename P3, template <typename R, typename T, typename P1, typename P2, typename P3,
typename A1, typename A2, typename A3, typename A4, typename X1, typename A1, typename A2, typename A3, typename A4, typename X1,
...@@ -549,26 +928,57 @@ template <typename R, typename T, typename P1, typename P2, typename P3, ...@@ -549,26 +928,57 @@ template <typename R, typename T, typename P1, typename P2, typename P3,
inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> > inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> >
CreateFunctor(T* obj, R (T::*method)(X1, X2, X3, A1, A2, A3, A4), const P1& p1, CreateFunctor(T* obj, R (T::*method)(X1, X2, X3, A1, A2, A3, A4), const P1& p1,
const P2& p2, const P3& p3) { const P2& p2, const P3& p3) {
MutantRunner<R, Tuple4<A1, A2, A3, A4> > *t = new MutantImpl<R, T, MutantRunner<R, Tuple4<A1, A2, A3, A4> > *t =
R (T::*)(X1, X2, X3, A1, A2, A3, A4), new Mutant<R, T, R (T::*)(X1, X2, X3, A1, A2, A3, A4),
Tuple3<P1, P2, P3>, Tuple4<A1, A2, A3, A4> > Tuple3<P1, P2, P3>, Tuple4<A1, A2, A3, A4> >
(obj, method, MakeTuple(p1, p2, p3)); (obj, method, MakeTuple(p1, p2, p3));
return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t); return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t);
} }
#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
// 3 - 4
template <typename R, typename T, typename P1, typename P2, typename P3,
typename A1, typename A2, typename A3, typename A4, typename X1,
typename X2, typename X3>
inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> >
CreateFunctor(T** obj, R (T::*method)(X1, X2, X3, A1, A2, A3, A4), const P1& p1,
const P2& p2, const P3& p3) {
MutantRunner<R, Tuple4<A1, A2, A3, A4> > *t =
new MutantLateObjectBind<R, T, R (T::*)(X1, X2, X3, A1, A2, A3, A4),
Tuple3<P1, P2, P3>, Tuple4<A1, A2, A3, A4> >
(obj, method, MakeTuple(p1, p2, p3));
return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t);
}
#endif
// 4 - 0 // 4 - 0
template <typename R, typename T, typename P1, typename P2, typename P3, template <typename R, typename T, typename P1, typename P2, typename P3,
typename P4, typename X1, typename X2, typename X3, typename X4> typename P4, typename X1, typename X2, typename X3, typename X4>
inline MutantFunctor<R, Tuple0> inline MutantFunctor<R, Tuple0>
CreateFunctor(T* obj, R (T::*method)(X1, X2, X3, X4), const P1& p1, CreateFunctor(T* obj, R (T::*method)(X1, X2, X3, X4), const P1& p1,
const P2& p2, const P3& p3, const P4& p4) { const P2& p2, const P3& p3, const P4& p4) {
MutantRunner<R, Tuple0> *t = new MutantImpl<R, T, MutantRunner<R, Tuple0> *t =
R (T::*)(X1, X2, X3, X4), new Mutant<R, T, R (T::*)(X1, X2, X3, X4),
Tuple4<P1, P2, P3, P4>, Tuple0> Tuple4<P1, P2, P3, P4>, Tuple0>
(obj, method, MakeTuple(p1, p2, p3, p4)); (obj, method, MakeTuple(p1, p2, p3, p4));
return MutantFunctor<R, Tuple0>(t); return MutantFunctor<R, Tuple0>(t);
} }
#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
// 4 - 0
template <typename R, typename T, typename P1, typename P2, typename P3,
typename P4, typename X1, typename X2, typename X3, typename X4>
inline MutantFunctor<R, Tuple0>
CreateFunctor(T** obj, R (T::*method)(X1, X2, X3, X4), const P1& p1,
const P2& p2, const P3& p3, const P4& p4) {
MutantRunner<R, Tuple0> *t =
new MutantLateObjectBind<R, T, R (T::*)(X1, X2, X3, X4),
Tuple4<P1, P2, P3, P4>, Tuple0>
(obj, method, MakeTuple(p1, p2, p3, p4));
return MutantFunctor<R, Tuple0>(t);
}
#endif
// 4 - 1 // 4 - 1
template <typename R, typename T, typename P1, typename P2, typename P3, template <typename R, typename T, typename P1, typename P2, typename P3,
typename P4, typename A1, typename X1, typename X2, typename X3, typename P4, typename A1, typename X1, typename X2, typename X3,
...@@ -576,13 +986,29 @@ template <typename R, typename T, typename P1, typename P2, typename P3, ...@@ -576,13 +986,29 @@ template <typename R, typename T, typename P1, typename P2, typename P3,
inline MutantFunctor<R, Tuple1<A1> > inline MutantFunctor<R, Tuple1<A1> >
CreateFunctor(T* obj, R (T::*method)(X1, X2, X3, X4, A1), const P1& p1, CreateFunctor(T* obj, R (T::*method)(X1, X2, X3, X4, A1), const P1& p1,
const P2& p2, const P3& p3, const P4& p4) { const P2& p2, const P3& p3, const P4& p4) {
MutantRunner<R, Tuple1<A1> > *t = new MutantImpl<R, T, MutantRunner<R, Tuple1<A1> > *t =
R (T::*)(X1, X2, X3, X4, A1), new Mutant<R, T, R (T::*)(X1, X2, X3, X4, A1),
Tuple4<P1, P2, P3, P4>, Tuple1<A1> > Tuple4<P1, P2, P3, P4>, Tuple1<A1> >
(obj, method, MakeTuple(p1, p2, p3, p4)); (obj, method, MakeTuple(p1, p2, p3, p4));
return MutantFunctor<R, Tuple1<A1> >(t); return MutantFunctor<R, Tuple1<A1> >(t);
} }
#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
// 4 - 1
template <typename R, typename T, typename P1, typename P2, typename P3,
typename P4, typename A1, typename X1, typename X2, typename X3,
typename X4>
inline MutantFunctor<R, Tuple1<A1> >
CreateFunctor(T** obj, R (T::*method)(X1, X2, X3, X4, A1), const P1& p1,
const P2& p2, const P3& p3, const P4& p4) {
MutantRunner<R, Tuple1<A1> > *t =
new MutantLateObjectBind<R, T, R (T::*)(X1, X2, X3, X4, A1),
Tuple4<P1, P2, P3, P4>, Tuple1<A1> >
(obj, method, MakeTuple(p1, p2, p3, p4));
return MutantFunctor<R, Tuple1<A1> >(t);
}
#endif
// 4 - 2 // 4 - 2
template <typename R, typename T, typename P1, typename P2, typename P3, template <typename R, typename T, typename P1, typename P2, typename P3,
typename P4, typename A1, typename A2, typename X1, typename X2, typename P4, typename A1, typename A2, typename X1, typename X2,
...@@ -590,12 +1016,28 @@ template <typename R, typename T, typename P1, typename P2, typename P3, ...@@ -590,12 +1016,28 @@ template <typename R, typename T, typename P1, typename P2, typename P3,
inline MutantFunctor<R, Tuple2<A1, A2> > inline MutantFunctor<R, Tuple2<A1, A2> >
CreateFunctor(T* obj, R (T::*method)(X1, X2, X3, X4, A1, A2), const P1& p1, CreateFunctor(T* obj, R (T::*method)(X1, X2, X3, X4, A1, A2), const P1& p1,
const P2& p2, const P3& p3, const P4& p4) { const P2& p2, const P3& p3, const P4& p4) {
MutantRunner<R, Tuple2<A1, A2> > *t = new MutantImpl<R, T, MutantRunner<R, Tuple2<A1, A2> > *t =
R (T::*)(X1, X2, X3, X4, A1, A2), new Mutant<R, T, R (T::*)(X1, X2, X3, X4, A1, A2),
Tuple4<P1, P2, P3, P4>, Tuple2<A1, A2> > Tuple4<P1, P2, P3, P4>, Tuple2<A1, A2> >
(obj, method, MakeTuple(p1, p2, p3, p4)); (obj, method, MakeTuple(p1, p2, p3, p4));
return MutantFunctor<R, Tuple2<A1, A2> >(t);
}
#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
// 4 - 2
template <typename R, typename T, typename P1, typename P2, typename P3,
typename P4, typename A1, typename A2, typename X1, typename X2,
typename X3, typename X4>
inline MutantFunctor<R, Tuple2<A1, A2> >
CreateFunctor(T** obj, R (T::*method)(X1, X2, X3, X4, A1, A2), const P1& p1,
const P2& p2, const P3& p3, const P4& p4) {
MutantRunner<R, Tuple2<A1, A2> > *t =
new MutantLateObjectBind<R, T, R (T::*)(X1, X2, X3, X4, A1, A2),
Tuple4<P1, P2, P3, P4>, Tuple2<A1, A2> >
(obj, method, MakeTuple(p1, p2, p3, p4));
return MutantFunctor<R, Tuple2<A1, A2> >(t); return MutantFunctor<R, Tuple2<A1, A2> >(t);
} }
#endif
// 4 - 3 // 4 - 3
template <typename R, typename T, typename P1, typename P2, typename P3, template <typename R, typename T, typename P1, typename P2, typename P3,
...@@ -604,13 +1046,29 @@ template <typename R, typename T, typename P1, typename P2, typename P3, ...@@ -604,13 +1046,29 @@ template <typename R, typename T, typename P1, typename P2, typename P3,
inline MutantFunctor<R, Tuple3<A1, A2, A3> > inline MutantFunctor<R, Tuple3<A1, A2, A3> >
CreateFunctor(T* obj, R (T::*method)(X1, X2, X3, X4, A1, A2, A3), const P1& p1, CreateFunctor(T* obj, R (T::*method)(X1, X2, X3, X4, A1, A2, A3), const P1& p1,
const P2& p2, const P3& p3, const P4& p4) { const P2& p2, const P3& p3, const P4& p4) {
MutantRunner<R, Tuple3<A1, A2, A3> > *t = new MutantImpl<R, T, MutantRunner<R, Tuple3<A1, A2, A3> > *t =
R (T::*)(X1, X2, X3, X4, A1, A2, A3), new Mutant<R, T, R (T::*)(X1, X2, X3, X4, A1, A2, A3),
Tuple4<P1, P2, P3, P4>, Tuple3<A1, A2, A3> > Tuple4<P1, P2, P3, P4>, Tuple3<A1, A2, A3> >
(obj, method, MakeTuple(p1, p2, p3, p4)); (obj, method, MakeTuple(p1, p2, p3, p4));
return MutantFunctor<R, Tuple3<A1, A2, A3> >(t); return MutantFunctor<R, Tuple3<A1, A2, A3> >(t);
} }
#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
// 4 - 3
template <typename R, typename T, typename P1, typename P2, typename P3,
typename P4, typename A1, typename A2, typename A3, typename X1,
typename X2, typename X3, typename X4>
inline MutantFunctor<R, Tuple3<A1, A2, A3> >
CreateFunctor(T** obj, R (T::*method)(X1, X2, X3, X4, A1, A2, A3), const P1& p1,
const P2& p2, const P3& p3, const P4& p4) {
MutantRunner<R, Tuple3<A1, A2, A3> > *t =
new MutantLateObjectBind<R, T, R (T::*)(X1, X2, X3, X4, A1, A2, A3),
Tuple4<P1, P2, P3, P4>, Tuple3<A1, A2, A3> >
(obj, method, MakeTuple(p1, p2, p3, p4));
return MutantFunctor<R, Tuple3<A1, A2, A3> >(t);
}
#endif
// 4 - 4 // 4 - 4
template <typename R, typename T, typename P1, typename P2, typename P3, template <typename R, typename T, typename P1, typename P2, typename P3,
typename P4, typename A1, typename A2, typename A3, typename A4, typename P4, typename A1, typename A2, typename A3, typename A4,
...@@ -618,10 +1076,29 @@ template <typename R, typename T, typename P1, typename P2, typename P3, ...@@ -618,10 +1076,29 @@ template <typename R, typename T, typename P1, typename P2, typename P3,
inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> > inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> >
CreateFunctor(T* obj, R (T::*method)(X1, X2, X3, X4, A1, A2, A3, A4), CreateFunctor(T* obj, R (T::*method)(X1, X2, X3, X4, A1, A2, A3, A4),
const P1& p1, const P2& p2, const P3& p3, const P4& p4) { const P1& p1, const P2& p2, const P3& p3, const P4& p4) {
MutantRunner<R, Tuple4<A1, A2, A3, A4> > *t = new MutantImpl<R, T, MutantRunner<R, Tuple4<A1, A2, A3, A4> > *t =
R (T::*)(X1, X2, X3, X4, A1, A2, A3, A4), new Mutant<R, T, R (T::*)(X1, X2, X3, X4, A1, A2, A3, A4),
Tuple4<P1, P2, P3, P4>, Tuple4<A1, A2, A3, A4> > Tuple4<P1, P2, P3, P4>, Tuple4<A1, A2, A3, A4> >
(obj, method, MakeTuple(p1, p2, p3, p4)); (obj, method, MakeTuple(p1, p2, p3, p4));
return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t);
}
#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
// 4 - 4
template <typename R, typename T, typename P1, typename P2, typename P3,
typename P4, typename A1, typename A2, typename A3, typename A4,
typename X1, typename X2, typename X3, typename X4>
inline MutantFunctor<R, Tuple4<A1, A2, A3, A4> >
CreateFunctor(T** obj, R (T::*method)(X1, X2, X3, X4, A1, A2, A3, A4),
const P1& p1, const P2& p2, const P3& p3, const P4& p4) {
MutantRunner<R, Tuple4<A1, A2, A3, A4> > *t =
new MutantLateObjectBind<R, T, R (T::*)(X1, X2, X3, X4, A1, A2, A3, A4),
Tuple4<P1, P2, P3, P4>, Tuple4<A1, A2, A3, A4> >
(obj, method, MakeTuple(p1, p2, p3, p4));
return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t); return MutantFunctor<R, Tuple4<A1, A2, A3, A4> >(t);
} }
#endif // CHROME_FRAME_TEST_HELPER_GMOCK_H_ #endif
} // namespace testing
#endif // TESTING_GMOCK_MUTANT_H_
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