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"
49 // There is a bug in MSVC (fixed in VS 2008) that prevents creating a
50 // mock for a function with const arguments, so we don't test such
51 // cases for MSVC versions older than 2008.
52 #if !GTEST_OS_WINDOWS || (_MSC_VER >= 1500)
53 # define GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS
54 #endif // !GTEST_OS_WINDOWS || (_MSC_VER >= 1500)
57 namespace gmock_generated_function_mockers_test {
62 using testing::AnyNumber;
64 using testing::DoDefault;
67 using testing::MockFunction;
69 using testing::Return;
70 using testing::ReturnRef;
71 using testing::TypedEq;
75 virtual ~FooInterface() {}
77 virtual void VoidReturning(int x) = 0;
79 virtual int Nullary() = 0;
80 virtual bool Unary(int x) = 0;
81 virtual long Binary(short x, int y) = 0; // NOLINT
82 virtual int Decimal(bool b, char c, short d, int e, long f, // NOLINT
83 float g, double h, unsigned i, char* j,
84 const std::string& k) = 0;
86 virtual bool TakesNonConstReference(int& n) = 0; // NOLINT
87 virtual std::string TakesConstReference(const int& n) = 0;
88 #ifdef GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS
89 virtual bool TakesConst(const int x) = 0;
90 #endif // GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS
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;
105 STDMETHOD_(int, CTNullary)() = 0;
106 STDMETHOD_(bool, CTUnary)(int x) = 0;
107 STDMETHOD_(int, CTDecimal)
108 (bool b, char c, short d, int e, long f, // NOLINT
109 float g, double h, unsigned i, char* j, const std::string& k) = 0;
110 STDMETHOD_(char, CTConst)(int x) const = 0;
111 #endif // GTEST_OS_WINDOWS
114 // Const qualifiers on arguments were once (incorrectly) considered
115 // significant in determining whether two virtual functions had the same
116 // signature. This was fixed in Visual Studio 2008. However, the compiler
117 // still emits a warning that alerts about this change in behavior.
119 # pragma warning(push)
120 # pragma warning(disable : 4373)
122 class MockFoo : public FooInterface {
126 // Makes sure that a mock function parameter can be named.
127 MOCK_METHOD1(VoidReturning, void(int n)); // NOLINT
129 MOCK_METHOD0(Nullary, int()); // NOLINT
131 // Makes sure that a mock function parameter can be unnamed.
132 MOCK_METHOD1(Unary, bool(int)); // NOLINT
133 MOCK_METHOD2(Binary, long(short, int)); // NOLINT
134 MOCK_METHOD10(Decimal, int(bool, char, short, int, long, float, // NOLINT
135 double, unsigned, char*, const std::string& str));
137 MOCK_METHOD1(TakesNonConstReference, bool(int&)); // NOLINT
138 MOCK_METHOD1(TakesConstReference, std::string(const int&));
140 #ifdef GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS
141 MOCK_METHOD1(TakesConst, bool(const int)); // NOLINT
144 // Tests that the function return type can contain unprotected comma.
145 MOCK_METHOD0(ReturnTypeWithComma, std::map<int, std::string>());
146 MOCK_CONST_METHOD1(ReturnTypeWithComma,
147 std::map<int, std::string>(int)); // NOLINT
149 MOCK_METHOD0(OverloadedOnArgumentNumber, int()); // NOLINT
150 MOCK_METHOD1(OverloadedOnArgumentNumber, int(int)); // NOLINT
152 MOCK_METHOD1(OverloadedOnArgumentType, int(int)); // NOLINT
153 MOCK_METHOD1(OverloadedOnArgumentType, char(char)); // NOLINT
155 MOCK_METHOD0(OverloadedOnConstness, int()); // NOLINT
156 MOCK_CONST_METHOD0(OverloadedOnConstness, char()); // NOLINT
158 MOCK_METHOD1(TypeWithHole, int(int (*)())); // NOLINT
159 MOCK_METHOD1(TypeWithComma,
160 int(const std::map<int, std::string>&)); // NOLINT
163 MOCK_METHOD0_WITH_CALLTYPE(STDMETHODCALLTYPE, CTNullary, int());
164 MOCK_METHOD1_WITH_CALLTYPE(STDMETHODCALLTYPE, CTUnary, bool(int));
165 MOCK_METHOD10_WITH_CALLTYPE(STDMETHODCALLTYPE, CTDecimal,
166 int(bool b, char c, short d, int e, long f,
167 float g, double h, unsigned i, char* j,
168 const std::string& k));
169 MOCK_CONST_METHOD1_WITH_CALLTYPE(STDMETHODCALLTYPE, CTConst, char(int));
171 // Tests that the function return type can contain unprotected comma.
172 MOCK_METHOD0_WITH_CALLTYPE(STDMETHODCALLTYPE, CTReturnTypeWithComma,
173 std::map<int, std::string>());
174 #endif // GTEST_OS_WINDOWS
177 GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFoo);
180 # pragma warning(pop)
183 class FunctionMockerTest : public testing::Test {
185 FunctionMockerTest() : foo_(&mock_foo_) {}
187 FooInterface* const foo_;
191 // Tests mocking a void-returning function.
192 TEST_F(FunctionMockerTest, MocksVoidFunction) {
193 EXPECT_CALL(mock_foo_, VoidReturning(Lt(100)));
194 foo_->VoidReturning(0);
197 // Tests mocking a nullary function.
198 TEST_F(FunctionMockerTest, MocksNullaryFunction) {
199 EXPECT_CALL(mock_foo_, Nullary())
200 .WillOnce(DoDefault())
201 .WillOnce(Return(1));
203 EXPECT_EQ(0, foo_->Nullary());
204 EXPECT_EQ(1, foo_->Nullary());
207 // Tests mocking a unary function.
208 TEST_F(FunctionMockerTest, MocksUnaryFunction) {
209 EXPECT_CALL(mock_foo_, Unary(Eq(2)))
211 .WillOnce(Return(true));
213 EXPECT_TRUE(foo_->Unary(2));
214 EXPECT_FALSE(foo_->Unary(2));
217 // Tests mocking a binary function.
218 TEST_F(FunctionMockerTest, MocksBinaryFunction) {
219 EXPECT_CALL(mock_foo_, Binary(2, _))
220 .WillOnce(Return(3));
222 EXPECT_EQ(3, foo_->Binary(2, 1));
225 // Tests mocking a decimal function.
226 TEST_F(FunctionMockerTest, MocksDecimalFunction) {
227 EXPECT_CALL(mock_foo_, Decimal(true, 'a', 0, 0, 1L, A<float>(),
228 Lt(100), 5U, NULL, "hi"))
229 .WillOnce(Return(5));
231 EXPECT_EQ(5, foo_->Decimal(true, 'a', 0, 0, 1, 0, 0, 5, NULL, "hi"));
234 // Tests mocking a function that takes a non-const reference.
235 TEST_F(FunctionMockerTest, MocksFunctionWithNonConstReferenceArgument) {
237 EXPECT_CALL(mock_foo_, TakesNonConstReference(Ref(a)))
238 .WillOnce(Return(true));
240 EXPECT_TRUE(foo_->TakesNonConstReference(a));
243 // Tests mocking a function that takes a const reference.
244 TEST_F(FunctionMockerTest, MocksFunctionWithConstReferenceArgument) {
246 EXPECT_CALL(mock_foo_, TakesConstReference(Ref(a)))
247 .WillOnce(Return("Hello"));
249 EXPECT_EQ("Hello", foo_->TakesConstReference(a));
252 #ifdef GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS
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));
260 #endif // GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS
262 // Tests mocking functions overloaded on the number of arguments.
263 TEST_F(FunctionMockerTest, MocksFunctionsOverloadedOnArgumentNumber) {
264 EXPECT_CALL(mock_foo_, OverloadedOnArgumentNumber())
265 .WillOnce(Return(1));
266 EXPECT_CALL(mock_foo_, OverloadedOnArgumentNumber(_))
267 .WillOnce(Return(2));
269 EXPECT_EQ(2, foo_->OverloadedOnArgumentNumber(1));
270 EXPECT_EQ(1, foo_->OverloadedOnArgumentNumber());
273 // Tests mocking functions overloaded on the types of argument.
274 TEST_F(FunctionMockerTest, MocksFunctionsOverloadedOnArgumentType) {
275 EXPECT_CALL(mock_foo_, OverloadedOnArgumentType(An<int>()))
276 .WillOnce(Return(1));
277 EXPECT_CALL(mock_foo_, OverloadedOnArgumentType(TypedEq<char>('a')))
278 .WillOnce(Return('b'));
280 EXPECT_EQ(1, foo_->OverloadedOnArgumentType(0));
281 EXPECT_EQ('b', foo_->OverloadedOnArgumentType('a'));
284 // Tests mocking functions overloaded on the const-ness of this object.
285 TEST_F(FunctionMockerTest, MocksFunctionsOverloadedOnConstnessOfThis) {
286 EXPECT_CALL(mock_foo_, OverloadedOnConstness());
287 EXPECT_CALL(Const(mock_foo_), OverloadedOnConstness())
288 .WillOnce(Return('a'));
290 EXPECT_EQ(0, foo_->OverloadedOnConstness());
291 EXPECT_EQ('a', Const(*foo_).OverloadedOnConstness());
294 TEST_F(FunctionMockerTest, MocksReturnTypeWithComma) {
295 const std::map<int, std::string> a_map;
296 EXPECT_CALL(mock_foo_, ReturnTypeWithComma())
297 .WillOnce(Return(a_map));
298 EXPECT_CALL(mock_foo_, ReturnTypeWithComma(42))
299 .WillOnce(Return(a_map));
301 EXPECT_EQ(a_map, mock_foo_.ReturnTypeWithComma());
302 EXPECT_EQ(a_map, mock_foo_.ReturnTypeWithComma(42));
306 // Tests mocking a nullary function with calltype.
307 TEST_F(FunctionMockerTest, MocksNullaryFunctionWithCallType) {
308 EXPECT_CALL(mock_foo_, CTNullary())
309 .WillOnce(Return(-1))
310 .WillOnce(Return(0));
312 EXPECT_EQ(-1, foo_->CTNullary());
313 EXPECT_EQ(0, foo_->CTNullary());
316 // Tests mocking a unary function with calltype.
317 TEST_F(FunctionMockerTest, MocksUnaryFunctionWithCallType) {
318 EXPECT_CALL(mock_foo_, CTUnary(Eq(2)))
320 .WillOnce(Return(true))
321 .WillOnce(Return(false));
323 EXPECT_TRUE(foo_->CTUnary(2));
324 EXPECT_FALSE(foo_->CTUnary(2));
327 // Tests mocking a decimal function with calltype.
328 TEST_F(FunctionMockerTest, MocksDecimalFunctionWithCallType) {
329 EXPECT_CALL(mock_foo_, CTDecimal(true, 'a', 0, 0, 1L, A<float>(),
330 Lt(100), 5U, NULL, "hi"))
331 .WillOnce(Return(10));
333 EXPECT_EQ(10, foo_->CTDecimal(true, 'a', 0, 0, 1, 0, 0, 5, NULL, "hi"));
336 // Tests mocking functions overloaded on the const-ness of this object.
337 TEST_F(FunctionMockerTest, MocksFunctionsConstFunctionWithCallType) {
338 EXPECT_CALL(Const(mock_foo_), CTConst(_))
339 .WillOnce(Return('a'));
341 EXPECT_EQ('a', Const(*foo_).CTConst(0));
344 TEST_F(FunctionMockerTest, MocksReturnTypeWithCommaAndCallType) {
345 const std::map<int, std::string> a_map;
346 EXPECT_CALL(mock_foo_, CTReturnTypeWithComma())
347 .WillOnce(Return(a_map));
349 EXPECT_EQ(a_map, mock_foo_.CTReturnTypeWithComma());
352 #endif // GTEST_OS_WINDOWS
358 MOCK_METHOD0(DoB, void());
361 GTEST_DISALLOW_COPY_AND_ASSIGN_(MockB);
364 // Tests that functions with no EXPECT_CALL() ruls can be called any
366 TEST(ExpectCallTest, UnmentionedFunctionCanBeCalledAnyNumberOfTimes) {
383 // Tests mocking template interfaces.
385 template <typename T>
386 class StackInterface {
388 virtual ~StackInterface() {}
390 // Template parameter appears in function parameter.
391 virtual void Push(const T& value) = 0;
392 virtual void Pop() = 0;
393 virtual int GetSize() const = 0;
394 // Template parameter appears in function return type.
395 virtual const T& GetTop() const = 0;
398 template <typename T>
399 class MockStack : public StackInterface<T> {
403 MOCK_METHOD1_T(Push, void(const T& elem));
404 MOCK_METHOD0_T(Pop, void());
405 MOCK_CONST_METHOD0_T(GetSize, int()); // NOLINT
406 MOCK_CONST_METHOD0_T(GetTop, const T&());
408 // Tests that the function return type can contain unprotected comma.
409 MOCK_METHOD0_T(ReturnTypeWithComma, std::map<int, int>());
410 MOCK_CONST_METHOD1_T(ReturnTypeWithComma, std::map<int, int>(int)); // NOLINT
413 GTEST_DISALLOW_COPY_AND_ASSIGN_(MockStack);
416 // Tests that template mock works.
417 TEST(TemplateMockTest, Works) {
420 EXPECT_CALL(mock, GetSize())
423 .WillOnce(Return(0));
424 EXPECT_CALL(mock, Push(_));
426 EXPECT_CALL(mock, GetTop())
427 .WillOnce(ReturnRef(n));
428 EXPECT_CALL(mock, Pop())
431 EXPECT_EQ(0, mock.GetSize());
433 EXPECT_EQ(1, mock.GetSize());
434 EXPECT_EQ(5, mock.GetTop());
436 EXPECT_EQ(0, mock.GetSize());
439 TEST(TemplateMockTest, MethodWithCommaInReturnTypeWorks) {
442 const std::map<int, int> a_map;
443 EXPECT_CALL(mock, ReturnTypeWithComma())
444 .WillOnce(Return(a_map));
445 EXPECT_CALL(mock, ReturnTypeWithComma(1))
446 .WillOnce(Return(a_map));
448 EXPECT_EQ(a_map, mock.ReturnTypeWithComma());
449 EXPECT_EQ(a_map, mock.ReturnTypeWithComma(1));
453 // Tests mocking template interfaces with calltype.
455 template <typename T>
456 class StackInterfaceWithCallType {
458 virtual ~StackInterfaceWithCallType() {}
460 // Template parameter appears in function parameter.
461 STDMETHOD_(void, Push)(const T& value) = 0;
462 STDMETHOD_(void, Pop)() = 0;
463 STDMETHOD_(int, GetSize)() const = 0;
464 // Template parameter appears in function return type.
465 STDMETHOD_(const T&, GetTop)() const = 0;
468 template <typename T>
469 class MockStackWithCallType : public StackInterfaceWithCallType<T> {
471 MockStackWithCallType() {}
473 MOCK_METHOD1_T_WITH_CALLTYPE(STDMETHODCALLTYPE, Push, void(const T& elem));
474 MOCK_METHOD0_T_WITH_CALLTYPE(STDMETHODCALLTYPE, Pop, void());
475 MOCK_CONST_METHOD0_T_WITH_CALLTYPE(STDMETHODCALLTYPE, GetSize, int());
476 MOCK_CONST_METHOD0_T_WITH_CALLTYPE(STDMETHODCALLTYPE, GetTop, const T&());
479 GTEST_DISALLOW_COPY_AND_ASSIGN_(MockStackWithCallType);
482 // Tests that template mock with calltype works.
483 TEST(TemplateMockTestWithCallType, Works) {
484 MockStackWithCallType<int> mock;
486 EXPECT_CALL(mock, GetSize())
489 .WillOnce(Return(0));
490 EXPECT_CALL(mock, Push(_));
492 EXPECT_CALL(mock, GetTop())
493 .WillOnce(ReturnRef(n));
494 EXPECT_CALL(mock, Pop())
497 EXPECT_EQ(0, mock.GetSize());
499 EXPECT_EQ(1, mock.GetSize());
500 EXPECT_EQ(5, mock.GetTop());
502 EXPECT_EQ(0, mock.GetSize());
504 #endif // GTEST_OS_WINDOWS
506 #define MY_MOCK_METHODS1_ \
507 MOCK_METHOD0(Overloaded, void()); \
508 MOCK_CONST_METHOD1(Overloaded, int(int n)); \
509 MOCK_METHOD2(Overloaded, bool(bool f, int n))
511 class MockOverloadedOnArgNumber {
513 MockOverloadedOnArgNumber() {}
518 GTEST_DISALLOW_COPY_AND_ASSIGN_(MockOverloadedOnArgNumber);
521 TEST(OverloadedMockMethodTest, CanOverloadOnArgNumberInMacroBody) {
522 MockOverloadedOnArgNumber mock;
523 EXPECT_CALL(mock, Overloaded());
524 EXPECT_CALL(mock, Overloaded(1)).WillOnce(Return(2));
525 EXPECT_CALL(mock, Overloaded(true, 1)).WillOnce(Return(true));
528 EXPECT_EQ(2, mock.Overloaded(1));
529 EXPECT_TRUE(mock.Overloaded(true, 1));
532 #define MY_MOCK_METHODS2_ \
533 MOCK_CONST_METHOD1(Overloaded, int(int n)); \
534 MOCK_METHOD1(Overloaded, int(int n));
536 class MockOverloadedOnConstness {
538 MockOverloadedOnConstness() {}
543 GTEST_DISALLOW_COPY_AND_ASSIGN_(MockOverloadedOnConstness);
546 TEST(OverloadedMockMethodTest, CanOverloadOnConstnessInMacroBody) {
547 MockOverloadedOnConstness mock;
548 const MockOverloadedOnConstness* const_mock = &mock;
549 EXPECT_CALL(mock, Overloaded(1)).WillOnce(Return(2));
550 EXPECT_CALL(*const_mock, Overloaded(1)).WillOnce(Return(3));
552 EXPECT_EQ(2, mock.Overloaded(1));
553 EXPECT_EQ(3, const_mock->Overloaded(1));
556 TEST(MockFunctionTest, WorksForVoidNullary) {
557 MockFunction<void()> foo;
558 EXPECT_CALL(foo, Call());
562 TEST(MockFunctionTest, WorksForNonVoidNullary) {
563 MockFunction<int()> foo;
564 EXPECT_CALL(foo, Call())
566 .WillOnce(Return(2));
567 EXPECT_EQ(1, foo.Call());
568 EXPECT_EQ(2, foo.Call());
571 TEST(MockFunctionTest, WorksForVoidUnary) {
572 MockFunction<void(int)> foo;
573 EXPECT_CALL(foo, Call(1));
577 TEST(MockFunctionTest, WorksForNonVoidBinary) {
578 MockFunction<int(bool, int)> foo;
579 EXPECT_CALL(foo, Call(false, 42))
581 .WillOnce(Return(2));
582 EXPECT_CALL(foo, Call(true, Ge(100)))
583 .WillOnce(Return(3));
584 EXPECT_EQ(1, foo.Call(false, 42));
585 EXPECT_EQ(2, foo.Call(false, 42));
586 EXPECT_EQ(3, foo.Call(true, 120));
589 TEST(MockFunctionTest, WorksFor10Arguments) {
590 MockFunction<int(bool a0, char a1, int a2, int a3, int a4,
591 int a5, int a6, char a7, int a8, bool a9)> foo;
592 EXPECT_CALL(foo, Call(_, 'a', _, _, _, _, _, _, _, _))
594 .WillOnce(Return(2));
595 EXPECT_EQ(1, foo.Call(false, 'a', 0, 0, 0, 0, 0, 'b', 0, true));
596 EXPECT_EQ(2, foo.Call(true, 'a', 0, 0, 0, 0, 0, 'b', 1, false));
599 #if GTEST_HAS_STD_FUNCTION_
600 TEST(MockFunctionTest, AsStdFunction) {
601 MockFunction<int(int)> foo;
602 auto call = [](const std::function<int(int)> &f, int i) {
605 EXPECT_CALL(foo, Call(1)).WillOnce(Return(-1));
606 EXPECT_CALL(foo, Call(2)).WillOnce(Return(-2));
607 EXPECT_EQ(-1, call(foo.AsStdFunction(), 1));
608 EXPECT_EQ(-2, call(foo.AsStdFunction(), 2));
611 TEST(MockFunctionTest, AsStdFunctionReturnsReference) {
612 MockFunction<int&()> foo;
614 EXPECT_CALL(foo, Call()).WillOnce(ReturnRef(value));
615 int& ref = foo.AsStdFunction()();
620 #endif // GTEST_HAS_STD_FUNCTION_
622 struct MockMethodSizes0 {
623 MOCK_METHOD0(func, void());
625 struct MockMethodSizes1 {
626 MOCK_METHOD1(func, void(int));
628 struct MockMethodSizes2 {
629 MOCK_METHOD2(func, void(int, int));
631 struct MockMethodSizes3 {
632 MOCK_METHOD3(func, void(int, int, int));
634 struct MockMethodSizes4 {
635 MOCK_METHOD4(func, void(int, int, int, int));
638 TEST(MockFunctionTest, MockMethodSizeOverhead) {
639 EXPECT_EQ(sizeof(MockMethodSizes0), sizeof(MockMethodSizes1));
640 EXPECT_EQ(sizeof(MockMethodSizes0), sizeof(MockMethodSizes2));
641 EXPECT_EQ(sizeof(MockMethodSizes0), sizeof(MockMethodSizes3));
642 EXPECT_EQ(sizeof(MockMethodSizes0), sizeof(MockMethodSizes4));
645 } // namespace gmock_generated_function_mockers_test
646 } // namespace testing