Lines Matching +full:test +full:- +full:expectations
6 [high-perf dependency injection technique](gmock_cook_book.md#MockingNonVirtualMethods).
72 Note that we are talking about the *top-level* `const` modifier here. If the
82 ### I can't figure out why gMock thinks my expectations are not satisfied. What should I do?
84 You might want to run your test with `--gmock_verbose=info`. This flag lets
86 trace, you'll gain insights on why the expectations you set are not met.
98 When a test crashes, the failure signal handler will try to log a lot of
101 intercepts these messages and finds that they don't match any expectations, it
104 You can learn to ignore the errors, or you can rewrite your expectations to make
105 your test more robust, for example, by adding something like:
125 ### I have a failed test where gMock tells me TWICE that a particular expectation is not satisfied.…
128 arguments, the state of relevant expectations, and etc) to help the user debug.
130 state of relevant expectations.
164 // - value_ is leaked.
170 ### The "newer expectations override older ones" rule makes writing expectations awkward. Why does …
178 // 2 the second time. However, I have to write the expectations in the
188 The problem, is that they didn't pick the **best** way to express the test's
191 By default, expectations don't have to be matched in *any* particular order. If
194 over-specify your tests, and we want to make it harder to do so.
196 There are two better ways to write the test spec. You could either put the
197 expectations in sequence:
203 // 2 the second time. Using a sequence, we can write the expectations
229 Back to the original questions: why does gMock search the expectations (and
231 behavior for the common case early (e.g. in the mock's constructor or the test
232 fixture's set-up phase) and customize it with more specific rules later. If
241 the default behavior rarely changes from test to test. Then in the test body
242 they set the expectations, which are often different for each test. Having an
243 `ON_CALL` in the set-up part of a test doesn't mean that the calls are expected.
268 Also, you can control the verbosity by specifying `--gmock_verbose=error`. Other
275 argument, you can use testing::DeleteArg<N>() to delete the N'th (zero-indexed)
316 [post](https://testing.googleblog.com/2008/06/defeat-static-cling.html) says it
321 I know it's not a question, but you get an answer for free any way. :-)
327 When you write a test without using mocks, you exercise the code and assert that
329 sometimes called "state-based testing".
331 Mocks are great for what some call "interaction-based" testing: instead of
335 more effective and economical to do than state-based testing.
337 If you are doing state-based testing and using a test double just to simulate
342 wrong problem. :-)
344 ### I got a warning "Uninteresting function call encountered - default action taken.." Should I pan…
346 By all means, NO! It's just an FYI. :-)
348 What it means is that you have a mock function, you haven't set any expectations
351 That's OK - you didn't say it's not OK to call the function!
364 Either way is fine - you want to choose the one that's more convenient for your
372 is the way to go here. See the implementation of `Return()` in `gmock-actions.h`
383 See this [recipe](gmock_cook_book.md#mocking-side-effects) for more details and