Lines Matching defs:mock

30 // Google Mock - a framework for writing C++ mock classes.
68 // This line verifies that a mock method can take a by-reference
77 // Even though this mock class contains a mock method that takes
79 // use the mock, as long as Google Mock knows how to print the
86 // be visible where the mock is used.
138 // redefining a mock method name. This could happen, for example, when
643 EXPECT_PRED_FORMAT2(IsSubstring, "Uninteresting mock function call",
652 "Uninteresting mock function call");
663 EXPECT_PRED_FORMAT2(IsSubstring, "Uninteresting mock function call",
673 EXPECT_PRED_FORMAT2(IsSubstring, "Uninteresting mock function call",
809 // It should be possible to return a non-moveable type from a mock action in
839 MockFunction<Result()> mock;
840 EXPECT_CALL(mock, Call) //
844 EXPECT_EQ(17, mock.AsStdFunction()().x);
845 EXPECT_EQ(17, mock.AsStdFunction()().x);
846 EXPECT_EQ(17, mock.AsStdFunction()().x);
961 "Unexpected mock function call");
969 EXPECT_NONFATAL_FAILURE(n = b.DoB(1), "Unexpected mock function call");
985 "Unexpected mock function call - returning directly.\n"
1002 "Unexpected mock function call - returning directly.\n"
1030 "Unexpected mock function call - returning default value.\n"
1205 "Unexpected mock function call");
1230 "Unexpected mock function call");
1250 "Unexpected mock function call");
1296 EXPECT_NONFATAL_FAILURE(a.ReturnResult(3), "Unexpected mock function call");
1313 EXPECT_NONFATAL_FAILURE(a.ReturnResult(2), "Unexpected mock function call");
1346 EXPECT_NONFATAL_FAILURE(a_.ReturnResult(2), "Unexpected mock function call");
1354 EXPECT_NONFATAL_FAILURE(a_.ReturnResult(2), "Unexpected mock function call");
1364 EXPECT_NONFATAL_FAILURE(a_.ReturnResult(3), "Unexpected mock function call");
1379 EXPECT_NONFATAL_FAILURE(a_.ReturnResult(2), "Unexpected mock function call");
1576 EXPECT_NONFATAL_FAILURE(a.DoA(2), "Unexpected mock function call");
1597 EXPECT_NONFATAL_FAILURE(a.DoA(2), "Unexpected mock function call");
1616 EXPECT_NONFATAL_FAILURE(a.ReturnResult(3), "Unexpected mock function call");
1637 EXPECT_NONFATAL_FAILURE(a.DoA(3), "Unexpected mock function call");
1654 EXPECT_NONFATAL_FAILURE(a.DoA(3), "Unexpected mock function call");
1710 EXPECT_NONFATAL_FAILURE(a.ReturnResult(3), "Unexpected mock function call");
1730 // Tests that Google Mock correctly handles calls to mock functions
1731 // after a mock object owning one of their pre-requisites has died.
1778 // Tests that it's OK to delete a mock object itself in its action.
1819 EXPECT_NONFATAL_FAILURE({ b2->DoB(2); }, "Unexpected mock function call");
1839 EXPECT_NONFATAL_FAILURE(a->Binary(0, 1), "Unexpected mock function call");
1840 EXPECT_NONFATAL_FAILURE(b2->DoB(1), "Unexpected mock function call");
1878 EXPECT_NONFATAL_FAILURE(a->DoA(2), "Unexpected mock function call");
1882 // The following tests verify the message generated when a mock
1928 // Tests that an uninteresting mock function call on a naggy mock
1942 // Tests that an uninteresting mock function call on a naggy mock
1960 // Verifies that a void mock function's name appears in the stack
1964 // Verifies that a non-void mock function's name appears in the
1974 // Tests that an uninteresting mock function call on a naggy mock
1978 // A non-void mock function.
1985 "Uninteresting mock function call - returning default value.\n"
1991 // A void mock function.
1998 ContainsRegex("Uninteresting mock function call - returning directly\\.\n"
2057 // Tests how the flag affects uninteresting calls on a naggy mock.
2074 "Uninteresting mock function call - returning directly.\n"
2084 "Uninteresting mock function call - returning default value.\n"
2210 // Tests that we can verify and clear a mock object's expectations
2222 // Tests that we can verify and clear a mock object's expectations
2237 // Tests that we can verify and clear a mock object's expectations
2254 // Tests that we can verify and clear a mock object's expectations
2270 // Tests that we can verify and clear a mock object's expectations
2289 // mock object multiple times.
2307 // Tests that we can clear a mock object's default actions when none
2316 // Tests that we can clear a mock object's default actions when some,
2328 // Tests that we can clear a mock object's default actions when all of
2344 // Tests that we can clear a mock object's default actions when a
2359 // Tests that we can call VerifyAndClear() on a mock object multiple
2409 // expectations are set on a const mock object.
2426 // Tests that we can set default actions and expectations on a mock
2443 // Tests that calling VerifyAndClear() on one mock object does not
2444 // affect other mock objects (either of the same type or not).
2480 // Throw away the reference to the mock that we have in a. After this, the
2485 // to the mock object originally pointed to by a. This will cause the MockA
2499 // Throw away the reference to the mock that we have in a. After this, the
2504 // to the mock object originally pointed to by a. This will cause the MockA
2510 // Tests that a mock function's action can call a mock function
2570 MockWithConstMethods mock;
2571 ON_CALL(mock, Foo).WillByDefault(Return(7));
2572 ON_CALL(mock, Bar).WillByDefault(Return(33));
2574 EXPECT_THAT(mock.Foo(17), 7);
2575 EXPECT_THAT(mock.Bar(27, "purple"), 33);
2586 MockConstOverload mock;
2587 ON_CALL(mock, Overloaded(_)).WillByDefault(Return(7));
2588 ON_CALL(mock, Overloaded(5)).WillByDefault(Return(9));
2589 ON_CALL(Const(mock), Overloaded(5)).WillByDefault(Return(11));
2590 ON_CALL(Const(mock), Overloaded(7)).WillByDefault(Return(13));
2592 EXPECT_THAT(mock.Overloaded(1), 7);
2593 EXPECT_THAT(mock.Overloaded(5), 9);
2594 EXPECT_THAT(mock.Overloaded(7), 7);
2596 const MockConstOverload& const_mock = mock;