Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
f6dde80e
Commit
f6dde80e
authored
Sep 07, 2017
by
Gasprd Petit
Browse files
Removed flush scopes around GTEST_LOG(FATAL) and exit call since FATAL is expected to abort()
parent
ee53b281
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
16 deletions
+6
-16
googletest/src/gtest.cc
googletest/src/gtest.cc
+6
-16
No files found.
googletest/src/gtest.cc
View file @
f6dde80e
...
...
@@ -3449,12 +3449,8 @@ 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
);
}
}
// Called after the unit test ends.
...
...
@@ -3478,12 +3474,9 @@ 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
);
}
std
::
stringstream
stream
;
PrintXmlUnitTest
(
&
stream
,
unit_test
);
fprintf
(
xmlout
,
"%s"
,
StringStreamToString
(
&
stream
).
c_str
());
...
...
@@ -5283,13 +5276,10 @@ 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
);
}
std
::
string
contents
(
ReadEntireFile
(
flagfile
));
posix
::
FClose
(
flagfile
);
std
::
vector
<
std
::
string
>
lines
;
...
...
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