mirror of
https://github.com/google/googletest.git
synced 2025-04-10 07:07:55 +00:00
wiki change: adds EXPECT_DEATH_IF_SUPPORTED
This commit is contained in:
parent
280294e3e1
commit
8d9ac166d9
1 changed files with 3 additions and 2 deletions
|
@ -348,7 +348,8 @@ If you want to test `EXPECT_*()/ASSERT_*()` failures in your test code, see [#Ca
|
|||
Google Test has the following macros to support death tests:
|
||||
|
||||
|| *Fatal assertion* || *Nonfatal assertion* || *Verifies* ||
|
||||
|| `ASSERT_DEATH(`_statement, regex_`); || `EXPECT_DEATH(`_statement, regex_`); || _statement_ crashes with the given error ||
|
||||
|| `ASSERT_DEATH(`_statement, regex_`); || `EXPECT_DEATH(`_statement, regex_`); || _statement_ crashes with the given error ||
|
||||
|| `ASSERT_DEATH_IF_SUPPORTED(`_statement, regex_`); || `EXPECT_DEATH_IF_SUPPORTED(`_statement, regex_`); || if death tests are supported, verifies that _statement_ crashes with the given error; otherwise verifies nothing ||
|
||||
|| `ASSERT_EXIT(`_statement, predicate, regex_`); || `EXPECT_EXIT(`_statement, predicate, regex_`); ||_statement_ exits with the given error and its exit code matches _predicate_ ||
|
||||
|
||||
where _statement_ is a statement that is expected to cause the process to
|
||||
|
@ -437,7 +438,7 @@ TEST_F(FooDeathTest, DoesThat) {
|
|||
}
|
||||
}}}
|
||||
|
||||
_Availability:_ Linux, Windows (requires MSVC 8.0 or above), Cygwin, and Mac (the latter three are supported since v1.3.0)
|
||||
_Availability:_ Linux, Windows (requires MSVC 8.0 or above), Cygwin, and Mac (the latter three are supported since v1.3.0). `(ASSERT|EXPECT)_DEATH_IF_SUPPORTED` are new in v1.4.0.
|
||||
|
||||
== Regular Expression Syntax ==
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue