| Index: base/test/gtest_xml_unittest_result_printer.cc
|
| diff --git a/base/test/gtest_xml_unittest_result_printer.cc b/base/test/gtest_xml_unittest_result_printer.cc
|
| index 31ac4ad39c70490f810083f6622021a2a34e1b9f..6ce4fdecf3fcddd2487f5e529e56f86d00f1a2e3 100644
|
| --- a/base/test/gtest_xml_unittest_result_printer.cc
|
| +++ b/base/test/gtest_xml_unittest_result_printer.cc
|
| @@ -35,14 +35,6 @@
|
| return true;
|
| }
|
|
|
| -void XmlUnitTestResultPrinter::OnAssert(const char* file,
|
| - int line,
|
| - const std::string& summary,
|
| - const std::string& message) {
|
| - WriteTestPartResult(file, line, testing::TestPartResult::kFatalFailure,
|
| - summary, message);
|
| -}
|
| -
|
| void XmlUnitTestResultPrinter::OnTestCaseStart(
|
| const testing::TestCase& test_case) {
|
| fprintf(output_file_, " <testsuite>\n");
|
| @@ -74,10 +66,7 @@
|
| " <failure message=\"\" type=\"\"></failure>\n");
|
| }
|
| for (int i = 0; i < test_info.result()->total_part_count(); ++i) {
|
| - const auto& test_part_result = test_info.result()->GetTestPartResult(i);
|
| - WriteTestPartResult(test_part_result.file_name(),
|
| - test_part_result.line_number(), test_part_result.type(),
|
| - test_part_result.summary(), test_part_result.message());
|
| + WriteTestPartResult(test_info.result()->GetTestPartResult(i));
|
| }
|
| fprintf(output_file_, " </testcase>\n");
|
| fflush(output_file_);
|
| @@ -90,13 +79,9 @@
|
| }
|
|
|
| void XmlUnitTestResultPrinter::WriteTestPartResult(
|
| - const char* file,
|
| - int line,
|
| - testing::TestPartResult::Type result_type,
|
| - const std::string& summary,
|
| - const std::string& message) {
|
| + const testing::TestPartResult& test_part_result) {
|
| const char* type = "unknown";
|
| - switch (result_type) {
|
| + switch (test_part_result.type()) {
|
| case testing::TestPartResult::kSuccess:
|
| type = "success";
|
| break;
|
| @@ -107,8 +92,10 @@
|
| type = "fatal_failure";
|
| break;
|
| }
|
| + std::string summary = test_part_result.summary();
|
| std::string summary_encoded;
|
| Base64Encode(summary, &summary_encoded);
|
| + std::string message = test_part_result.message();
|
| std::string message_encoded;
|
| Base64Encode(message, &message_encoded);
|
| fprintf(output_file_,
|
| @@ -116,7 +103,8 @@
|
| " <summary>%s</summary>\n"
|
| " <message>%s</message>\n"
|
| " </x-test-result-part>\n",
|
| - type, file, line, summary_encoded.c_str(), message_encoded.c_str());
|
| + type, test_part_result.file_name(), test_part_result.line_number(),
|
| + summary_encoded.c_str(), message_encoded.c_str());
|
| fflush(output_file_);
|
| }
|
|
|
|
|