mirror of
https://github.com/google/googletest.git
synced 2025-11-10 15:05:24 -05:00
Googletest export
Docs: Clarify that expectations must be set before mocks are exercised PiperOrigin-RevId: 373644072
This commit is contained in:
committed by
Dino Radaković
parent
662fe38e44
commit
eb6e9273dc
@@ -344,6 +344,11 @@ Mock::VerifyAndClearExpectations(&mock_obj);
|
||||
Mock::VerifyAndClear(&mock_obj);
|
||||
```
|
||||
|
||||
Do not set new expectations after verifying and clearing a mock after its use.
|
||||
Setting expectations after code that exercises the mock has undefined behavior.
|
||||
See [Using Mocks in Tests](gmock_for_dummies.md#using-mocks-in-tests) for more
|
||||
information.
|
||||
|
||||
You can also tell gMock that a mock object can be leaked and doesn't need to be
|
||||
verified:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user