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

Issue 2710003005: [test.dart] Complain if there is non-utf8 formatted data in test output (Closed)

Created:
3 years, 10 months ago by zra
Modified:
3 years, 9 months ago
CC:
reviews_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

[test.dart] Complain if there is non-utf8 formatted data in test output related #28872

Patch Set 1 #

Total comments: 2

Patch Set 2 : Add missing file #

Patch Set 3 : Address comment #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+80 lines, -14 lines) Patch
M tests/standalone/io/console_unicode_test.dart View 1 chunk +8 lines, -9 lines 0 comments Download
A tests/standalone/io/non_utf8_output_test.dart View 1 1 chunk +13 lines, -0 lines 0 comments Download
M tests/standalone/standalone.status View 1 2 2 chunks +7 lines, -1 line 0 comments Download
M tools/testing/dart/status_file_parser.dart View 2 chunks +2 lines, -0 lines 0 comments Download
M tools/testing/dart/test_runner.dart View 1 2 15 chunks +50 lines, -4 lines 3 comments Download

Messages

Total messages: 13 (3 generated)
zra
3 years, 10 months ago (2017-02-23 18:34:54 UTC) #2
ahe
lgtm https://codereview.chromium.org/2710003005/diff/1/tools/testing/dart/test_runner.dart File tools/testing/dart/test_runner.dart (right): https://codereview.chromium.org/2710003005/diff/1/tools/testing/dart/test_runner.dart#newcode1803 tools/testing/dart/test_runner.dart:1803: hasNonUtf8 = true; How about: String malformed = ...
3 years, 10 months ago (2017-02-23 18:46:21 UTC) #4
zra
https://codereview.chromium.org/2710003005/diff/1/tools/testing/dart/test_runner.dart File tools/testing/dart/test_runner.dart (right): https://codereview.chromium.org/2710003005/diff/1/tools/testing/dart/test_runner.dart#newcode1803 tools/testing/dart/test_runner.dart:1803: hasNonUtf8 = true; On 2017/02/23 18:46:20, ahe wrote: > ...
3 years, 10 months ago (2017-02-23 21:24:50 UTC) #5
kustermann
Would you mind explaining what this is for? If we have tests which output non-utf8 ...
3 years, 10 months ago (2017-02-24 16:24:17 UTC) #6
zra
On 2017/02/24 16:24:17, kustermann wrote: > Would you mind explaining what this is for? If ...
3 years, 10 months ago (2017-02-24 17:50:03 UTC) #7
ahe
On 2017/02/24 17:50:03, zra wrote: > On 2017/02/24 16:24:17, kustermann wrote: > > Would you ...
3 years, 10 months ago (2017-02-25 10:42:07 UTC) #8
ahe
On 2017/02/24 17:50:03, zra wrote: > On 2017/02/24 16:24:17, kustermann wrote: > > Would you ...
3 years, 10 months ago (2017-02-25 10:44:57 UTC) #9
kustermann
Since you two agree, I suggest you just go ahead and land it. > > ...
3 years, 10 months ago (2017-02-25 11:37:48 UTC) #10
zra
This change landed, but the codereview site didn't catch it because of the authentication problems ...
3 years, 9 months ago (2017-02-27 19:05:58 UTC) #11
Florian Schneider
3 years, 9 months ago (2017-03-02 22:57:46 UTC) #12
On 2017/02/27 19:05:58, zra wrote:
> This change landed, but the codereview site didn't catch it because of the
> authentication problems last week.
> 

dbc: You can manually close the rietveld issue in "Edit issue".

>
https://codereview.chromium.org/2710003005/diff/40001/tools/testing/dart/test...
> File tools/testing/dart/test_runner.dart (right):
> 
>
https://codereview.chromium.org/2710003005/diff/40001/tools/testing/dart/test...
> tools/testing/dart/test_runner.dart:1806: ..addAll(malformed.codeUnits)
> On 2017/02/25 11:37:48, kustermann wrote:
> > On 2017/02/24 16:24:17, kustermann wrote:
> > > The input 'List<int> data' here is a list of bytes (i.e. the entries are 0
> <=
> > > value <= 255).
> > > 
> > > Here you add codeUnits, which are not bytes but rather UTF16 code points
(as
> > far
> > > as I know).
> > > 
> > > The places where this list is used use UTF8.decode(data) which assumes
> [data]
> > > contains only bytes / 8-bit values.
> > > 
> > > 
> > > (Maybe this should have been written using a BytesBuilder and Utf8List
> instead
> > > to make this more clear and avoid having these growable Lists with Smis in
> > > them.)
> > 
> > To clarify, what I mean is changing:
> > 
> >   data..clear()..addAll(malformed.codeUnits)
> > 
> > to 
> > 
> >   data..clear()..addAll(UTF8.encode(malformed))
> > 
> > 
> > Because later on code will do
> > 
> > UTF8.decode(testCase.lastCommandOutput.stdout /* = data */ )
> > 
> > and UTF8.decode() takes only bytes, not UTF16 code points.
> 
> Making this fix here: https://codereview.chromium.org/2721683002/

Powered by Google App Engine
This is Rietveld 408576698