diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gtest-internal-inl.h | 2 | ||||
-rw-r--r-- | src/gtest.cc | 15 |
2 files changed, 9 insertions, 8 deletions
diff --git a/src/gtest-internal-inl.h b/src/gtest-internal-inl.h index 4e9805d1..350ade07 100644 --- a/src/gtest-internal-inl.h +++ b/src/gtest-internal-inl.h @@ -620,7 +620,7 @@ class GTEST_API_ UnitTestImpl { // For example, if Foo() calls Bar(), which in turn calls // CurrentOsStackTraceExceptTop(1), Foo() will be included in the // trace but Bar() and CurrentOsStackTraceExceptTop() won't. - String CurrentOsStackTraceExceptTop(int skip_count); + String CurrentOsStackTraceExceptTop(int skip_count) GTEST_NO_INLINE_; // Finds and returns a TestCase with the given name. If one doesn't // exist, creates one and returns it. diff --git a/src/gtest.cc b/src/gtest.cc index f2e84af7..56af6469 100644 --- a/src/gtest.cc +++ b/src/gtest.cc @@ -3271,16 +3271,17 @@ void XmlUnitTestResultPrinter::OutputXmlTestInfo(::std::ostream* stream, for (int i = 0; i < result.total_part_count(); ++i) { const TestPartResult& part = result.GetTestPartResult(i); if (part.failed()) { - if (++failures == 1) + if (++failures == 1) { *stream << ">\n"; - *stream << " <failure message=\"" - << EscapeXmlAttribute(part.summary()).c_str() - << "\" type=\"\">"; + } const string location = internal::FormatCompilerIndependentFileLocation( part.file_name(), part.line_number()); - const string message = location + "\n" + part.message(); - OutputXmlCDataSection(stream, - RemoveInvalidXmlCharacters(message).c_str()); + const string summary = location + "\n" + part.summary(); + *stream << " <failure message=\"" + << EscapeXmlAttribute(summary.c_str()) + << "\" type=\"\">"; + const string detail = location + "\n" + part.message(); + OutputXmlCDataSection(stream, RemoveInvalidXmlCharacters(detail).c_str()); *stream << "</failure>\n"; } } |