Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Issue 1561813002: [Spellcheck] Fixed subtly broken test. (Closed)

Created:
4 years, 11 months ago by groby-ooo-7-16
Modified:
4 years, 11 months ago
Reviewers:
Nico
CC:
chromium-reviews, groby+spellwatch_chromium.org, rlp+watch_chromium.org, rouslan+spell_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Spellcheck] Fixed subtly broken test. The test in question was passing, but still contained broken code. See https://codereview.chromium.org/1269343005/ for a discussion of the issue. BUG=5102 Committed: https://crrev.com/78982c99403e54d61160a6f6a68d9b3be1f36697 Cr-Commit-Position: refs/heads/master@{#367752}

Patch Set 1 : Fix broken loop and add test detecting it #

Patch Set 2 : More compact test cases. #

Patch Set 3 : Factor out helper function. #

Patch Set 4 : Simplify helper function. #

Patch Set 5 : actual_end should really be named actual_len #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+45 lines, -56 lines) Patch
M chrome/renderer/spellchecker/spellcheck_worditerator_unittest.cc View 1 2 3 4 6 chunks +45 lines, -56 lines 3 comments Download

Messages

Total messages: 13 (5 generated)
groby-ooo-7-16
PTAL - it fixes the issue you highlighted in https://codereview.chromium.org/1269343005/ That's the first patch set. ...
4 years, 11 months ago (2016-01-05 23:34:54 UTC) #3
Nico
lgtm, thanks for the quick fix! https://codereview.chromium.org/1561813002/diff/80001/chrome/renderer/spellchecker/spellcheck_worditerator_unittest.cc File chrome/renderer/spellchecker/spellcheck_worditerator_unittest.cc (right): https://codereview.chromium.org/1561813002/diff/80001/chrome/renderer/spellchecker/spellcheck_worditerator_unittest.cc#newcode42 chrome/renderer/spellchecker/spellcheck_worditerator_unittest.cc:42: status = iterator->GetNextWord(word_string, ...
4 years, 11 months ago (2016-01-06 01:38:26 UTC) #4
groby-ooo-7-16
Unless the do-while thing is tremendously important to you, I think I'll land as-is. Purely ...
4 years, 11 months ago (2016-01-06 01:48:38 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1561813002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1561813002/80001
4 years, 11 months ago (2016-01-06 02:28:24 UTC) #7
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 11 months ago (2016-01-06 02:35:19 UTC) #9
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/78982c99403e54d61160a6f6a68d9b3be1f36697 Cr-Commit-Position: refs/heads/master@{#367752}
4 years, 11 months ago (2016-01-06 02:36:05 UTC) #11
Nico
Please land as is. But: https://codereview.chromium.org/1561813002/diff/80001/chrome/renderer/spellchecker/spellcheck_worditerator_unittest.cc File chrome/renderer/spellchecker/spellcheck_worditerator_unittest.cc (right): https://codereview.chromium.org/1561813002/diff/80001/chrome/renderer/spellchecker/spellcheck_worditerator_unittest.cc#newcode42 chrome/renderer/spellchecker/spellcheck_worditerator_unittest.cc:42: status = iterator->GetNextWord(word_string, word_start, ...
4 years, 11 months ago (2016-01-06 02:36:16 UTC) #12
groby-ooo-7-16
4 years, 11 months ago (2016-01-06 18:56:00 UTC) #13
Message was sent while issue was closed.
On 2016/01/06 02:36:16, Nico wrote:
> Please land as is. But:
> 
>
https://codereview.chromium.org/1561813002/diff/80001/chrome/renderer/spellch...
> File chrome/renderer/spellchecker/spellcheck_worditerator_unittest.cc (right):
> 
>
https://codereview.chromium.org/1561813002/diff/80001/chrome/renderer/spellch...
> chrome/renderer/spellchecker/spellcheck_worditerator_unittest.cc:42: status =
> iterator->GetNextWord(word_string, word_start, word_length);
> On 2016/01/06 01:48:37, groby wrote:
> > On 2016/01/06 01:38:26, Nico wrote:
> > > with a do-while loop you don't need to initialize status to a default
> > True, but it's one more line :) See below:
> > 
> > Status status;
> > do {
> >   status = GetNext();
> > } while (status == IS_SKIPPABLE);
> > 
> > vs.
> > 
> > Status status = SKIPPABLE
> > while (status == SKPPABLE)
> >   status = GetNext();
> > 
> > I could've of course opted for the *truly* horrible solution ;)
> > 
> > Status status;
> > for (;(status=GetNext()) == IS_SKIPPABLE;) {}
> > 
> 
> <s>More horrible</s>You don't need the parens:
> 
>   Status status;
>   do status = GetNext();
>   while (status == IS_SKIPPABLE);

You know.... The style guide is not entirely clear on the formatting. And
there's a variant that almost makes sense:

  do status = GetNext(); while (status == IS_SKIPPABLE);

Alas, the line is too long due to IS_SKIPPABLE being qualified, and the variable
names being too long. And git cl format actually doesn't even like your version,
the do has to be on a separate line.

I can't believe I actually spent time checking this - best bikeshed of 2016
contender :)

Powered by Google App Engine
This is Rietveld 408576698