aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/generator/cpp/gmock_class_test.py
diff options
context:
space:
mode:
authorkosak <kosak@google.com>2014-11-17 02:42:33 +0000
committerkosak <kosak@google.com>2014-11-17 02:42:33 +0000
commitf58b49a2b14f9903d3118ffdd1485cbbe7a230d7 (patch)
tree300198d564b4e3daf6b611f3fb6643466b401c8d /scripts/generator/cpp/gmock_class_test.py
parent6e87b780d34837f221f410a66c5b55d5bb76e45d (diff)
downloadgoogletest-f58b49a2b14f9903d3118ffdd1485cbbe7a230d7.tar.gz
googletest-f58b49a2b14f9903d3118ffdd1485cbbe7a230d7.tar.bz2
googletest-f58b49a2b14f9903d3118ffdd1485cbbe7a230d7.zip
Handle parameters without variable names when the type includes *, & or [].
Diffstat (limited to 'scripts/generator/cpp/gmock_class_test.py')
-rwxr-xr-xscripts/generator/cpp/gmock_class_test.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/scripts/generator/cpp/gmock_class_test.py b/scripts/generator/cpp/gmock_class_test.py
index 361dad7f..ae3739af 100755
--- a/scripts/generator/cpp/gmock_class_test.py
+++ b/scripts/generator/cpp/gmock_class_test.py
@@ -219,6 +219,36 @@ class Foo {
'MOCK_METHOD0_T(Bar,\nint());',
self.GenerateMethodSource(source))
+ def testPointerArgWithoutNames(self):
+ source = """
+class Foo {
+ virtual int Bar(C*);
+};
+"""
+ self.assertEqualIgnoreLeadingWhitespace(
+ 'MOCK_METHOD1(Bar,\nint(C*));',
+ self.GenerateMethodSource(source))
+
+ def testReferenceArgWithoutNames(self):
+ source = """
+class Foo {
+ virtual int Bar(C&);
+};
+"""
+ self.assertEqualIgnoreLeadingWhitespace(
+ 'MOCK_METHOD1(Bar,\nint(C&));',
+ self.GenerateMethodSource(source))
+
+ def testArrayArgWithoutNames(self):
+ source = """
+class Foo {
+ virtual int Bar(C[]);
+};
+"""
+ self.assertEqualIgnoreLeadingWhitespace(
+ 'MOCK_METHOD1(Bar,\nint(C[]));',
+ self.GenerateMethodSource(source))
+
class GenerateMocksTest(TestCase):