aboutsummaryrefslogtreecommitdiffstats
path: root/src/gtest-death-test.cc
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-09-16 06:59:17 +0000
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-09-16 06:59:17 +0000
commit866f4a94461d765f7f9514b6cb6e82d7b9ea12d2 (patch)
treeb3e87b28fc5283e1e0ac9222b5a0df5f3ada3484 /src/gtest-death-test.cc
parentb2ee82ebf9b8f1be859d08611b768ae6c0700090 (diff)
downloadgoogletest-866f4a94461d765f7f9514b6cb6e82d7b9ea12d2.tar.gz
googletest-866f4a94461d765f7f9514b6cb6e82d7b9ea12d2.tar.bz2
googletest-866f4a94461d765f7f9514b6cb6e82d7b9ea12d2.zip
Simplifies the implementation of GTEST_LOG_ & GTEST_LOG_; renames
GTEST_HIDE_UNREACHABLE_CODE_ to GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_ (by Vlad Losev).
Diffstat (limited to 'src/gtest-death-test.cc')
-rw-r--r--src/gtest-death-test.cc25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/gtest-death-test.cc b/src/gtest-death-test.cc
index d975af77..91f16de8 100644
--- a/src/gtest-death-test.cc
+++ b/src/gtest-death-test.cc
@@ -269,13 +269,12 @@ static void FailFromInternalError(int fd) {
} while (num_read == -1 && errno == EINTR);
if (num_read == 0) {
- GTEST_LOG_(FATAL, error);
+ GTEST_LOG_(FATAL) << error.GetString().c_str();
} else {
const int last_error = errno;
const String message = GetLastErrnoDescription();
- GTEST_LOG_(FATAL,
- Message() << "Error while reading death test internal: "
- << message << " [" << last_error << "]");
+ GTEST_LOG_(FATAL) << "Error while reading death test internal: "
+ << message.c_str() << " [" << last_error << "]";
}
}
@@ -397,15 +396,13 @@ void DeathTestImpl::ReadAndInterpretStatusByte() {
FailFromInternalError(read_fd()); // Does not return.
break;
default:
- GTEST_LOG_(FATAL,
- Message() << "Death test child process reported "
- << "unexpected status byte ("
- << static_cast<unsigned int>(flag) << ")");
+ GTEST_LOG_(FATAL) << "Death test child process reported "
+ << "unexpected status byte ("
+ << static_cast<unsigned int>(flag) << ")";
}
} else {
- GTEST_LOG_(FATAL,
- Message() << "Read from death test child process failed: "
- << GetLastErrnoDescription());
+ GTEST_LOG_(FATAL) << "Read from death test child process failed: "
+ << GetLastErrnoDescription().c_str();
}
GTEST_DEATH_TEST_CHECK_SYSCALL_(posix::Close(read_fd()));
set_read_fd(-1);
@@ -484,8 +481,8 @@ bool DeathTestImpl::Passed(bool status_ok) {
break;
case IN_PROGRESS:
default:
- GTEST_LOG_(FATAL,
- "DeathTest::Passed somehow called before conclusion of test");
+ GTEST_LOG_(FATAL)
+ << "DeathTest::Passed somehow called before conclusion of test";
}
DeathTest::set_last_death_test_message(buffer.GetString());
@@ -741,7 +738,7 @@ class NoExecDeathTest : public ForkingDeathTest {
DeathTest::TestRole NoExecDeathTest::AssumeRole() {
const size_t thread_count = GetThreadCount();
if (thread_count != 1) {
- GTEST_LOG_(WARNING, DeathTestThreadWarning(thread_count));
+ GTEST_LOG_(WARNING) << DeathTestThreadWarning(thread_count);
}
int pipe_fd[2];