googletest/googlemock/test/gmock-nice-strict_test.cc
Go to the documentation of this file.
1 // Copyright 2008, Google Inc.
2 // All rights reserved.
3 //
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are
6 // met:
7 //
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
13 // distribution.
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.
17 //
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.
29 
30 #include "gmock/gmock-nice-strict.h"
31 
32 #include <string>
33 #include <utility>
34 #include "gmock/gmock.h"
35 #include "gtest/gtest-spi.h"
36 #include "gtest/gtest.h"
37 
38 // This must not be defined inside the ::testing namespace, or it will
39 // clash with ::testing::Mock.
40 class Mock {
41  public:
42  Mock() {}
43 
44  MOCK_METHOD0(DoThis, void());
45 
46  private:
48 };
49 
50 namespace testing {
51 namespace gmock_nice_strict_test {
52 
53 using testing::HasSubstr;
54 using testing::NaggyMock;
55 using testing::NiceMock;
57 
58 #if GTEST_HAS_STREAM_REDIRECTION
61 #endif
62 
63 // Class without default constructor.
64 class NotDefaultConstructible {
65  public:
66  explicit NotDefaultConstructible(int) {}
67 };
68 
70  public:
71  ~CallsMockMethodInDestructor() { OnDestroy(); }
72  MOCK_METHOD(void, OnDestroy, ());
73 };
74 
75 // Defines some mock classes needed by the tests.
76 
77 class Foo {
78  public:
79  virtual ~Foo() {}
80 
81  virtual void DoThis() = 0;
82  virtual int DoThat(bool flag) = 0;
83 };
84 
85 class MockFoo : public Foo {
86  public:
87  MockFoo() {}
88  void Delete() { delete this; }
89 
90  MOCK_METHOD0(DoThis, void());
91  MOCK_METHOD1(DoThat, int(bool flag));
92  MOCK_METHOD0(ReturnNonDefaultConstructible, NotDefaultConstructible());
93 
94  private:
96 };
97 
98 class MockBar {
99  public:
100  explicit MockBar(const std::string& s) : str_(s) {}
101 
102  MockBar(char a1, char a2, std::string a3, std::string a4, int a5, int a6,
103  const std::string& a7, const std::string& a8, bool a9, bool a10) {
104  str_ = std::string() + a1 + a2 + a3 + a4 + static_cast<char>(a5) +
105  static_cast<char>(a6) + a7 + a8 + (a9 ? 'T' : 'F') + (a10 ? 'T' : 'F');
106  }
107 
108  virtual ~MockBar() {}
109 
110  const std::string& str() const { return str_; }
111 
112  MOCK_METHOD0(This, int());
113  MOCK_METHOD2(That, std::string(int, bool));
114 
115  private:
117 
119 };
120 
121 
122 class MockBaz {
123  public:
124  class MoveOnly {
125  public:
126  MoveOnly() = default;
127 
128  MoveOnly(const MoveOnly&) = delete;
129  MoveOnly& operator=(const MoveOnly&) = delete;
130 
131  MoveOnly(MoveOnly&&) = default;
132  MoveOnly& operator=(MoveOnly&&) = default;
133  };
134 
136 };
137 
138 #if GTEST_HAS_STREAM_REDIRECTION
139 
140 // Tests that a raw mock generates warnings for uninteresting calls.
141 TEST(RawMockTest, WarningForUninterestingCall) {
142  const std::string saved_flag = GMOCK_FLAG_GET(verbose);
143  GMOCK_FLAG_SET(verbose, "warning");
144 
145  MockFoo raw_foo;
146 
147  CaptureStdout();
148  raw_foo.DoThis();
149  raw_foo.DoThat(true);
151  HasSubstr("Uninteresting mock function call"));
152 
153  GMOCK_FLAG_SET(verbose, saved_flag);
154 }
155 
156 // Tests that a raw mock generates warnings for uninteresting calls
157 // that delete the mock object.
158 TEST(RawMockTest, WarningForUninterestingCallAfterDeath) {
159  const std::string saved_flag = GMOCK_FLAG_GET(verbose);
160  GMOCK_FLAG_SET(verbose, "warning");
161 
162  MockFoo* const raw_foo = new MockFoo;
163 
164  ON_CALL(*raw_foo, DoThis())
165  .WillByDefault(Invoke(raw_foo, &MockFoo::Delete));
166 
167  CaptureStdout();
168  raw_foo->DoThis();
170  HasSubstr("Uninteresting mock function call"));
171 
172  GMOCK_FLAG_SET(verbose, saved_flag);
173 }
174 
175 // Tests that a raw mock generates informational logs for
176 // uninteresting calls.
177 TEST(RawMockTest, InfoForUninterestingCall) {
178  MockFoo raw_foo;
179 
180  const std::string saved_flag = GMOCK_FLAG_GET(verbose);
181  GMOCK_FLAG_SET(verbose, "info");
182  CaptureStdout();
183  raw_foo.DoThis();
185  HasSubstr("Uninteresting mock function call"));
186 
187  GMOCK_FLAG_SET(verbose, saved_flag);
188 }
189 
190 TEST(RawMockTest, IsNaggy_IsNice_IsStrict) {
191  MockFoo raw_foo;
192  EXPECT_TRUE(Mock::IsNaggy(&raw_foo));
193  EXPECT_FALSE(Mock::IsNice(&raw_foo));
194  EXPECT_FALSE(Mock::IsStrict(&raw_foo));
195 }
196 
197 // Tests that a nice mock generates no warning for uninteresting calls.
198 TEST(NiceMockTest, NoWarningForUninterestingCall) {
199  NiceMock<MockFoo> nice_foo;
200 
201  CaptureStdout();
202  nice_foo.DoThis();
203  nice_foo.DoThat(true);
205 }
206 
207 // Tests that a nice mock generates no warning for uninteresting calls
208 // that delete the mock object.
209 TEST(NiceMockTest, NoWarningForUninterestingCallAfterDeath) {
210  NiceMock<MockFoo>* const nice_foo = new NiceMock<MockFoo>;
211 
212  ON_CALL(*nice_foo, DoThis())
213  .WillByDefault(Invoke(nice_foo, &MockFoo::Delete));
214 
215  CaptureStdout();
216  nice_foo->DoThis();
218 }
219 
220 // Tests that a nice mock generates informational logs for
221 // uninteresting calls.
222 TEST(NiceMockTest, InfoForUninterestingCall) {
223  NiceMock<MockFoo> nice_foo;
224 
225  const std::string saved_flag = GMOCK_FLAG_GET(verbose);
226  GMOCK_FLAG_SET(verbose, "info");
227  CaptureStdout();
228  nice_foo.DoThis();
230  HasSubstr("Uninteresting mock function call"));
231 
232  GMOCK_FLAG_SET(verbose, saved_flag);
233 }
234 
235 #endif // GTEST_HAS_STREAM_REDIRECTION
236 
237 // Tests that a nice mock allows expected calls.
238 TEST(NiceMockTest, AllowsExpectedCall) {
239  NiceMock<MockFoo> nice_foo;
240 
241  EXPECT_CALL(nice_foo, DoThis());
242  nice_foo.DoThis();
243 }
244 
245 // Tests that an unexpected call on a nice mock which returns a
246 // not-default-constructible type throws an exception and the exception contains
247 // the method's name.
248 TEST(NiceMockTest, ThrowsExceptionForUnknownReturnTypes) {
249  NiceMock<MockFoo> nice_foo;
250 #if GTEST_HAS_EXCEPTIONS
251  try {
252  nice_foo.ReturnNonDefaultConstructible();
253  FAIL();
254  } catch (const std::runtime_error& ex) {
255  EXPECT_THAT(ex.what(), HasSubstr("ReturnNonDefaultConstructible"));
256  }
257 #else
258  EXPECT_DEATH_IF_SUPPORTED({ nice_foo.ReturnNonDefaultConstructible(); }, "");
259 #endif
260 }
261 
262 // Tests that an unexpected call on a nice mock fails.
263 TEST(NiceMockTest, UnexpectedCallFails) {
264  NiceMock<MockFoo> nice_foo;
265 
266  EXPECT_CALL(nice_foo, DoThis()).Times(0);
267  EXPECT_NONFATAL_FAILURE(nice_foo.DoThis(), "called more times than expected");
268 }
269 
270 // Tests that NiceMock works with a mock class that has a non-default
271 // constructor.
272 TEST(NiceMockTest, NonDefaultConstructor) {
273  NiceMock<MockBar> nice_bar("hi");
274  EXPECT_EQ("hi", nice_bar.str());
275 
276  nice_bar.This();
277  nice_bar.That(5, true);
278 }
279 
280 // Tests that NiceMock works with a mock class that has a 10-ary
281 // non-default constructor.
282 TEST(NiceMockTest, NonDefaultConstructor10) {
283  NiceMock<MockBar> nice_bar('a', 'b', "c", "d", 'e', 'f',
284  "g", "h", true, false);
285  EXPECT_EQ("abcdefghTF", nice_bar.str());
286 
287  nice_bar.This();
288  nice_bar.That(5, true);
289 }
290 
291 TEST(NiceMockTest, AllowLeak) {
292  NiceMock<MockFoo>* leaked = new NiceMock<MockFoo>;
293  Mock::AllowLeak(leaked);
294  EXPECT_CALL(*leaked, DoThis());
295  leaked->DoThis();
296 }
297 
298 TEST(NiceMockTest, MoveOnlyConstructor) {
299  NiceMock<MockBaz> nice_baz(MockBaz::MoveOnly{});
300 }
301 
302 // Tests that NiceMock<Mock> compiles where Mock is a user-defined
303 // class (as opposed to ::testing::Mock).
304 TEST(NiceMockTest, AcceptsClassNamedMock) {
305  NiceMock< ::Mock> nice;
306  EXPECT_CALL(nice, DoThis());
307  nice.DoThis();
308 }
309 
310 TEST(NiceMockTest, IsNiceInDestructor) {
311  {
313  // Don't add an expectation for the call before the mock goes out of scope.
314  }
315 }
316 
317 TEST(NiceMockTest, IsNaggy_IsNice_IsStrict) {
318  NiceMock<MockFoo> nice_foo;
319  EXPECT_FALSE(Mock::IsNaggy(&nice_foo));
320  EXPECT_TRUE(Mock::IsNice(&nice_foo));
321  EXPECT_FALSE(Mock::IsStrict(&nice_foo));
322 }
323 
324 #if GTEST_HAS_STREAM_REDIRECTION
325 
326 // Tests that a naggy mock generates warnings for uninteresting calls.
327 TEST(NaggyMockTest, WarningForUninterestingCall) {
328  const std::string saved_flag = GMOCK_FLAG_GET(verbose);
329  GMOCK_FLAG_SET(verbose, "warning");
330 
331  NaggyMock<MockFoo> naggy_foo;
332 
333  CaptureStdout();
334  naggy_foo.DoThis();
335  naggy_foo.DoThat(true);
337  HasSubstr("Uninteresting mock function call"));
338 
339  GMOCK_FLAG_SET(verbose, saved_flag);
340 }
341 
342 // Tests that a naggy mock generates a warning for an uninteresting call
343 // that deletes the mock object.
344 TEST(NaggyMockTest, WarningForUninterestingCallAfterDeath) {
345  const std::string saved_flag = GMOCK_FLAG_GET(verbose);
346  GMOCK_FLAG_SET(verbose, "warning");
347 
348  NaggyMock<MockFoo>* const naggy_foo = new NaggyMock<MockFoo>;
349 
350  ON_CALL(*naggy_foo, DoThis())
351  .WillByDefault(Invoke(naggy_foo, &MockFoo::Delete));
352 
353  CaptureStdout();
354  naggy_foo->DoThis();
356  HasSubstr("Uninteresting mock function call"));
357 
358  GMOCK_FLAG_SET(verbose, saved_flag);
359 }
360 
361 #endif // GTEST_HAS_STREAM_REDIRECTION
362 
363 // Tests that a naggy mock allows expected calls.
364 TEST(NaggyMockTest, AllowsExpectedCall) {
365  NaggyMock<MockFoo> naggy_foo;
366 
367  EXPECT_CALL(naggy_foo, DoThis());
368  naggy_foo.DoThis();
369 }
370 
371 // Tests that an unexpected call on a naggy mock fails.
372 TEST(NaggyMockTest, UnexpectedCallFails) {
373  NaggyMock<MockFoo> naggy_foo;
374 
375  EXPECT_CALL(naggy_foo, DoThis()).Times(0);
376  EXPECT_NONFATAL_FAILURE(naggy_foo.DoThis(),
377  "called more times than expected");
378 }
379 
380 // Tests that NaggyMock works with a mock class that has a non-default
381 // constructor.
382 TEST(NaggyMockTest, NonDefaultConstructor) {
383  NaggyMock<MockBar> naggy_bar("hi");
384  EXPECT_EQ("hi", naggy_bar.str());
385 
386  naggy_bar.This();
387  naggy_bar.That(5, true);
388 }
389 
390 // Tests that NaggyMock works with a mock class that has a 10-ary
391 // non-default constructor.
392 TEST(NaggyMockTest, NonDefaultConstructor10) {
393  NaggyMock<MockBar> naggy_bar('0', '1', "2", "3", '4', '5',
394  "6", "7", true, false);
395  EXPECT_EQ("01234567TF", naggy_bar.str());
396 
397  naggy_bar.This();
398  naggy_bar.That(5, true);
399 }
400 
401 TEST(NaggyMockTest, AllowLeak) {
402  NaggyMock<MockFoo>* leaked = new NaggyMock<MockFoo>;
403  Mock::AllowLeak(leaked);
404  EXPECT_CALL(*leaked, DoThis());
405  leaked->DoThis();
406 }
407 
408 TEST(NaggyMockTest, MoveOnlyConstructor) {
409  NaggyMock<MockBaz> naggy_baz(MockBaz::MoveOnly{});
410 }
411 
412 // Tests that NaggyMock<Mock> compiles where Mock is a user-defined
413 // class (as opposed to ::testing::Mock).
414 TEST(NaggyMockTest, AcceptsClassNamedMock) {
415  NaggyMock< ::Mock> naggy;
416  EXPECT_CALL(naggy, DoThis());
417  naggy.DoThis();
418 }
419 
420 TEST(NaggyMockTest, IsNaggyInDestructor) {
421  const std::string saved_flag = GMOCK_FLAG_GET(verbose);
422  GMOCK_FLAG_SET(verbose, "warning");
423  CaptureStdout();
424 
425  {
427  // Don't add an expectation for the call before the mock goes out of scope.
428  }
429 
431  HasSubstr("Uninteresting mock function call"));
432 
433  GMOCK_FLAG_SET(verbose, saved_flag);
434 }
435 
436 TEST(NaggyMockTest, IsNaggy_IsNice_IsStrict) {
437  NaggyMock<MockFoo> naggy_foo;
438  EXPECT_TRUE(Mock::IsNaggy(&naggy_foo));
439  EXPECT_FALSE(Mock::IsNice(&naggy_foo));
440  EXPECT_FALSE(Mock::IsStrict(&naggy_foo));
441 }
442 
443 // Tests that a strict mock allows expected calls.
444 TEST(StrictMockTest, AllowsExpectedCall) {
445  StrictMock<MockFoo> strict_foo;
446 
447  EXPECT_CALL(strict_foo, DoThis());
448  strict_foo.DoThis();
449 }
450 
451 // Tests that an unexpected call on a strict mock fails.
452 TEST(StrictMockTest, UnexpectedCallFails) {
453  StrictMock<MockFoo> strict_foo;
454 
455  EXPECT_CALL(strict_foo, DoThis()).Times(0);
456  EXPECT_NONFATAL_FAILURE(strict_foo.DoThis(),
457  "called more times than expected");
458 }
459 
460 // Tests that an uninteresting call on a strict mock fails.
461 TEST(StrictMockTest, UninterestingCallFails) {
462  StrictMock<MockFoo> strict_foo;
463 
464  EXPECT_NONFATAL_FAILURE(strict_foo.DoThis(),
465  "Uninteresting mock function call");
466 }
467 
468 // Tests that an uninteresting call on a strict mock fails, even if
469 // the call deletes the mock object.
470 TEST(StrictMockTest, UninterestingCallFailsAfterDeath) {
471  StrictMock<MockFoo>* const strict_foo = new StrictMock<MockFoo>;
472 
473  ON_CALL(*strict_foo, DoThis())
474  .WillByDefault(Invoke(strict_foo, &MockFoo::Delete));
475 
476  EXPECT_NONFATAL_FAILURE(strict_foo->DoThis(),
477  "Uninteresting mock function call");
478 }
479 
480 // Tests that StrictMock works with a mock class that has a
481 // non-default constructor.
482 TEST(StrictMockTest, NonDefaultConstructor) {
483  StrictMock<MockBar> strict_bar("hi");
484  EXPECT_EQ("hi", strict_bar.str());
485 
486  EXPECT_NONFATAL_FAILURE(strict_bar.That(5, true),
487  "Uninteresting mock function call");
488 }
489 
490 // Tests that StrictMock works with a mock class that has a 10-ary
491 // non-default constructor.
492 TEST(StrictMockTest, NonDefaultConstructor10) {
493  StrictMock<MockBar> strict_bar('a', 'b', "c", "d", 'e', 'f',
494  "g", "h", true, false);
495  EXPECT_EQ("abcdefghTF", strict_bar.str());
496 
497  EXPECT_NONFATAL_FAILURE(strict_bar.That(5, true),
498  "Uninteresting mock function call");
499 }
500 
501 TEST(StrictMockTest, AllowLeak) {
502  StrictMock<MockFoo>* leaked = new StrictMock<MockFoo>;
503  Mock::AllowLeak(leaked);
504  EXPECT_CALL(*leaked, DoThis());
505  leaked->DoThis();
506 }
507 
508 TEST(StrictMockTest, MoveOnlyConstructor) {
509  StrictMock<MockBaz> strict_baz(MockBaz::MoveOnly{});
510 }
511 
512 // Tests that StrictMock<Mock> compiles where Mock is a user-defined
513 // class (as opposed to ::testing::Mock).
514 TEST(StrictMockTest, AcceptsClassNamedMock) {
515  StrictMock< ::Mock> strict;
516  EXPECT_CALL(strict, DoThis());
517  strict.DoThis();
518 }
519 
520 TEST(StrictMockTest, IsStrictInDestructor) {
522  {
523  StrictMock<CallsMockMethodInDestructor> strict_on_destroy;
524  // Don't add an expectation for the call before the mock goes out of
525  // scope.
526  },
527  "Uninteresting mock function call");
528 }
529 
530 TEST(StrictMockTest, IsNaggy_IsNice_IsStrict) {
531  StrictMock<MockFoo> strict_foo;
532  EXPECT_FALSE(Mock::IsNaggy(&strict_foo));
533  EXPECT_FALSE(Mock::IsNice(&strict_foo));
534  EXPECT_TRUE(Mock::IsStrict(&strict_foo));
535 }
536 
537 } // namespace gmock_nice_strict_test
538 } // namespace testing
testing::gmock_nice_strict_test::MockBar::MockBar
MockBar(const std::string &s)
Definition: googletest/googlemock/test/gmock-nice-strict_test.cc:100
EXPECT_FALSE
#define EXPECT_FALSE(condition)
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:1970
testing::StrictMock
Definition: bloaty/third_party/googletest/googlemock/include/gmock/gmock-nice-strict.h:148
flag
uint32_t flag
Definition: ssl_versions.cc:162
testing
Definition: aws_request_signer_test.cc:25
testing::gmock_nice_strict_test::MockBar::MOCK_METHOD2
MOCK_METHOD2(That, std::string(int, bool))
testing::gmock_nice_strict_test::CallsMockMethodInDestructor
Definition: googletest/googlemock/test/gmock-nice-strict_test.cc:69
testing::gmock_nice_strict_test::MockBar::GTEST_DISALLOW_COPY_AND_ASSIGN_
GTEST_DISALLOW_COPY_AND_ASSIGN_(MockBar)
GMOCK_FLAG_SET
#define GMOCK_FLAG_SET(name, value)
Definition: googletest/googlemock/include/gmock/internal/gmock-port.h:102
EXPECT_THAT
#define EXPECT_THAT(value, matcher)
testing::gmock_nice_strict_test::MockFoo::MockFoo
MockFoo()
Definition: googletest/googlemock/test/gmock-nice-strict_test.cc:87
testing::internal::GetCapturedStdout
GTEST_API_ std::string GetCapturedStdout()
Definition: gmock-gtest-all.cc:9596
testing::gmock_nice_strict_test::NotDefaultConstructible
Definition: bloaty/third_party/googletest/googlemock/test/gmock-nice-strict_test.cc:65
testing::gmock_nice_strict_test::MockBar::str
const std::string & str() const
Definition: googletest/googlemock/test/gmock-nice-strict_test.cc:110
testing::gmock_nice_strict_test::MockFoo::MOCK_METHOD1
MOCK_METHOD1(DoThat, int(bool flag))
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
testing::internal::CaptureStdout
GTEST_API_ void CaptureStdout()
Definition: gmock-gtest-all.cc:9586
ex
OPENSSL_EXPORT X509_EXTENSION * ex
Definition: x509.h:1418
testing::gmock_nice_strict_test::Foo::DoThis
virtual void DoThis()=0
EXPECT_EQ
#define EXPECT_EQ(a, b)
Definition: iomgr/time_averaged_stats_test.cc:27
testing::NiceMock
Definition: bloaty/third_party/googletest/googlemock/include/gmock/gmock-nice-strict.h:72
a2
T::first_type a2
Definition: abseil-cpp/absl/container/internal/hash_function_defaults_test.cc:307
Mock::MOCK_METHOD0
MOCK_METHOD0(DoThis, void())
testing::gmock_nice_strict_test::MockBar::MockBar
MockBar(char a1, char a2, std::string a3, std::string a4, int a5, int a6, const std::string &a7, const std::string &a8, bool a9, bool a10)
Definition: googletest/googlemock/test/gmock-nice-strict_test.cc:102
Foo
Definition: abseil-cpp/absl/debugging/symbolize_test.cc:65
testing::gmock_nice_strict_test::MockBaz::MoveOnly::operator=
MoveOnly & operator=(const MoveOnly &)=delete
testing::gmock_nice_strict_test::MockBar::str_
std::string str_
Definition: bloaty/third_party/googletest/googlemock/test/gmock-nice-strict_test.cc:111
Mock::Mock
Mock()
Definition: googletest/googlemock/test/gmock-nice-strict_test.cc:42
FAIL
@ FAIL
Definition: call_creds.cc:42
Mock::GTEST_DISALLOW_COPY_AND_ASSIGN_
GTEST_DISALLOW_COPY_AND_ASSIGN_(Mock)
a1
T::first_type a1
Definition: abseil-cpp/absl/container/internal/hash_function_defaults_test.cc:305
testing::gmock_nice_strict_test::MockFoo::MOCK_METHOD0
MOCK_METHOD0(DoThis, void())
testing::gmock_nice_strict_test::NotDefaultConstructible::NotDefaultConstructible
NotDefaultConstructible(int)
Definition: googletest/googlemock/test/gmock-nice-strict_test.cc:66
EXPECT_DEATH_IF_SUPPORTED
#define EXPECT_DEATH_IF_SUPPORTED(statement, regex)
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest-death-test.h:335
testing::gmock_nice_strict_test::MockBaz::MockBaz
MockBaz(MoveOnly)
Definition: googletest/googlemock/test/gmock-nice-strict_test.cc:135
EXPECT_CALL
#define EXPECT_CALL(obj, call)
Mock
Definition: bloaty/third_party/googletest/googlemock/test/gmock-nice-strict_test.cc:40
ON_CALL
#define ON_CALL(obj, call)
verbose
bool verbose
Definition: bloaty/third_party/protobuf/conformance/conformance_cpp.cc:70
testing::gmock_nice_strict_test::MockFoo
Definition: bloaty/third_party/googletest/googlemock/test/gmock-nice-strict_test.cc:80
testing::gmock_nice_strict_test::TEST
TEST(NiceMockTest, AllowsExpectedCall)
Definition: bloaty/third_party/googletest/googlemock/test/gmock-nice-strict_test.cc:233
testing::NaggyMock
Definition: bloaty/third_party/googletest/googlemock/include/gmock/gmock-nice-strict.h:110
testing::gmock_nice_strict_test::MockBaz::MoveOnly
Definition: bloaty/third_party/googletest/googlemock/test/gmock-nice-strict_test.cc:119
testing::gmock_nice_strict_test::CallsMockMethodInDestructor::~CallsMockMethodInDestructor
~CallsMockMethodInDestructor()
Definition: googletest/googlemock/test/gmock-nice-strict_test.cc:71
testing::gmock_nice_strict_test::MockBaz::MoveOnly::MoveOnly
MoveOnly()=default
testing::gmock_nice_strict_test::Foo::~Foo
virtual ~Foo()
Definition: googletest/googlemock/test/gmock-nice-strict_test.cc:79
testing::Invoke
std::decay< FunctionImpl >::type Invoke(FunctionImpl &&function_impl)
Definition: bloaty/third_party/googletest/googlemock/include/gmock/gmock-actions.h:1084
testing::gmock_nice_strict_test::MockFoo::Delete
void Delete()
Definition: googletest/googlemock/test/gmock-nice-strict_test.cc:88
GMOCK_FLAG_GET
#define GMOCK_FLAG_GET(name)
Definition: googletest/googlemock/include/gmock/internal/gmock-port.h:101
EXPECT_TRUE
#define EXPECT_TRUE(condition)
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:1967
testing::gmock_nice_strict_test::MockFoo::GTEST_DISALLOW_COPY_AND_ASSIGN_
GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFoo)
testing::gmock_nice_strict_test::MockBar
Definition: bloaty/third_party/googletest/googlemock/test/gmock-nice-strict_test.cc:93
EXPECT_NONFATAL_FAILURE
#define EXPECT_NONFATAL_FAILURE(statement, substr)
testing::gmock_nice_strict_test::CallsMockMethodInDestructor::MOCK_METHOD
MOCK_METHOD(void, OnDestroy,())
testing::gmock_nice_strict_test::Foo::DoThat
virtual int DoThat(bool flag)=0
testing::HasSubstr
PolymorphicMatcher< internal::HasSubstrMatcher< internal::string > > HasSubstr(const internal::string &substring)
Definition: cares/cares/test/gmock-1.8.0/gmock/gmock.h:8803
testing::gmock_nice_strict_test::MockBar::MOCK_METHOD0
MOCK_METHOD0(This, int())
testing::gmock_nice_strict_test::MockBar::~MockBar
virtual ~MockBar()
Definition: googletest/googlemock/test/gmock-nice-strict_test.cc:108


grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:36