+ 'MOCK_METHOD(void, Bar, '
+ '(int a, char c, const int* const p, const std::string& s, char tab[], int const *& rp), '
+ '(override));', self.GenerateMethodSource(source))
+
+ def testMultipleSingleLineDefaultParameters(self):
+ source = """
+class Foo {
+ public:
+ virtual void Bar(int a = 42, int b = 43, int c = 44) = 0;
+};
+"""
+ self.assertEqualIgnoreLeadingWhitespace(
+ 'MOCK_METHOD(void, Bar, (int a, int b, int c), (override));',
+ self.GenerateMethodSource(source))
+
+ def testConstDefaultParameter(self):
+ source = """
+class Test {
+ public:
+ virtual bool Bar(const int test_arg = 42) = 0;
+};
+"""
+ self.assertEqualIgnoreLeadingWhitespace(
+ 'MOCK_METHOD(bool, Bar, (const int test_arg), (override));',
+ self.GenerateMethodSource(source))
+
+ def testConstRefDefaultParameter(self):
+ source = """
+class Test {
+ public:
+ virtual bool Bar(const std::string& test_arg = "42" ) = 0;
+};
+"""
+ self.assertEqualIgnoreLeadingWhitespace(
+ 'MOCK_METHOD(bool, Bar, (const std::string& test_arg), (override));',