1 // Copyright 2007, Google Inc.
2 // All rights reserved.
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above
11 // copyright notice, this list of conditions and the following disclaimer
12 // in the documentation and/or other materials provided with the
14 // * Neither the name of Google Inc. nor the names of its
15 // contributors may be used to endorse or promote products derived from
16 // this software without specific prior written permission.
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 // Google Mock - a framework for writing C++ mock classes.
33 // This file tests the function mocker classes.
35 #include "gmock/gmock-generated-function-mockers.h"
38 // MSDN says the header file to be included for STDMETHOD is BaseTyps.h but
39 // we are getting compiler errors if we use basetyps.h, hence including
40 // objbase.h for definition of STDMETHOD.
42 #endif // GTEST_OS_WINDOWS
46 #include "gmock/gmock.h"
47 #include "gtest/gtest.h"
50 namespace gmock_generated_function_mockers_test {
55 using testing::AnyNumber;
57 using testing::DoDefault;
60 using testing::MockFunction;
62 using testing::Return;
63 using testing::ReturnRef;
64 using testing::TypedEq;
67 class TemplatedCopyable {
69 TemplatedCopyable() {}
72 TemplatedCopyable(const U& other) {} // NOLINT
77 virtual ~FooInterface() {}
79 virtual void VoidReturning(int x) = 0;
81 virtual int Nullary() = 0;
82 virtual bool Unary(int x) = 0;
83 virtual long Binary(short x, int y) = 0; // NOLINT
84 virtual int Decimal(bool b, char c, short d, int e, long f, // NOLINT
85 float g, double h, unsigned i, char* j,
86 const std::string& k) = 0;
88 virtual bool TakesNonConstReference(int& n) = 0; // NOLINT
89 virtual std::string TakesConstReference(const int& n) = 0;
90 virtual bool TakesConst(const int x) = 0;
92 virtual int OverloadedOnArgumentNumber() = 0;
93 virtual int OverloadedOnArgumentNumber(int n) = 0;
95 virtual int OverloadedOnArgumentType(int n) = 0;
96 virtual char OverloadedOnArgumentType(char c) = 0;
98 virtual int OverloadedOnConstness() = 0;
99 virtual char OverloadedOnConstness() const = 0;
101 virtual int TypeWithHole(int (*func)()) = 0;
102 virtual int TypeWithComma(const std::map<int, std::string>& a_map) = 0;
103 virtual int TypeWithTemplatedCopyCtor(
104 const TemplatedCopyable<int>& a_vector) = 0;
107 STDMETHOD_(int, CTNullary)() = 0;
108 STDMETHOD_(bool, CTUnary)(int x) = 0;
109 STDMETHOD_(int, CTDecimal)
110 (bool b, char c, short d, int e, long f, // NOLINT
111 float g, double h, unsigned i, char* j, const std::string& k) = 0;
112 STDMETHOD_(char, CTConst)(int x) const = 0;
113 #endif // GTEST_OS_WINDOWS
116 // Const qualifiers on arguments were once (incorrectly) considered
117 // significant in determining whether two virtual functions had the same
118 // signature. This was fixed in Visual Studio 2008. However, the compiler
119 // still emits a warning that alerts about this change in behavior.
121 # pragma warning(push)
122 # pragma warning(disable : 4373)
124 class MockFoo : public FooInterface {
128 // Makes sure that a mock function parameter can be named.
129 MOCK_METHOD1(VoidReturning, void(int n)); // NOLINT
131 MOCK_METHOD0(Nullary, int()); // NOLINT
133 // Makes sure that a mock function parameter can be unnamed.
134 MOCK_METHOD1(Unary, bool(int)); // NOLINT
135 MOCK_METHOD2(Binary, long(short, int)); // NOLINT
136 MOCK_METHOD10(Decimal, int(bool, char, short, int, long, float, // NOLINT
137 double, unsigned, char*, const std::string& str));
139 MOCK_METHOD1(TakesNonConstReference, bool(int&)); // NOLINT
140 MOCK_METHOD1(TakesConstReference, std::string(const int&));
141 MOCK_METHOD1(TakesConst, bool(const int)); // NOLINT
143 // Tests that the function return type can contain unprotected comma.
144 MOCK_METHOD0(ReturnTypeWithComma, std::map<int, std::string>());
145 MOCK_CONST_METHOD1(ReturnTypeWithComma,
146 std::map<int, std::string>(int)); // NOLINT
148 MOCK_METHOD0(OverloadedOnArgumentNumber, int()); // NOLINT
149 MOCK_METHOD1(OverloadedOnArgumentNumber, int(int)); // NOLINT
151 MOCK_METHOD1(OverloadedOnArgumentType, int(int)); // NOLINT
152 MOCK_METHOD1(OverloadedOnArgumentType, char(char)); // NOLINT
154 MOCK_METHOD0(OverloadedOnConstness, int()); // NOLINT
155 MOCK_CONST_METHOD0(OverloadedOnConstness, char()); // NOLINT
157 MOCK_METHOD1(TypeWithHole, int(int (*)())); // NOLINT
158 MOCK_METHOD1(TypeWithComma,
159 int(const std::map<int, std::string>&)); // NOLINT
160 MOCK_METHOD1(TypeWithTemplatedCopyCtor,
161 int(const TemplatedCopyable<int>&)); // NOLINT
164 MOCK_METHOD0_WITH_CALLTYPE(STDMETHODCALLTYPE, CTNullary, int());
165 MOCK_METHOD1_WITH_CALLTYPE(STDMETHODCALLTYPE, CTUnary, bool(int));
166 MOCK_METHOD10_WITH_CALLTYPE(STDMETHODCALLTYPE, CTDecimal,
167 int(bool b, char c, short d, int e, long f,
168 float g, double h, unsigned i, char* j,
169 const std::string& k));
170 MOCK_CONST_METHOD1_WITH_CALLTYPE(STDMETHODCALLTYPE, CTConst, char(int));
172 // Tests that the function return type can contain unprotected comma.
173 MOCK_METHOD0_WITH_CALLTYPE(STDMETHODCALLTYPE, CTReturnTypeWithComma,
174 std::map<int, std::string>());
175 #endif // GTEST_OS_WINDOWS
178 GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFoo);
181 # pragma warning(pop)
184 class FunctionMockerTest : public testing::Test {
186 FunctionMockerTest() : foo_(&mock_foo_) {}
188 FooInterface* const foo_;
192 // Tests mocking a void-returning function.
193 TEST_F(FunctionMockerTest, MocksVoidFunction) {
194 EXPECT_CALL(mock_foo_, VoidReturning(Lt(100)));
195 foo_->VoidReturning(0);
198 // Tests mocking a nullary function.
199 TEST_F(FunctionMockerTest, MocksNullaryFunction) {
200 EXPECT_CALL(mock_foo_, Nullary())
201 .WillOnce(DoDefault())
202 .WillOnce(Return(1));
204 EXPECT_EQ(0, foo_->Nullary());
205 EXPECT_EQ(1, foo_->Nullary());
208 // Tests mocking a unary function.
209 TEST_F(FunctionMockerTest, MocksUnaryFunction) {
210 EXPECT_CALL(mock_foo_, Unary(Eq(2)))
212 .WillOnce(Return(true));
214 EXPECT_TRUE(foo_->Unary(2));
215 EXPECT_FALSE(foo_->Unary(2));
218 // Tests mocking a binary function.
219 TEST_F(FunctionMockerTest, MocksBinaryFunction) {
220 EXPECT_CALL(mock_foo_, Binary(2, _))
221 .WillOnce(Return(3));
223 EXPECT_EQ(3, foo_->Binary(2, 1));
226 // Tests mocking a decimal function.
227 TEST_F(FunctionMockerTest, MocksDecimalFunction) {
228 EXPECT_CALL(mock_foo_, Decimal(true, 'a', 0, 0, 1L, A<float>(), Lt(100), 5U,
230 .WillOnce(Return(5));
232 EXPECT_EQ(5, foo_->Decimal(true, 'a', 0, 0, 1, 0, 0, 5, nullptr, "hi"));
235 // Tests mocking a function that takes a non-const reference.
236 TEST_F(FunctionMockerTest, MocksFunctionWithNonConstReferenceArgument) {
238 EXPECT_CALL(mock_foo_, TakesNonConstReference(Ref(a)))
239 .WillOnce(Return(true));
241 EXPECT_TRUE(foo_->TakesNonConstReference(a));
244 // Tests mocking a function that takes a const reference.
245 TEST_F(FunctionMockerTest, MocksFunctionWithConstReferenceArgument) {
247 EXPECT_CALL(mock_foo_, TakesConstReference(Ref(a)))
248 .WillOnce(Return("Hello"));
250 EXPECT_EQ("Hello", foo_->TakesConstReference(a));
253 // Tests mocking a function that takes a const variable.
254 TEST_F(FunctionMockerTest, MocksFunctionWithConstArgument) {
255 EXPECT_CALL(mock_foo_, TakesConst(Lt(10)))
256 .WillOnce(DoDefault());
258 EXPECT_FALSE(foo_->TakesConst(5));
261 // Tests mocking functions overloaded on the number of arguments.
262 TEST_F(FunctionMockerTest, MocksFunctionsOverloadedOnArgumentNumber) {
263 EXPECT_CALL(mock_foo_, OverloadedOnArgumentNumber())
264 .WillOnce(Return(1));
265 EXPECT_CALL(mock_foo_, OverloadedOnArgumentNumber(_))
266 .WillOnce(Return(2));
268 EXPECT_EQ(2, foo_->OverloadedOnArgumentNumber(1));
269 EXPECT_EQ(1, foo_->OverloadedOnArgumentNumber());
272 // Tests mocking functions overloaded on the types of argument.
273 TEST_F(FunctionMockerTest, MocksFunctionsOverloadedOnArgumentType) {
274 EXPECT_CALL(mock_foo_, OverloadedOnArgumentType(An<int>()))
275 .WillOnce(Return(1));
276 EXPECT_CALL(mock_foo_, OverloadedOnArgumentType(TypedEq<char>('a')))
277 .WillOnce(Return('b'));
279 EXPECT_EQ(1, foo_->OverloadedOnArgumentType(0));
280 EXPECT_EQ('b', foo_->OverloadedOnArgumentType('a'));
283 // Tests mocking functions overloaded on the const-ness of this object.
284 TEST_F(FunctionMockerTest, MocksFunctionsOverloadedOnConstnessOfThis) {
285 EXPECT_CALL(mock_foo_, OverloadedOnConstness());
286 EXPECT_CALL(Const(mock_foo_), OverloadedOnConstness())
287 .WillOnce(Return('a'));
289 EXPECT_EQ(0, foo_->OverloadedOnConstness());
290 EXPECT_EQ('a', Const(*foo_).OverloadedOnConstness());
293 TEST_F(FunctionMockerTest, MocksReturnTypeWithComma) {
294 const std::map<int, std::string> a_map;
295 EXPECT_CALL(mock_foo_, ReturnTypeWithComma())
296 .WillOnce(Return(a_map));
297 EXPECT_CALL(mock_foo_, ReturnTypeWithComma(42))
298 .WillOnce(Return(a_map));
300 EXPECT_EQ(a_map, mock_foo_.ReturnTypeWithComma());
301 EXPECT_EQ(a_map, mock_foo_.ReturnTypeWithComma(42));
304 TEST_F(FunctionMockerTest, MocksTypeWithTemplatedCopyCtor) {
305 EXPECT_CALL(mock_foo_, TypeWithTemplatedCopyCtor(_)).WillOnce(Return(true));
306 EXPECT_TRUE(foo_->TypeWithTemplatedCopyCtor(TemplatedCopyable<int>()));
310 // Tests mocking a nullary function with calltype.
311 TEST_F(FunctionMockerTest, MocksNullaryFunctionWithCallType) {
312 EXPECT_CALL(mock_foo_, CTNullary())
313 .WillOnce(Return(-1))
314 .WillOnce(Return(0));
316 EXPECT_EQ(-1, foo_->CTNullary());
317 EXPECT_EQ(0, foo_->CTNullary());
320 // Tests mocking a unary function with calltype.
321 TEST_F(FunctionMockerTest, MocksUnaryFunctionWithCallType) {
322 EXPECT_CALL(mock_foo_, CTUnary(Eq(2)))
324 .WillOnce(Return(true))
325 .WillOnce(Return(false));
327 EXPECT_TRUE(foo_->CTUnary(2));
328 EXPECT_FALSE(foo_->CTUnary(2));
331 // Tests mocking a decimal function with calltype.
332 TEST_F(FunctionMockerTest, MocksDecimalFunctionWithCallType) {
333 EXPECT_CALL(mock_foo_, CTDecimal(true, 'a', 0, 0, 1L, A<float>(), Lt(100), 5U,
335 .WillOnce(Return(10));
337 EXPECT_EQ(10, foo_->CTDecimal(true, 'a', 0, 0, 1, 0, 0, 5, nullptr, "hi"));
340 // Tests mocking functions overloaded on the const-ness of this object.
341 TEST_F(FunctionMockerTest, MocksFunctionsConstFunctionWithCallType) {
342 EXPECT_CALL(Const(mock_foo_), CTConst(_))
343 .WillOnce(Return('a'));
345 EXPECT_EQ('a', Const(*foo_).CTConst(0));
348 TEST_F(FunctionMockerTest, MocksReturnTypeWithCommaAndCallType) {
349 const std::map<int, std::string> a_map;
350 EXPECT_CALL(mock_foo_, CTReturnTypeWithComma())
351 .WillOnce(Return(a_map));
353 EXPECT_EQ(a_map, mock_foo_.CTReturnTypeWithComma());
356 #endif // GTEST_OS_WINDOWS
362 MOCK_METHOD0(DoB, void());
365 GTEST_DISALLOW_COPY_AND_ASSIGN_(MockB);
368 // Tests that functions with no EXPECT_CALL() ruls can be called any
370 TEST(ExpectCallTest, UnmentionedFunctionCanBeCalledAnyNumberOfTimes) {
387 // Tests mocking template interfaces.
389 template <typename T>
390 class StackInterface {
392 virtual ~StackInterface() {}
394 // Template parameter appears in function parameter.
395 virtual void Push(const T& value) = 0;
396 virtual void Pop() = 0;
397 virtual int GetSize() const = 0;
398 // Template parameter appears in function return type.
399 virtual const T& GetTop() const = 0;
402 template <typename T>
403 class MockStack : public StackInterface<T> {
407 MOCK_METHOD1_T(Push, void(const T& elem));
408 MOCK_METHOD0_T(Pop, void());
409 MOCK_CONST_METHOD0_T(GetSize, int()); // NOLINT
410 MOCK_CONST_METHOD0_T(GetTop, const T&());
412 // Tests that the function return type can contain unprotected comma.
413 MOCK_METHOD0_T(ReturnTypeWithComma, std::map<int, int>());
414 MOCK_CONST_METHOD1_T(ReturnTypeWithComma, std::map<int, int>(int)); // NOLINT
417 GTEST_DISALLOW_COPY_AND_ASSIGN_(MockStack);
420 // Tests that template mock works.
421 TEST(TemplateMockTest, Works) {
424 EXPECT_CALL(mock, GetSize())
427 .WillOnce(Return(0));
428 EXPECT_CALL(mock, Push(_));
430 EXPECT_CALL(mock, GetTop())
431 .WillOnce(ReturnRef(n));
432 EXPECT_CALL(mock, Pop())
435 EXPECT_EQ(0, mock.GetSize());
437 EXPECT_EQ(1, mock.GetSize());
438 EXPECT_EQ(5, mock.GetTop());
440 EXPECT_EQ(0, mock.GetSize());
443 TEST(TemplateMockTest, MethodWithCommaInReturnTypeWorks) {
446 const std::map<int, int> a_map;
447 EXPECT_CALL(mock, ReturnTypeWithComma())
448 .WillOnce(Return(a_map));
449 EXPECT_CALL(mock, ReturnTypeWithComma(1))
450 .WillOnce(Return(a_map));
452 EXPECT_EQ(a_map, mock.ReturnTypeWithComma());
453 EXPECT_EQ(a_map, mock.ReturnTypeWithComma(1));
457 // Tests mocking template interfaces with calltype.
459 template <typename T>
460 class StackInterfaceWithCallType {
462 virtual ~StackInterfaceWithCallType() {}
464 // Template parameter appears in function parameter.
465 STDMETHOD_(void, Push)(const T& value) = 0;
466 STDMETHOD_(void, Pop)() = 0;
467 STDMETHOD_(int, GetSize)() const = 0;
468 // Template parameter appears in function return type.
469 STDMETHOD_(const T&, GetTop)() const = 0;
472 template <typename T>
473 class MockStackWithCallType : public StackInterfaceWithCallType<T> {
475 MockStackWithCallType() {}
477 MOCK_METHOD1_T_WITH_CALLTYPE(STDMETHODCALLTYPE, Push, void(const T& elem));
478 MOCK_METHOD0_T_WITH_CALLTYPE(STDMETHODCALLTYPE, Pop, void());
479 MOCK_CONST_METHOD0_T_WITH_CALLTYPE(STDMETHODCALLTYPE, GetSize, int());
480 MOCK_CONST_METHOD0_T_WITH_CALLTYPE(STDMETHODCALLTYPE, GetTop, const T&());
483 GTEST_DISALLOW_COPY_AND_ASSIGN_(MockStackWithCallType);
486 // Tests that template mock with calltype works.
487 TEST(TemplateMockTestWithCallType, Works) {
488 MockStackWithCallType<int> mock;
490 EXPECT_CALL(mock, GetSize())
493 .WillOnce(Return(0));
494 EXPECT_CALL(mock, Push(_));
496 EXPECT_CALL(mock, GetTop())
497 .WillOnce(ReturnRef(n));
498 EXPECT_CALL(mock, Pop())
501 EXPECT_EQ(0, mock.GetSize());
503 EXPECT_EQ(1, mock.GetSize());
504 EXPECT_EQ(5, mock.GetTop());
506 EXPECT_EQ(0, mock.GetSize());
508 #endif // GTEST_OS_WINDOWS
510 #define MY_MOCK_METHODS1_ \
511 MOCK_METHOD0(Overloaded, void()); \
512 MOCK_CONST_METHOD1(Overloaded, int(int n)); \
513 MOCK_METHOD2(Overloaded, bool(bool f, int n))
515 class MockOverloadedOnArgNumber {
517 MockOverloadedOnArgNumber() {}
522 GTEST_DISALLOW_COPY_AND_ASSIGN_(MockOverloadedOnArgNumber);
525 TEST(OverloadedMockMethodTest, CanOverloadOnArgNumberInMacroBody) {
526 MockOverloadedOnArgNumber mock;
527 EXPECT_CALL(mock, Overloaded());
528 EXPECT_CALL(mock, Overloaded(1)).WillOnce(Return(2));
529 EXPECT_CALL(mock, Overloaded(true, 1)).WillOnce(Return(true));
532 EXPECT_EQ(2, mock.Overloaded(1));
533 EXPECT_TRUE(mock.Overloaded(true, 1));
536 #define MY_MOCK_METHODS2_ \
537 MOCK_CONST_METHOD1(Overloaded, int(int n)); \
538 MOCK_METHOD1(Overloaded, int(int n))
540 class MockOverloadedOnConstness {
542 MockOverloadedOnConstness() {}
547 GTEST_DISALLOW_COPY_AND_ASSIGN_(MockOverloadedOnConstness);
550 TEST(OverloadedMockMethodTest, CanOverloadOnConstnessInMacroBody) {
551 MockOverloadedOnConstness mock;
552 const MockOverloadedOnConstness* const_mock = &mock;
553 EXPECT_CALL(mock, Overloaded(1)).WillOnce(Return(2));
554 EXPECT_CALL(*const_mock, Overloaded(1)).WillOnce(Return(3));
556 EXPECT_EQ(2, mock.Overloaded(1));
557 EXPECT_EQ(3, const_mock->Overloaded(1));
560 TEST(MockFunctionTest, WorksForVoidNullary) {
561 MockFunction<void()> foo;
562 EXPECT_CALL(foo, Call());
566 TEST(MockFunctionTest, WorksForNonVoidNullary) {
567 MockFunction<int()> foo;
568 EXPECT_CALL(foo, Call())
570 .WillOnce(Return(2));
571 EXPECT_EQ(1, foo.Call());
572 EXPECT_EQ(2, foo.Call());
575 TEST(MockFunctionTest, WorksForVoidUnary) {
576 MockFunction<void(int)> foo;
577 EXPECT_CALL(foo, Call(1));
581 TEST(MockFunctionTest, WorksForNonVoidBinary) {
582 MockFunction<int(bool, int)> foo;
583 EXPECT_CALL(foo, Call(false, 42))
585 .WillOnce(Return(2));
586 EXPECT_CALL(foo, Call(true, Ge(100)))
587 .WillOnce(Return(3));
588 EXPECT_EQ(1, foo.Call(false, 42));
589 EXPECT_EQ(2, foo.Call(false, 42));
590 EXPECT_EQ(3, foo.Call(true, 120));
593 TEST(MockFunctionTest, WorksFor10Arguments) {
594 MockFunction<int(bool a0, char a1, int a2, int a3, int a4,
595 int a5, int a6, char a7, int a8, bool a9)> foo;
596 EXPECT_CALL(foo, Call(_, 'a', _, _, _, _, _, _, _, _))
598 .WillOnce(Return(2));
599 EXPECT_EQ(1, foo.Call(false, 'a', 0, 0, 0, 0, 0, 'b', 0, true));
600 EXPECT_EQ(2, foo.Call(true, 'a', 0, 0, 0, 0, 0, 'b', 1, false));
603 TEST(MockFunctionTest, AsStdFunction) {
604 MockFunction<int(int)> foo;
605 auto call = [](const std::function<int(int)> &f, int i) {
608 EXPECT_CALL(foo, Call(1)).WillOnce(Return(-1));
609 EXPECT_CALL(foo, Call(2)).WillOnce(Return(-2));
610 EXPECT_EQ(-1, call(foo.AsStdFunction(), 1));
611 EXPECT_EQ(-2, call(foo.AsStdFunction(), 2));
614 TEST(MockFunctionTest, AsStdFunctionReturnsReference) {
615 MockFunction<int&()> foo;
617 EXPECT_CALL(foo, Call()).WillOnce(ReturnRef(value));
618 int& ref = foo.AsStdFunction()();
624 TEST(MockFunctionTest, AsStdFunctionWithReferenceParameter) {
625 MockFunction<int(int &)> foo;
626 auto call = [](const std::function<int(int& )> &f, int &i) {
630 EXPECT_CALL(foo, Call(i)).WillOnce(Return(-1));
631 EXPECT_EQ(-1, call(foo.AsStdFunction(), i));
635 struct MockMethodSizes0 {
636 MOCK_METHOD0(func, void());
638 struct MockMethodSizes1 {
639 MOCK_METHOD1(func, void(int));
641 struct MockMethodSizes2 {
642 MOCK_METHOD2(func, void(int, int));
644 struct MockMethodSizes3 {
645 MOCK_METHOD3(func, void(int, int, int));
647 struct MockMethodSizes4 {
648 MOCK_METHOD4(func, void(int, int, int, int));
651 TEST(MockFunctionTest, MockMethodSizeOverhead) {
652 EXPECT_EQ(sizeof(MockMethodSizes0), sizeof(MockMethodSizes1));
653 EXPECT_EQ(sizeof(MockMethodSizes0), sizeof(MockMethodSizes2));
654 EXPECT_EQ(sizeof(MockMethodSizes0), sizeof(MockMethodSizes3));
655 EXPECT_EQ(sizeof(MockMethodSizes0), sizeof(MockMethodSizes4));
658 } // namespace gmock_generated_function_mockers_test
659 } // namespace testing