| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import string | 6 import string |
| 7 import sys | 7 import sys |
| 8 | 8 |
| 9 HEADER = """\ | 9 HEADER = """\ |
| 10 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 10 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 11 // Use of this source code is governed by a BSD-style license that can be | 11 // Use of this source code is governed by a BSD-style license that can be |
| 12 // found in the LICENSE file. | 12 // found in the LICENSE file. |
| 13 | 13 |
| 14 // This file automatically generated by testing/generate_gmock_mutant.py. | 14 // This file automatically generated by testing/generate_gmock_mutant.py. |
| 15 // DO NOT EDIT. | 15 // DO NOT EDIT. |
| 16 | 16 |
| 17 #ifndef TESTING_GMOCK_MUTANT_H_ | 17 #ifndef TESTING_GMOCK_MUTANT_H_ |
| 18 #define TESTING_GMOCK_MUTANT_H_ | 18 #define TESTING_GMOCK_MUTANT_H_ |
| 19 | 19 |
| 20 // The intention of this file is to make possible using GMock actions in | 20 // The intention of this file is to make possible using GMock actions in |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 | 410 |
| 411 # Functor with pointer to a pointer of the object. | 411 # Functor with pointer to a pointer of the object. |
| 412 print "\n#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING" | 412 print "\n#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING" |
| 413 mutant2 = mutant.replace("CreateFunctor(T* obj,", "CreateFunctor(T** obj,") | 413 mutant2 = mutant.replace("CreateFunctor(T* obj,", "CreateFunctor(T** obj,") |
| 414 mutant2 = mutant2.replace("new Mutant", "new MutantLateObjectBind") | 414 mutant2 = mutant2.replace("new Mutant", "new MutantLateObjectBind") |
| 415 mutant2 = mutant2.replace(" " * 17 + "Tuple", " " * 31 + "Tuple") | 415 mutant2 = mutant2.replace(" " * 17 + "Tuple", " " * 31 + "Tuple") |
| 416 print mutant2 | 416 print mutant2 |
| 417 print "#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING\n" | 417 print "#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING\n" |
| 418 | 418 |
| 419 # OS_WIN specific. Same functors but with stdcall calling conventions. | 419 # OS_WIN specific. Same functors but with stdcall calling conventions. |
| 420 # These are not for WIN64 (x86_64) because there is only one calling |
| 421 # convention in WIN64. |
| 420 # Functor for method with __stdcall calling conventions. | 422 # Functor for method with __stdcall calling conventions. |
| 421 print "#if defined (OS_WIN)" | 423 print "#if defined (OS_WIN) && !defined (ARCH_CPU_X86_64)" |
| 422 stdcall_method = CREATE_METHOD_FUNCTOR_TEMPLATE | 424 stdcall_method = CREATE_METHOD_FUNCTOR_TEMPLATE |
| 423 stdcall_method = stdcall_method.replace("U::", "__stdcall U::") | 425 stdcall_method = stdcall_method.replace("U::", "__stdcall U::") |
| 424 stdcall_method = FixCode(stdcall_method % args) | 426 stdcall_method = FixCode(stdcall_method % args) |
| 425 print stdcall_method | 427 print stdcall_method |
| 426 # Functor for free function with __stdcall calling conventions. | 428 # Functor for free function with __stdcall calling conventions. |
| 427 stdcall_function = CREATE_FUNCTION_FUNCTOR_TEMPLATE | 429 stdcall_function = CREATE_FUNCTION_FUNCTOR_TEMPLATE |
| 428 stdcall_function = stdcall_function.replace("R (*", "R (__stdcall *") | 430 stdcall_function = stdcall_function.replace("R (*", "R (__stdcall *") |
| 429 print "\n", FixCode(stdcall_function % args) | 431 print "\n", FixCode(stdcall_function % args) |
| 430 | 432 |
| 431 print "#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING" | 433 print "#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING" |
| 432 stdcall2 = stdcall_method | 434 stdcall2 = stdcall_method |
| 433 stdcall2 = stdcall2.replace("CreateFunctor(T* obj,", "CreateFunctor(T** obj,") | 435 stdcall2 = stdcall2.replace("CreateFunctor(T* obj,", "CreateFunctor(T** obj,") |
| 434 stdcall2 = stdcall2.replace("new Mutant", "new MutantLateObjectBind") | 436 stdcall2 = stdcall2.replace("new Mutant", "new MutantLateObjectBind") |
| 435 stdcall2 = stdcall2.replace(" " * 17 + "Tuple", " " * 31 + "Tuple") | 437 stdcall2 = stdcall2.replace(" " * 17 + "Tuple", " " * 31 + "Tuple") |
| 436 print stdcall2 | 438 print stdcall2 |
| 437 print "#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING" | 439 print "#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING" |
| 438 print "#endif // OS_WIN\n" | 440 print "#endif // defined (OS_WIN) && !defined (ARCH_CPU_X86_64)\n" |
| 439 | 441 |
| 440 | 442 |
| 441 def main(): | 443 def main(): |
| 442 print HEADER | 444 print HEADER |
| 443 for prebound in xrange(0, 6 + 1): | 445 for prebound in xrange(0, 6 + 1): |
| 444 for args in xrange(0, 6 + 1): | 446 for args in xrange(0, 6 + 1): |
| 445 GenerateDispatch(prebound, args) | 447 GenerateDispatch(prebound, args) |
| 446 print MUTANT | 448 print MUTANT |
| 447 for prebound in xrange(0, 6 + 1): | 449 for prebound in xrange(0, 6 + 1): |
| 448 for args in xrange(0, 6 + 1): | 450 for args in xrange(0, 6 + 1): |
| 449 GenerateCreateFunctor(prebound, args) | 451 GenerateCreateFunctor(prebound, args) |
| 450 print FOOTER | 452 print FOOTER |
| 451 return 0 | 453 return 0 |
| 452 | 454 |
| 453 | 455 |
| 454 if __name__ == "__main__": | 456 if __name__ == "__main__": |
| 455 sys.exit(main()) | 457 sys.exit(main()) |
| OLD | NEW |