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

Issue 10382194: Add more API fuzzing and fix the issues encountered. (Closed)

Created:
8 years, 7 months ago by Mads Ager (google)
Modified:
8 years, 7 months ago
Reviewers:
Søren Gjesse
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add more API fuzzing and fix the issues encountered. - Fixed integer checks in a couple of places. - Added closed checks to async operations. More changes like this coming but I'm splitting the work up to not make the review too large. R=sgjesse@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=7683

Patch Set 1 #

Total comments: 8

Patch Set 2 : Address comments. #

Patch Set 3 : Actually address the comments. #

Patch Set 4 : Skip fuzz test in checked mode. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+297 lines, -199 lines) Patch
M runtime/bin/builtin_natives.cc View 1 1 chunk +3 lines, -1 line 0 comments Download
M runtime/bin/dartutils.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M runtime/bin/dartutils.cc View 1 1 chunk +13 lines, -0 lines 0 comments Download
M runtime/bin/file.cc View 1 2 28 chunks +152 lines, -182 lines 0 comments Download
M runtime/bin/file_impl.dart View 1 14 chunks +24 lines, -13 lines 0 comments Download
M runtime/bin/string_stream.dart View 1 chunk +5 lines, -1 line 0 comments Download
M tests/standalone/io/file_fuzz_test.dart View 3 chunks +96 lines, -2 lines 0 comments Download
M tests/standalone/standalone.status View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Mads Ager (google)
8 years, 7 months ago (2012-05-16 11:29:30 UTC) #1
Søren Gjesse
lgtm https://chromiumcodereview.appspot.com/10382194/diff/1/runtime/bin/file.cc File runtime/bin/file.cc (right): https://chromiumcodereview.appspot.com/10382194/diff/1/runtime/bin/file.cc#newcode137 runtime/bin/file.cc:137: ASSERT(file != NULL); How about adding a function ...
8 years, 7 months ago (2012-05-16 11:54:11 UTC) #2
Mads Ager (google)
8 years, 7 months ago (2012-05-16 12:45:19 UTC) #3
https://chromiumcodereview.appspot.com/10382194/diff/1/runtime/bin/file.cc
File runtime/bin/file.cc (right):

https://chromiumcodereview.appspot.com/10382194/diff/1/runtime/bin/file.cc#ne...
runtime/bin/file.cc:137: ASSERT(file != NULL);
On 2012/05/16 11:54:11, Søren Gjesse wrote:
> How about adding a function to do this
> 
> int64_t value;
> bool valid_argument = DartUtils::SetInt64Value(value_handle, &value);
> if (valid_argument) {
>   ...
> 
> 
> or even
> 
> 
> int64_t value;
> if (DartUtils::SetInt64Value(value_handle, &value)) {
>   ...

Maybe we should just change GetIntegerValue to do this. I have added a
GetInt64Value that checks. I have kept GetIntegerValue for now. I will phase out
its use going forward.

https://chromiumcodereview.appspot.com/10382194/diff/1/runtime/bin/file.cc#ne...
runtime/bin/file.cc:204: result =
On 2012/05/16 11:54:11, Søren Gjesse wrote:
> Fits one line?

Done.

https://chromiumcodereview.appspot.com/10382194/diff/1/runtime/bin/file.cc#ne...
runtime/bin/file.cc:230: DartUtils::GetIntegerValue(Dart_GetNativeArgument(args,
2));
On 2012/05/16 11:54:11, Søren Gjesse wrote:
> Shouldn't we check more here? DartUtils::GetIntegerValue use a number of
asserts
> - like for WriteByte above?

Oh, yes, here and many other places. I just haven't gotten around to this one
yet. I just change the file != NULL case to an assert. Stay tuned for this one.
:)

https://chromiumcodereview.appspot.com/10382194/diff/1/runtime/bin/file_impl....
File runtime/bin/file_impl.dart (right):

https://chromiumcodereview.appspot.com/10382194/diff/1/runtime/bin/file_impl....
runtime/bin/file_impl.dart:759: if (_isClosed) {
On 2012/05/16 11:54:11, Søren Gjesse wrote:
> Add a function for closed exception as 4 lines of code are repeated below.

Done. Each of these replaced by:

if (_isClosed) return _completeWithClosedException(completer);

Powered by Google App Engine
This is Rietveld 408576698