mirror of
https://github.com/google/googletest.git
synced 2024-12-26 17:41:03 +08:00
Googletest export
Mention matchers as an alternative to assertions in subroutines. Matchers are often the better choice - they can provide more informative error messages and circumvent all of the complexity described in this section. PiperOrigin-RevId: 326332149
This commit is contained in:
parent
10ade8473b
commit
adeef19294
@ -911,6 +911,12 @@ handlers registered with `pthread_atfork(3)`.
|
||||
|
||||
## Using Assertions in Sub-routines
|
||||
|
||||
Note: If you want to put a series of test assertions in a subroutine to check
|
||||
for a complex condition, consider using
|
||||
[a custom GMock matcher](../../googlemock/docs/cook_book.md#NewMatchers)
|
||||
instead. This lets you provide a more readable error message in case of failure
|
||||
and avoid all of the issues described below.
|
||||
|
||||
### Adding Traces to Assertions
|
||||
|
||||
If a test sub-routine is called from several places, when an assertion inside it
|
||||
|
Loading…
x
Reference in New Issue
Block a user