From 3e8e8da2b8b7c2970628c7fff15413aa0532de1a Mon Sep 17 00:00:00 2001 From: "stoyan@chromium.org" Date: Mon, 16 Nov 2009 22:07:04 +0000 Subject: Late object binding for stdcall. TBR=amit Review URL: http://codereview.chromium.org/395023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32100 0039d316-1c4b-4281-b951-d872f2087c98 --- testing/generate_gmock_mutant.py | 9 +- testing/gmock_mutant.h | 321 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 329 insertions(+), 1 deletion(-) (limited to 'testing') diff --git a/testing/generate_gmock_mutant.py b/testing/generate_gmock_mutant.py index 7de9cbc..8e1fdf0 100644 --- a/testing/generate_gmock_mutant.py +++ b/testing/generate_gmock_mutant.py @@ -418,7 +418,14 @@ def GenerateCreateFunctor(prebound, calltime): # Functor for method with __stdcall calling conventions. print "#if defined (OS_WIN)" stdcall = CREATE_METHOD_FUNCTOR_TEMPLATE.replace("U::", "__stdcall U::") - print FixCode(stdcall % args) + stdcall = FixCode(stdcall % args) + print stdcall + print "#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING" + stdcall2 = stdcall.replace("CreateFunctor(T* obj,", "CreateFunctor(T** obj,") + stdcall2 = stdcall2.replace("new Mutant", "new MutantLateObjectBind") + stdcall2 = stdcall2.replace(" " * 17 + "Tuple", " " * 31 + "Tuple") + print stdcall2 + print "#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING" print "#endif // OS_WIN\n" diff --git a/testing/gmock_mutant.h b/testing/gmock_mutant.h index dd7435e..66697d8 100644 --- a/testing/gmock_mutant.h +++ b/testing/gmock_mutant.h @@ -650,6 +650,17 @@ CreateFunctor(T* obj, R (__stdcall U::*method)()) { (obj, method, MakeTuple()); return MutantFunctor(t); } +#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING +template +inline MutantFunctor +CreateFunctor(T** obj, R (__stdcall U::*method)()) { + MutantRunner* t = + new MutantLateObjectBind + (obj, method, MakeTuple()); + return MutantFunctor(t); +} +#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING #endif // OS_WIN // 0 - 1 @@ -695,6 +706,17 @@ CreateFunctor(T* obj, R (__stdcall U::*method)(A1)) { (obj, method, MakeTuple()); return MutantFunctor >(t); } +#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING +template +inline MutantFunctor > +CreateFunctor(T** obj, R (__stdcall U::*method)(A1)) { + MutantRunner >* t = + new MutantLateObjectBind > + (obj, method, MakeTuple()); + return MutantFunctor >(t); +} +#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING #endif // OS_WIN // 0 - 2 @@ -740,6 +762,17 @@ CreateFunctor(T* obj, R (__stdcall U::*method)(A1, A2)) { (obj, method, MakeTuple()); return MutantFunctor >(t); } +#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING +template +inline MutantFunctor > +CreateFunctor(T** obj, R (__stdcall U::*method)(A1, A2)) { + MutantRunner >* t = + new MutantLateObjectBind > + (obj, method, MakeTuple()); + return MutantFunctor >(t); +} +#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING #endif // OS_WIN // 0 - 3 @@ -788,6 +821,18 @@ CreateFunctor(T* obj, R (__stdcall U::*method)(A1, A2, A3)) { (obj, method, MakeTuple()); return MutantFunctor >(t); } +#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING +template +inline MutantFunctor > +CreateFunctor(T** obj, R (__stdcall U::*method)(A1, A2, A3)) { + MutantRunner >* t = + new MutantLateObjectBind > + (obj, method, MakeTuple()); + return MutantFunctor >(t); +} +#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING #endif // OS_WIN // 0 - 4 @@ -836,6 +881,18 @@ CreateFunctor(T* obj, R (__stdcall U::*method)(A1, A2, A3, A4)) { (obj, method, MakeTuple()); return MutantFunctor >(t); } +#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING +template +inline MutantFunctor > +CreateFunctor(T** obj, R (__stdcall U::*method)(A1, A2, A3, A4)) { + MutantRunner >* t = + new MutantLateObjectBind > + (obj, method, MakeTuple()); + return MutantFunctor >(t); +} +#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING #endif // OS_WIN // 1 - 0 @@ -881,6 +938,17 @@ CreateFunctor(T* obj, R (__stdcall U::*method)(X1), const P1& p1) { (obj, method, MakeTuple(p1)); return MutantFunctor(t); } +#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING +template +inline MutantFunctor +CreateFunctor(T** obj, R (__stdcall U::*method)(X1), const P1& p1) { + MutantRunner* t = + new MutantLateObjectBind, Tuple0> + (obj, method, MakeTuple(p1)); + return MutantFunctor(t); +} +#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING #endif // OS_WIN // 1 - 1 @@ -929,6 +997,18 @@ CreateFunctor(T* obj, R (__stdcall U::*method)(X1, A1), const P1& p1) { (obj, method, MakeTuple(p1)); return MutantFunctor >(t); } +#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING +template +inline MutantFunctor > +CreateFunctor(T** obj, R (__stdcall U::*method)(X1, A1), const P1& p1) { + MutantRunner >* t = + new MutantLateObjectBind, Tuple1 > + (obj, method, MakeTuple(p1)); + return MutantFunctor >(t); +} +#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING #endif // OS_WIN // 1 - 2 @@ -977,6 +1057,18 @@ CreateFunctor(T* obj, R (__stdcall U::*method)(X1, A1, A2), const P1& p1) { (obj, method, MakeTuple(p1)); return MutantFunctor >(t); } +#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING +template +inline MutantFunctor > +CreateFunctor(T** obj, R (__stdcall U::*method)(X1, A1, A2), const P1& p1) { + MutantRunner >* t = + new MutantLateObjectBind, Tuple2 > + (obj, method, MakeTuple(p1)); + return MutantFunctor >(t); +} +#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING #endif // OS_WIN // 1 - 3 @@ -1026,6 +1118,18 @@ CreateFunctor(T* obj, R (__stdcall U::*method)(X1, A1, A2, A3), const P1& p1) { (obj, method, MakeTuple(p1)); return MutantFunctor >(t); } +#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING +template +inline MutantFunctor > +CreateFunctor(T** obj, R (__stdcall U::*method)(X1, A1, A2, A3), const P1& p1) { + MutantRunner >* t = + new MutantLateObjectBind, Tuple3 > + (obj, method, MakeTuple(p1)); + return MutantFunctor >(t); +} +#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING #endif // OS_WIN // 1 - 4 @@ -1076,6 +1180,19 @@ CreateFunctor(T* obj, R (__stdcall U::*method)(X1, A1, A2, A3, A4), (obj, method, MakeTuple(p1)); return MutantFunctor >(t); } +#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING +template +inline MutantFunctor > +CreateFunctor(T** obj, R (__stdcall U::*method)(X1, A1, A2, A3, A4), + const P1& p1) { + MutantRunner >* t = + new MutantLateObjectBind, Tuple4 > + (obj, method, MakeTuple(p1)); + return MutantFunctor >(t); +} +#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING #endif // OS_WIN // 2 - 0 @@ -1125,6 +1242,19 @@ CreateFunctor(T* obj, R (__stdcall U::*method)(X1, X2), const P1& p1, (obj, method, MakeTuple(p1, p2)); return MutantFunctor(t); } +#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING +template +inline MutantFunctor +CreateFunctor(T** obj, R (__stdcall U::*method)(X1, X2), const P1& p1, + const P2& p2) { + MutantRunner* t = + new MutantLateObjectBind, Tuple0> + (obj, method, MakeTuple(p1, p2)); + return MutantFunctor(t); +} +#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING #endif // OS_WIN // 2 - 1 @@ -1175,6 +1305,19 @@ CreateFunctor(T* obj, R (__stdcall U::*method)(X1, X2, A1), const P1& p1, (obj, method, MakeTuple(p1, p2)); return MutantFunctor >(t); } +#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING +template +inline MutantFunctor > +CreateFunctor(T** obj, R (__stdcall U::*method)(X1, X2, A1), const P1& p1, + const P2& p2) { + MutantRunner >* t = + new MutantLateObjectBind, Tuple1 > + (obj, method, MakeTuple(p1, p2)); + return MutantFunctor >(t); +} +#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING #endif // OS_WIN // 2 - 2 @@ -1227,6 +1370,19 @@ CreateFunctor(T* obj, R (__stdcall U::*method)(X1, X2, A1, A2), const P1& p1, (obj, method, MakeTuple(p1, p2)); return MutantFunctor >(t); } +#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING +template +inline MutantFunctor > +CreateFunctor(T** obj, R (__stdcall U::*method)(X1, X2, A1, A2), const P1& p1, + const P2& p2) { + MutantRunner >* t = + new MutantLateObjectBind, Tuple2 > + (obj, method, MakeTuple(p1, p2)); + return MutantFunctor >(t); +} +#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING #endif // OS_WIN // 2 - 3 @@ -1279,6 +1435,19 @@ CreateFunctor(T* obj, R (__stdcall U::*method)(X1, X2, A1, A2, A3), (obj, method, MakeTuple(p1, p2)); return MutantFunctor >(t); } +#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING +template +inline MutantFunctor > +CreateFunctor(T** obj, R (__stdcall U::*method)(X1, X2, A1, A2, A3), + const P1& p1, const P2& p2) { + MutantRunner >* t = + new MutantLateObjectBind, Tuple3 > + (obj, method, MakeTuple(p1, p2)); + return MutantFunctor >(t); +} +#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING #endif // OS_WIN // 2 - 4 @@ -1335,6 +1504,20 @@ CreateFunctor(T* obj, R (__stdcall U::*method)(X1, X2, A1, A2, A3, A4), (obj, method, MakeTuple(p1, p2)); return MutantFunctor >(t); } +#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING +template +inline MutantFunctor > +CreateFunctor(T** obj, R (__stdcall U::*method)(X1, X2, A1, A2, A3, A4), + const P1& p1, const P2& p2) { + MutantRunner >* t = + new MutantLateObjectBind, Tuple4 > + (obj, method, MakeTuple(p1, p2)); + return MutantFunctor >(t); +} +#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING #endif // OS_WIN // 3 - 0 @@ -1388,6 +1571,19 @@ CreateFunctor(T* obj, R (__stdcall U::*method)(X1, X2, X3), const P1& p1, (obj, method, MakeTuple(p1, p2, p3)); return MutantFunctor(t); } +#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING +template +inline MutantFunctor +CreateFunctor(T** obj, R (__stdcall U::*method)(X1, X2, X3), const P1& p1, + const P2& p2, const P3& p3) { + MutantRunner* t = + new MutantLateObjectBind, Tuple0> + (obj, method, MakeTuple(p1, p2, p3)); + return MutantFunctor(t); +} +#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING #endif // OS_WIN // 3 - 1 @@ -1441,6 +1637,19 @@ CreateFunctor(T* obj, R (__stdcall U::*method)(X1, X2, X3, A1), const P1& p1, (obj, method, MakeTuple(p1, p2, p3)); return MutantFunctor >(t); } +#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING +template +inline MutantFunctor > +CreateFunctor(T** obj, R (__stdcall U::*method)(X1, X2, X3, A1), const P1& p1, + const P2& p2, const P3& p3) { + MutantRunner >* t = + new MutantLateObjectBind, Tuple1 > + (obj, method, MakeTuple(p1, p2, p3)); + return MutantFunctor >(t); +} +#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING #endif // OS_WIN // 3 - 2 @@ -1497,6 +1706,20 @@ CreateFunctor(T* obj, R (__stdcall U::*method)(X1, X2, X3, A1, A2), (obj, method, MakeTuple(p1, p2, p3)); return MutantFunctor >(t); } +#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING +template +inline MutantFunctor > +CreateFunctor(T** obj, R (__stdcall U::*method)(X1, X2, X3, A1, A2), + const P1& p1, const P2& p2, const P3& p3) { + MutantRunner >* t = + new MutantLateObjectBind, Tuple2 > + (obj, method, MakeTuple(p1, p2, p3)); + return MutantFunctor >(t); +} +#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING #endif // OS_WIN // 3 - 3 @@ -1553,6 +1776,20 @@ CreateFunctor(T* obj, R (__stdcall U::*method)(X1, X2, X3, A1, A2, A3), (obj, method, MakeTuple(p1, p2, p3)); return MutantFunctor >(t); } +#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING +template +inline MutantFunctor > +CreateFunctor(T** obj, R (__stdcall U::*method)(X1, X2, X3, A1, A2, A3), + const P1& p1, const P2& p2, const P3& p3) { + MutantRunner >* t = + new MutantLateObjectBind, Tuple3 > + (obj, method, MakeTuple(p1, p2, p3)); + return MutantFunctor >(t); +} +#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING #endif // OS_WIN // 3 - 4 @@ -1610,6 +1847,20 @@ CreateFunctor(T* obj, R (__stdcall U::*method)(X1, X2, X3, A1, A2, A3, A4), (obj, method, MakeTuple(p1, p2, p3)); return MutantFunctor >(t); } +#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING +template +inline MutantFunctor > +CreateFunctor(T** obj, R (__stdcall U::*method)(X1, X2, X3, A1, A2, A3, A4), + const P1& p1, const P2& p2, const P3& p3) { + MutantRunner >* t = + new MutantLateObjectBind, Tuple4 > + (obj, method, MakeTuple(p1, p2, p3)); + return MutantFunctor >(t); +} +#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING #endif // OS_WIN // 4 - 0 @@ -1666,6 +1917,20 @@ CreateFunctor(T* obj, R (__stdcall U::*method)(X1, X2, X3, X4), const P1& p1, (obj, method, MakeTuple(p1, p2, p3, p4)); return MutantFunctor(t); } +#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING +template +inline MutantFunctor +CreateFunctor(T** obj, R (__stdcall U::*method)(X1, X2, X3, X4), const P1& p1, + const P2& p2, const P3& p3, const P4& p4) { + MutantRunner* t = + new MutantLateObjectBind, Tuple0> + (obj, method, MakeTuple(p1, p2, p3, p4)); + return MutantFunctor(t); +} +#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING #endif // OS_WIN // 4 - 1 @@ -1722,6 +1987,20 @@ CreateFunctor(T* obj, R (__stdcall U::*method)(X1, X2, X3, X4, A1), (obj, method, MakeTuple(p1, p2, p3, p4)); return MutantFunctor >(t); } +#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING +template +inline MutantFunctor > +CreateFunctor(T** obj, R (__stdcall U::*method)(X1, X2, X3, X4, A1), + const P1& p1, const P2& p2, const P3& p3, const P4& p4) { + MutantRunner >* t = + new MutantLateObjectBind, Tuple1 > + (obj, method, MakeTuple(p1, p2, p3, p4)); + return MutantFunctor >(t); +} +#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING #endif // OS_WIN // 4 - 2 @@ -1779,6 +2058,20 @@ CreateFunctor(T* obj, R (__stdcall U::*method)(X1, X2, X3, X4, A1, A2), (obj, method, MakeTuple(p1, p2, p3, p4)); return MutantFunctor >(t); } +#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING +template +inline MutantFunctor > +CreateFunctor(T** obj, R (__stdcall U::*method)(X1, X2, X3, X4, A1, A2), + const P1& p1, const P2& p2, const P3& p3, const P4& p4) { + MutantRunner >* t = + new MutantLateObjectBind, Tuple2 > + (obj, method, MakeTuple(p1, p2, p3, p4)); + return MutantFunctor >(t); +} +#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING #endif // OS_WIN // 4 - 3 @@ -1836,6 +2129,20 @@ CreateFunctor(T* obj, R (__stdcall U::*method)(X1, X2, X3, X4, A1, A2, A3), (obj, method, MakeTuple(p1, p2, p3, p4)); return MutantFunctor >(t); } +#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING +template +inline MutantFunctor > +CreateFunctor(T** obj, R (__stdcall U::*method)(X1, X2, X3, X4, A1, A2, A3), + const P1& p1, const P2& p2, const P3& p3, const P4& p4) { + MutantRunner >* t = + new MutantLateObjectBind, Tuple3 > + (obj, method, MakeTuple(p1, p2, p3, p4)); + return MutantFunctor >(t); +} +#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING #endif // OS_WIN // 4 - 4 @@ -1893,6 +2200,20 @@ CreateFunctor(T* obj, R (__stdcall U::*method)(X1, X2, X3, X4, A1, A2, A3, A4), (obj, method, MakeTuple(p1, p2, p3, p4)); return MutantFunctor >(t); } +#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING +template +inline MutantFunctor > +CreateFunctor(T** obj, R (__stdcall U::*method)(X1, X2, X3, X4, A1, A2, A3, A4), + const P1& p1, const P2& p2, const P3& p3, const P4& p4) { + MutantRunner >* t = + new MutantLateObjectBind, Tuple4 > + (obj, method, MakeTuple(p1, p2, p3, p4)); + return MutantFunctor >(t); +} +#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING #endif // OS_WIN } // namespace testing -- cgit v1.1