Improves EXPECT_DEATH_IF_SUPPORTED to allow streaming of messages and enforcing the validity of arguments (by Vlad Losev); adds samples for the event listener API (by Vlad Losev); simplifies the tests using EXPECT_DEATH_IF_SUPPORTED (by Zhanyong Wan).

This commit is contained in:
zhanyong.wan
2009-09-11 06:59:42 +00:00
parent f6dd67a155
commit b2ee82ebf9
12 changed files with 497 additions and 41 deletions

View File

@@ -6345,16 +6345,14 @@ TEST(EventListenerTest, SuppressEventForwarding) {
EXPECT_EQ(0, on_start_counter);
}
#if GTEST_HAS_DEATH_TEST
// Tests that events generated by Google Test are not forwarded in
// death test subprocesses.
TEST(EventListenerDeathTest, EventsNotForwardedInDeathTestSubprecesses) {
EXPECT_DEATH({ // NOLINT
EXPECT_DEATH_IF_SUPPORTED({
GTEST_CHECK_(EventListenersAccessor::EventForwardingEnabled(
*GetUnitTestImpl()->listeners())) << "expected failure";},
"expected failure");
}
#endif // GTEST_HAS_DEATH_TEST
// Tests that a listener installed via SetDefaultResultPrinter() starts
// receiving events and is returned via default_result_printer() and that