summaryrefslogtreecommitdiff
path: root/src/gtest-death-test.cc
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-09-04 18:30:25 +0000
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-09-04 18:30:25 +0000
commitf39160b423e8f90902066cf6774e4180667dcbee (patch)
treef990763455e874fb887364bbd9c712386824d20d /src/gtest-death-test.cc
parent89be5763249cbab785abfa310fb1cd6b5e9c4adf (diff)
downloadgtest-f39160b423e8f90902066cf6774e4180667dcbee.tar.gz
gtest-f39160b423e8f90902066cf6774e4180667dcbee.tar.bz2
gtest-f39160b423e8f90902066cf6774e4180667dcbee.tar.xz
More implementation of the event listener interface (by Vlad Losev); Reduces the stack space usage of assertions by moving AssertHelper's fields to the heap (by Jorg Brown); Makes String faster, smaller, and simpler (by Zhanyong Wan); Fixes a bug in String::Format() (by Chandler); Adds the /MD version of VC projects to the distribution (by Vlad Losev).
git-svn-id: http://googletest.googlecode.com/svn/trunk@301 861a406c-534a-0410-8894-cb66d6ee9925
Diffstat (limited to 'src/gtest-death-test.cc')
-rw-r--r--src/gtest-death-test.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gtest-death-test.cc b/src/gtest-death-test.cc
index 02ce48d..d975af7 100644
--- a/src/gtest-death-test.cc
+++ b/src/gtest-death-test.cc
@@ -469,7 +469,8 @@ bool DeathTestImpl::Passed(bool status_ok) {
break;
case DIED:
if (status_ok) {
- if (RE::PartialMatch(error_message.c_str(), *regex())) {
+ const bool matched = RE::PartialMatch(error_message.c_str(), *regex());
+ if (matched) {
success = true;
} else {
buffer << " Result: died but not with expected error.\n"
@@ -767,6 +768,9 @@ DeathTest::TestRole NoExecDeathTest::AssumeRole() {
// concurrent writes to the log files. We capture stderr in the parent
// process and append the child process' output to a log.
LogToStderr();
+ // Event forwarding to the listeners of event listener API mush be shut
+ // down in death test subprocesses.
+ GetUnitTestImpl()->listeners()->SuppressEventForwarding();
return EXECUTE_TEST;
} else {
GTEST_DEATH_TEST_CHECK_SYSCALL_(close(pipe_fd[1]));