Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
f6dde80e
Commit
f6dde80e
authored
Sep 07, 2017
by
Gasprd Petit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed flush scopes around GTEST_LOG(FATAL) and exit call since FATAL is expected to abort()
parent
ee53b281
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
16 deletions
+6
-16
gtest.cc
googletest/src/gtest.cc
+6
-16
No files found.
googletest/src/gtest.cc
View file @
f6dde80e
...
@@ -3449,11 +3449,7 @@ class XmlUnitTestResultPrinter : public EmptyTestEventListener {
...
@@ -3449,11 +3449,7 @@ class XmlUnitTestResultPrinter : public EmptyTestEventListener {
XmlUnitTestResultPrinter
::
XmlUnitTestResultPrinter
(
const
char
*
output_file
)
XmlUnitTestResultPrinter
::
XmlUnitTestResultPrinter
(
const
char
*
output_file
)
:
output_file_
(
output_file
)
{
:
output_file_
(
output_file
)
{
if
(
output_file_
.
c_str
()
==
NULL
||
output_file_
.
empty
())
{
if
(
output_file_
.
c_str
()
==
NULL
||
output_file_
.
empty
())
{
{
GTEST_LOG_
(
FATAL
)
<<
"XML output file may not be null"
;
// scoped to make sure the log is flushed before we exit
GTEST_LOG_
(
FATAL
)
<<
"XML output file may not be null"
;
}
exit
(
EXIT_FAILURE
);
}
}
}
}
...
@@ -3478,11 +3474,8 @@ void XmlUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,
...
@@ -3478,11 +3474,8 @@ void XmlUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,
// 3. To interpret the meaning of errno in a thread-safe way,
// 3. To interpret the meaning of errno in a thread-safe way,
// we need the strerror_r() function, which is not available on
// we need the strerror_r() function, which is not available on
// Windows.
// Windows.
{
// scoped to ensure the log is flushed before we exit
GTEST_LOG_
(
FATAL
)
<<
"Unable to open file
\"
"
GTEST_LOG_
(
FATAL
)
<<
"Unable to open file
\"
"
<<
output_file_
<<
"
\"
"
;
<<
output_file_
<<
"
\"
"
;
}
exit
(
EXIT_FAILURE
);
}
}
std
::
stringstream
stream
;
std
::
stringstream
stream
;
PrintXmlUnitTest
(
&
stream
,
unit_test
);
PrintXmlUnitTest
(
&
stream
,
unit_test
);
...
@@ -5283,12 +5276,9 @@ bool ParseGoogleTestFlag(const char* const arg) {
...
@@ -5283,12 +5276,9 @@ bool ParseGoogleTestFlag(const char* const arg) {
void
LoadFlagsFromFile
(
const
std
::
string
&
path
)
{
void
LoadFlagsFromFile
(
const
std
::
string
&
path
)
{
FILE
*
flagfile
=
posix
::
FOpen
(
path
.
c_str
(),
"r"
);
FILE
*
flagfile
=
posix
::
FOpen
(
path
.
c_str
(),
"r"
);
if
(
!
flagfile
)
{
if
(
!
flagfile
)
{
{
// scoped to ensure the log is flushed before we exit
GTEST_LOG_
(
FATAL
)
<<
"Unable to open file
\"
"
GTEST_LOG_
(
FATAL
)
<<
"Unable to open file
\"
"
<<
GTEST_FLAG
(
flagfile
)
<<
GTEST_FLAG
(
flagfile
)
<<
"
\"
"
;
<<
"
\"
"
;
}
exit
(
EXIT_FAILURE
);
}
}
std
::
string
contents
(
ReadEntireFile
(
flagfile
));
std
::
string
contents
(
ReadEntireFile
(
flagfile
));
posix
::
FClose
(
flagfile
);
posix
::
FClose
(
flagfile
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment