summaryrefslogtreecommitdiffstats
path: root/googletest/src/gtest.cc
diff options
context:
space:
mode:
authorGasprd Petit <gaspardpetit@gmail.com>2017-09-07 11:47:09 (GMT)
committerGasprd Petit <gaspardpetit@gmail.com>2017-09-07 11:47:09 (GMT)
commitf6dde80e94b982fa74b7da78e56263eee59e4887 (patch)
tree71085f6fef61346c4e5ae184fcde66edac752570 /googletest/src/gtest.cc
parentee53b281ba16f5402e3a42003414a68d336fcd94 (diff)
downloadgoogletest-f6dde80e94b982fa74b7da78e56263eee59e4887.zip
googletest-f6dde80e94b982fa74b7da78e56263eee59e4887.tar.gz
googletest-f6dde80e94b982fa74b7da78e56263eee59e4887.tar.bz2
Removed flush scopes around GTEST_LOG(FATAL) and exit call since FATAL is expected to abort()
Diffstat (limited to 'googletest/src/gtest.cc')
-rw-r--r--googletest/src/gtest.cc22
1 files changed, 6 insertions, 16 deletions
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc
index 0895b42..fa170e7 100644
--- a/googletest/src/gtest.cc
+++ b/googletest/src/gtest.cc
@@ -3449,11 +3449,7 @@ class XmlUnitTestResultPrinter : public EmptyTestEventListener {
XmlUnitTestResultPrinter::XmlUnitTestResultPrinter(const char* output_file)
: output_file_(output_file) {
if (output_file_.c_str() == NULL || output_file_.empty()) {
- {
- // scoped to make sure the log is flushed before we exit
- GTEST_LOG_(FATAL) << "XML output file may not be null";
- }
- exit(EXIT_FAILURE);
+ GTEST_LOG_(FATAL) << "XML output file may not be null";
}
}
@@ -3478,11 +3474,8 @@ void XmlUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,
// 3. To interpret the meaning of errno in a thread-safe way,
// we need the strerror_r() function, which is not available on
// Windows.
- { // scoped to ensure the log is flushed before we exit
- GTEST_LOG_(FATAL) << "Unable to open file \""
- << output_file_ << "\"";
- }
- exit(EXIT_FAILURE);
+ GTEST_LOG_(FATAL) << "Unable to open file \""
+ << output_file_ << "\"";
}
std::stringstream stream;
PrintXmlUnitTest(&stream, unit_test);
@@ -5283,12 +5276,9 @@ bool ParseGoogleTestFlag(const char* const arg) {
void LoadFlagsFromFile(const std::string& path) {
FILE* flagfile = posix::FOpen(path.c_str(), "r");
if (!flagfile) {
- { // scoped to ensure the log is flushed before we exit
- GTEST_LOG_(FATAL) << "Unable to open file \""
- << GTEST_FLAG(flagfile)
- << "\"";
- }
- exit(EXIT_FAILURE);
+ GTEST_LOG_(FATAL) << "Unable to open file \""
+ << GTEST_FLAG(flagfile)
+ << "\"";
}
std::string contents(ReadEntireFile(flagfile));
posix::FClose(flagfile);