summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornick <nick@chromium.org>2015-04-16 13:58:35 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-16 20:58:46 +0000
commit0fbbee21cbea17a544c30b6d5e769f9e4ba8ad44 (patch)
treeb4397794a61e77e30bb5e314c7ff8320203553d5
parentd362de5b7d8aeb07523546f740244a24df85ab1d (diff)
downloadchromium_src-0fbbee21cbea17a544c30b6d5e769f9e4ba8ad44.zip
chromium_src-0fbbee21cbea17a544c30b6d5e769f9e4ba8ad44.tar.gz
chromium_src-0fbbee21cbea17a544c30b6d5e769f9e4ba8ad44.tar.bz2
base/test/launcher: Don't trim leading whitespace from test output
base/strings: Remove an unnecessary UTF8 check from one of the trim functions gtest's message often use leading whitespace in a way that's visually meaningful. Some examples: ======== EXPECT_EQ(this, this+1); my_test.cc(2048): error: Value of: this+1 Actual: 24F8B8D4 Expected: this Which is: 24F8B8A0 ======== ======== EXPECT_EQ("AA\nBB\nDD", std::string("AA\nXX\nDD")); my_test.cc(2049): error: Value of: std::string("AA\nXX\nDD") Actual: "AA\nXX\nDD" Expected: "AA\nBB\nDD" With diff: @@ -1,3 +1,3 @@ AA -BB +XX DD ======== Today leading whitespaces are stripped out by the test launcher, leading to less readable test stdout on the bots (and headaches, especially, if the 'AA' value in the example above had leading whitespace itself -- which is how I noticed this). The current whitespace trimming seems to be an accidental effect of [https://codereview.chromium.org/324893004], so it should be safe to change back. BUG=475265 Review URL: https://codereview.chromium.org/1081493002 Cr-Commit-Position: refs/heads/master@{#325512}
-rw-r--r--base/strings/string_split.cc2
-rw-r--r--base/test/launcher/test_launcher.cc2
2 files changed, 1 insertions, 3 deletions
diff --git a/base/strings/string_split.cc b/base/strings/string_split.cc
index 692f300..88a6236 100644
--- a/base/strings/string_split.cc
+++ b/base/strings/string_split.cc
@@ -6,7 +6,6 @@
#include "base/logging.h"
#include "base/strings/string_util.h"
-#include "base/strings/utf_string_conversions.h"
#include "base/third_party/icu/icu_utf.h"
namespace base {
@@ -193,7 +192,6 @@ void SplitStringDontTrim(const string16& str,
void SplitStringDontTrim(const std::string& str,
char c,
std::vector<std::string>* r) {
- DCHECK(IsStringUTF8(str));
#if CHAR_MIN < 0
DCHECK_GE(c, 0);
#endif
diff --git a/base/test/launcher/test_launcher.cc b/base/test/launcher/test_launcher.cc
index ac79d75..521f69c 100644
--- a/base/test/launcher/test_launcher.cc
+++ b/base/test/launcher/test_launcher.cc
@@ -570,7 +570,7 @@ void TestLauncher::OnTestFinished(const TestResult& result) {
}
if (print_snippet) {
std::vector<std::string> snippet_lines;
- SplitString(result.output_snippet, '\n', &snippet_lines);
+ SplitStringDontTrim(result.output_snippet, '\n', &snippet_lines);
if (snippet_lines.size() > kOutputSnippetLinesLimit) {
size_t truncated_size = snippet_lines.size() - kOutputSnippetLinesLimit;
snippet_lines.erase(