|
|
Created:
5 years, 8 months ago by ncarter (slow) Modified:
5 years, 8 months ago CC:
chromium-reviews, erikwright+watch_chromium.org Base URL:
https://chromium.googlesource.com/chromium/src.git@lucasfix Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
Descriptionbase/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
Committed: https://crrev.com/0fbbee21cbea17a544c30b6d5e769f9e4ba8ad44
Cr-Commit-Position: refs/heads/master@{#325512}
Patch Set 1 #Patch Set 2 : Remove UTF8 DCHECK from SplitStringDontTrim #
Total comments: 3
Messages
Total messages: 27 (9 generated)
nick@chromium.org changed reviewers: + phajdan.jr@chromium.org
Pawel, please review! Thanks.
LGTM, thanks!
The CQ bit was checked by nick@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1081493002/1
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_asan_rel on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by nick@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1081493002/1
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_asan_rel on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
ncarter@google.com changed reviewers: + ncarter@google.com
Pawel, any idea what's going on with the cq failure on this patch? I think it might be a real failure (the formatting change broke some parse of the output results later on) but I haven't connected the dots.
Nevermind -- I think I see what's happening now; we're hitting a dcheck in SplitStringDontTrim, and I'll figure it out.
thakis: please take a look I've removed the IsUTF8 check here after determining it to be unnecessary. Whether it's extended ascii or UTF-8, we can strip whitespace and split along newlines all the same. SplitString and SplitStringDontTrim share an implementation, so what's valid input for the former should be valid for the latter. At least test on the linux asan bot generates stdio which is not valid UTF-8, though I don't know why this is. Archaeological research shows this DCHECK to have been introduced during a file-move of this function, as part of https://codereview.chromium.org/3366011 .
nick@chromium.org changed reviewers: + thakis@chromium.org
nico: ping
This was the first time this showed up in my mailbox. Maybe you didn't add me to reviewers until the ping? The test launcher change looks fine, the split change doesn't. https://codereview.chromium.org/1081493002/diff/20001/base/strings/string_spl... File base/strings/string_split.cc (left): https://codereview.chromium.org/1081493002/diff/20001/base/strings/string_spl... base/strings/string_split.cc:196: DCHECK(IsStringUTF8(str)); This change looks both unrelated and incorrect. (`c` is a single byte, so this'll only work for utf-8)
https://codereview.chromium.org/1081493002/diff/20001/base/strings/string_spl... File base/strings/string_split.cc (left): https://codereview.chromium.org/1081493002/diff/20001/base/strings/string_spl... base/strings/string_split.cc:196: DCHECK(IsStringUTF8(str)); On 2015/04/16 17:05:24, Nico wrote: > This change looks both unrelated and incorrect. (`c` is a single byte, so > this'll only work for utf-8) "only work for UTF-8" as opposed to what? Did you see my message where I explained that it's both related and correct? Here's what I wrote: === I've removed the IsUTF8 check here after determining it to be unnecessary. Whether it's extended ascii or UTF-8, we can strip whitespace and split along newlines all the same. SplitString and SplitStringDontTrim share an implementation, so what's valid input for the former should be valid for the latter. At least test on the linux asan bot generates stdio which is not valid UTF-8, though I don't know why this is. Archaeological research shows this DCHECK to have been introduced during a file-move of this function, as part of https://codereview.chromium.org/3366011 . ===
https://codereview.chromium.org/1081493002/diff/20001/base/strings/string_spl... File base/strings/string_split.cc (left): https://codereview.chromium.org/1081493002/diff/20001/base/strings/string_spl... base/strings/string_split.cc:196: DCHECK(IsStringUTF8(str)); On 2015/04/16 18:08:00, ncarter wrote: > On 2015/04/16 17:05:24, Nico wrote: > > This change looks both unrelated and incorrect. (`c` is a single byte, so > > this'll only work for utf-8) > > "only work for UTF-8" as opposed to what? > > Did you see my message where I explained that it's both related and correct? > Here's what I wrote: > > === > > I've removed the IsUTF8 check here after determining it to be unnecessary. > Whether it's extended ascii or UTF-8, we can strip whitespace and split along > newlines all the same. SplitString and SplitStringDontTrim share an > implementation, so what's valid input for the former should be valid for the > latter. > > At least test on the linux asan bot generates stdio which is not valid UTF-8, > though I don't know why this is. > > Archaeological research shows this DCHECK to have been introduced during a > file-move of this function, as part of https://codereview.chromium.org/3366011 . > > === And oh, to understand the relationship: see the failed tryjob on patchset 1.
On Thu, Apr 16, 2015 at 11:08 AM, <nick@chromium.org> wrote: > > https://codereview.chromium.org/1081493002/diff/20001/ > base/strings/string_split.cc > File base/strings/string_split.cc (left): > > https://codereview.chromium.org/1081493002/diff/20001/ > base/strings/string_split.cc#oldcode196 > base/strings/string_split.cc:196: DCHECK(IsStringUTF8(str)); > On 2015/04/16 17:05:24, Nico wrote: > >> This change looks both unrelated and incorrect. (`c` is a single byte, >> > so > >> this'll only work for utf-8) >> > > "only work for UTF-8" as opposed to what? > utf-16…oh, this takes a string and isn't a template function. Nevermind then, lgtm. > > Did you see my message where I explained that it's both related and > correct? No. As I said, all I got for this review was "nico: ping". > Here's what I wrote: > > === > > I've removed the IsUTF8 check here after determining it to be > unnecessary. > Whether it's extended ascii or UTF-8, we can strip whitespace and split > along > newlines all the same. SplitString and SplitStringDontTrim share an > implementation, so what's valid input for the former should be valid for > the > latter. > > At least test on the linux asan bot generates stdio which is not valid > UTF-8, > though I don't know why this is. > > Archaeological research shows this DCHECK to have been introduced during > a > file-move of this function, as part of > https://codereview.chromium.org/3366011 . > :-( > > === > > https://codereview.chromium.org/1081493002/ > To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
lgtm from rietveld too
The CQ bit was checked by nick@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from phajdan.jr@chromium.org Link to the patchset: https://codereview.chromium.org/1081493002/#ps20001 (title: "Remove UTF8 DCHECK from SplitStringDontTrim")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1081493002/20001
Message was sent while issue was closed.
Committed patchset #2 (id:20001)
Message was sent while issue was closed.
Patchset 2 (id:??) landed as https://crrev.com/0fbbee21cbea17a544c30b6d5e769f9e4ba8ad44 Cr-Commit-Position: refs/heads/master@{#325512} |