summaryrefslogtreecommitdiffstats
path: root/testing/generate_gmock_mutant.py
diff options
context:
space:
mode:
authorstoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-20 16:36:13 +0000
committerstoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-20 16:36:13 +0000
commit45a19e98e7bdd706c80c29ed8e0785cfa0695a72 (patch)
tree7c9447451b4a8468676103241c39490fe0cd0a1e /testing/generate_gmock_mutant.py
parent6f3c1879effff03d909725f1fc61ad70276e9309 (diff)
downloadchromium_src-45a19e98e7bdd706c80c29ed8e0785cfa0695a72.zip
chromium_src-45a19e98e7bdd706c80c29ed8e0785cfa0695a72.tar.gz
chromium_src-45a19e98e7bdd706c80c29ed8e0785cfa0695a72.tar.bz2
Functor for functions with STDCALL calling conventions. Allows invoking Windows API.
Review URL: http://codereview.chromium.org/402086 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32613 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'testing/generate_gmock_mutant.py')
-rw-r--r--testing/generate_gmock_mutant.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/testing/generate_gmock_mutant.py b/testing/generate_gmock_mutant.py
index 8e1fdf0..14ca190 100644
--- a/testing/generate_gmock_mutant.py
+++ b/testing/generate_gmock_mutant.py
@@ -415,13 +415,21 @@ def GenerateCreateFunctor(prebound, calltime):
print mutant2
print "#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING\n"
+ # OS_WIN specific. Same functors but with stdcall calling conventions.
# Functor for method with __stdcall calling conventions.
print "#if defined (OS_WIN)"
- stdcall = CREATE_METHOD_FUNCTOR_TEMPLATE.replace("U::", "__stdcall U::")
- stdcall = FixCode(stdcall % args)
- print stdcall
+ stdcall_method = CREATE_METHOD_FUNCTOR_TEMPLATE
+ stdcall_method = stdcall_method.replace("U::", "__stdcall U::")
+ stdcall_method = FixCode(stdcall_method % args)
+ print stdcall_method
+ # Functor for free function with __stdcall calling conventions.
+ stdcall_function = CREATE_FUNCTION_FUNCTOR_TEMPLATE
+ stdcall_function = stdcall_function.replace("R (*", "R (__stdcall *");
+ print "\n", FixCode(stdcall_function % args)
+
print "#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING"
- stdcall2 = stdcall.replace("CreateFunctor(T* obj,", "CreateFunctor(T** obj,")
+ stdcall2 = stdcall_method;
+ stdcall2 = stdcall2.replace("CreateFunctor(T* obj,", "CreateFunctor(T** obj,")
stdcall2 = stdcall2.replace("new Mutant", "new MutantLateObjectBind")
stdcall2 = stdcall2.replace(" " * 17 + "Tuple", " " * 31 + "Tuple")
print stdcall2