Lines Matching refs:Foo

9 recommended to write `using ::testing::Foo;` once in your file before using the
10 name `Foo` defined by gMock. We omit such `using` statements in this section for
93 class Foo {
105 class MockFoo : public Foo {
122 class Foo {
125 // Must be virtual as we'll inherit from Foo.
126 virtual ~Foo();
137 class MockFoo : public Foo {
153 class MockFoo : public Foo {
155 using Foo::Add;
316 <td><code>MOCK_METHOD1(Foo, bool(int))</code></td>
320 <td><code>MOCK_METHOD(bool, Foo, (int))</code></td>
326 <td><code>MOCK_CONST_METHOD1(Foo, bool(int))</code></td>
330 <td><code>MOCK_METHOD(bool, Foo, (int), (const))</code></td>
336 <td><code>MOCK_METHOD1_T(Foo, bool(int))</code></td>
340 <td><code>MOCK_METHOD(bool, Foo, (int))</code></td>
346 <td><code>MOCK_CONST_METHOD1_T(Foo, bool(int))</code></td>
350 <td><code>MOCK_METHOD(bool, Foo, (int), (const))</code></td>
356 <td><code>MOCK_METHOD1_WITH_CALLTYPE(STDMETHODCALLTYPE, Foo, bool(int))</code></td>
360 <td><code>MOCK_METHOD(bool, Foo, (int), (Calltype(STDMETHODCALLTYPE)))</code></td>
366 <td><code>MOCK_CONST_METHOD1_WITH_CALLTYPE(STDMETHODCALLTYPE, Foo, bool(int))</code></td>
370 <td><code>MOCK_METHOD(bool, Foo, (int), (const, Calltype(STDMETHODCALLTYPE)))</code></td>
376 <td><code>MOCK_METHOD1_T_WITH_CALLTYPE(STDMETHODCALLTYPE, Foo, bool(int))</code></td>
380 <td><code>MOCK_METHOD(bool, Foo, (int), (Calltype(STDMETHODCALLTYPE)))</code></td>
386 <td><code>MOCK_CONST_METHOD1_T_WITH_CALLTYPE(STDMETHODCALLTYPE, Foo, bool(int))</code></td>
390 <td><code>MOCK_METHOD(bool, Foo, (int), (const, Calltype(STDMETHODCALLTYPE)))</code></td>
631 class Foo {
633 virtual ~Foo() {}
638 class FakeFoo : public Foo {
659 class MockFoo : public Foo {
718 function's type. For instance, if class `Foo` has methods `char DoThis(int
761 class MockFoo : public Foo {
777 Foo real_;
801 class Foo {
803 virtual ~Foo();
809 class MockFoo : public Foo {
813 // Mocking a concrete method. Foo::Concrete() is shadowed.
818 Sometimes you may want to call `Foo::Concrete()` instead of
824 You can call `Foo::Concrete()` inside an action by:
829 return foo.Foo::Concrete(str);
838 return foo.Foo::Concrete(str);
844 `Foo::Concrete()` is virtual. That's just how C++ works.)
953 class MockFoo : public Foo {
983 class MockFoo : public Foo {
1170 When you do an `EXPECT_CALL(mock_obj, Foo(bar))`, gMock saves away a copy of
1171 `bar`. When `Foo()` is called later, gMock compares the argument to `Foo()` with
1187 // Expects that Foo()'s argument == bar.
1188 EXPECT_CALL(mock_obj, Foo(Eq(std::ref(bar))));
1190 // Expects that Foo()'s argument < bar.
1191 EXPECT_CALL(mock_obj, Foo(Lt(std::ref(bar))));
1206 Field(&Foo::bar, m)
1209 is a matcher that matches a `Foo` object whose `bar` member variable satisfies
1213 Property(&Foo::baz, m)
1216 is a matcher that matches a `Foo` object whose `baz()` method returns a value
1223 | `Field(&Foo::number, Ge(3))` | Matches `x` where `x.number >= 3`. |
1224 | `Property(&Foo::name, StartsWith("John "))` | Matches `x` where `x.name()` starts with `"John "…
1226 Note that in `Property(&Foo::baz, ...)`, method `baz()` must take no argument
1238 Field(&Foo::number, Ge(3))
1257 Matcher<Foo> IsFoo(const Foo& foo) {
1258 return AllOf(Field("some_field", &Foo::some_field, foo.some_field),
1259 Field("other_field", &Foo::other_field, foo.other_field),
1260 Field("last_field", &Foo::last_field, foo.last_field));
1317 Imagine you have a mock function that takes an object of type `Foo`, which has
1330 bool MatchAndExplain(const Foo& foo,
1346 ::testing::Matcher<const Foo&> BarPlusBazEq(int expected_sum) {
1351 Foo foo;
1376 MOCK_METHOD(void, Foo, (const vector<int>& numbers), (override));
1378 EXPECT_CALL(mock, Foo(ElementsAre(1, Gt(0), _, 5)));
1391 MOCK_METHOD(void, Foo, (const vector<int>& numbers), (override));
1393 EXPECT_CALL(mock, Foo(UnorderedElementsAre(1, Gt(0), _, 5)));
1407 EXPECT_CALL(mock, Foo(ElementsAreArray(expected_vector1)));
1411 EXPECT_CALL(mock, Foo(ElementsAreArray(expected_vector2)));
1423 EXPECT_CALL(mock, Foo(ElementsAreArray(expected_vector3, count)));
1835 class MockFoo : public Foo {
1866 class MockFoo : public Foo {
1918 class MockFoo : public Foo {
2118 class MockFoo : public Foo {
2192 class MockFoo : public Foo {
2258 class MockFoo : public Foo {
2298 class MockFoo : public Foo {
2340 class MockFoo : public Foo {
2449 class MockFoo : public Foo {
2473 Say you have a mock function `Foo()` that takes seven arguments, and you have a
2474 custom action that you want to invoke when `Foo()` is called. Trouble is, the
2481 MOCK_METHOD(bool, Foo,
2490 EXPECT_CALL(mock, Foo)
2495 signature as `Foo()` and calls the custom action with the right arguments:
2507 EXPECT_CALL(mock, Foo)
2529 EXPECT_CALL(mock, Foo)
2571 MOCK_METHOD(double, Foo, double(const string& label, double x, double y),
2589 EXPECT_CALL(mock, Foo("abc", _, _))
2606 EXPECT_CALL(mock, Foo("abc", _, _))
2903 class MockFoo : public Foo {
2920 class MockFoo : public Foo {
3004 Foo(1);
3005 Foo(2);
3006 Foo(3);
3009 and want to verify that `Foo(1)` and `Foo(3)` both invoke `mock.Bar("a")`, but
3010 `Foo(2)` doesn't invoke anything, you can write:
3028 Foo(1);
3030 Foo(2);
3032 Foo(3);
3039 it clear which `Bar("a")` is called by which call to `Foo()`.
3061 class MockFoo : public Foo {
3128 EXPECT_CALL(mock, Foo(1))
3130 EXPECT_CALL(mock, Foo(2))
3134 if `Foo(1)` is called in thread 1 and `Foo(2)` is called in thread 2, gMock will
3214 TEST(Foo, Bar) {
3228 [ RUN ] Foo.Bar
3251 [ FAILED ] Foo.Bar
3522 MATCHER_Pk(Foo, p1, ..., pk, description_string) { ... }
3530 Foo(p1_type p1, ..., pk_type pk) { ... }
3533 When you write `Foo(v1, ..., vk)`, the compiler infers the types of the
3536 template, as in `Foo<long, bool>(5, false)`. As said earlier, you don't get to
3540 You can assign the result of expression `Foo(p1, ..., pk)` to a variable of type
3543 special types: you can assign `Foo()` to a `FooMatcher`-typed variable, and
3544 assign `Foo(p)` to a `FooMatcherP<p_type>`-typed variable.
3957 ACTION(Foo) {
3965 defines an action `Foo()` that invokes argument #2 (a function pointer) with 5,
4067 ACTION(Foo) {
4131 EXPECT_CALL(mock, Foo).WillOnce(DuplicateArg<1, unsigned char>(&n));
4164 | `ACTION(Foo)` | `Foo()` | `FooAction` |
4165 | `ACTION_TEMPLATE(Foo, HAS_m_TEMPLATE_PARAMS(...), AND_0_VALUE_PARAMS())` | `Foo<t1, ..., t_m>()` …
4294 class MockFoo : public Foo {
4363 Foo(mock_function.AsStdFunction());
4364 // Foo's signature can be either of:
4365 // void Foo(const std::function<int(string)>& fun);
4366 // void Foo(std::function<int(string)> fun);