Edited wiki page through web user interface.

This commit is contained in:
zhanyong.wan 2009-03-03 07:51:18 +00:00
parent fd48c29ab6
commit eddf4bc582

View file

@ -380,6 +380,14 @@ The `*_DEATH` macros are convenient wrappers for `*_EXIT` that use a predicate
that verifies that the process either exited with a nonzero exit code or was
killed by a signal.
Note that a death test only cares about three things:
# does _statement_ abort or exit the process?
# (in the case of `ASSERT_EXIT` and `EXPECT_EXIT`) does the exit status satisfy _predicate_? And
# does the stderr output match _regex_?
In particular, if _statement_ generates an `ASSERT_*` or `EXPECT_*` failure, it will *not* cause the death test to fail, as Google Test assertions don't abort the process.
To write a death test, simply use one of the above macros inside your test
function. For example,