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

Side by Side Diff: tests/standalone/io/file_fuzz_test.dart

Issue 12504006: Make IOSink implement StringSink (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed second round of review comments Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // 'fuzz' test the file APIs by providing unexpected type arguments. The test 5 // 'fuzz' test the file APIs by providing unexpected type arguments. The test
6 // passes if the VM does not crash. 6 // passes if the VM does not crash.
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:io'; 9 import 'dart:io';
10 import 'dart:isolate'; 10 import 'dart:isolate';
11 11
12 import 'fuzz_support.dart'; 12 import 'fuzz_support.dart';
13 13
14 fuzzSyncMethods() { 14 fuzzSyncMethods() {
15 typeMapping.forEach((k, v) { 15 typeMapping.forEach((k, v) {
16 doItSync(() { 16 doItSync(() {
17 var f = new File(v); 17 var f = new File(v);
18 doItSync(f.existsSync); 18 doItSync(f.existsSync);
19 doItSync(f.createSync); 19 doItSync(f.createSync);
20 doItSync(f.deleteSync); 20 doItSync(f.deleteSync);
21 doItSync(f.directorySync); 21 doItSync(f.directorySync);
22 doItSync(f.lengthSync); 22 doItSync(f.lengthSync);
23 doItSync(f.modifiedSync); 23 doItSync(f.modifiedSync);
24 doItSync(f.fullPathSync); 24 doItSync(f.fullPathSync);
25 doItSync(() => f.openRead().listen(() {}, onError: (e) {})); 25 doItSync(() => f.openRead().listen(() {}, onError: (e) {}));
26 doItSync(f.readAsBytesSync); 26 doItSync(f.readAsBytesSync);
27 doItSync(f.readAsStringSync); 27 doItSync(f.readAsStringSync);
28 doItSync(f.readAsLinesSync); 28 doItSync(f.readAsLinesSync);
29 typeMapping.forEach((k2, v2) { 29 typeMapping.forEach((k2, v2) {
30 doItSync(() => f.openSync(v2)); 30 doItSync(() => f.openSync(v2));
31 doItSync(() => f.openWrite(v2)); 31 doItSync(() => f.openWrite(mode: v2));
32 doItSync(() => f.readAsStringSync(v2)); 32 doItSync(() => f.readAsStringSync(v2));
33 doItSync(() => f.readAsLinesSync(v2)); 33 doItSync(() => f.readAsLinesSync(v2));
34 }); 34 });
35 }); 35 });
36 }); 36 });
37 } 37 }
38 38
39 fuzzAsyncMethods() { 39 fuzzAsyncMethods() {
40 var port = new ReceivePort(); 40 var port = new ReceivePort();
41 var futures = []; 41 var futures = [];
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 temp.deleteSync(recursive: true); 119 temp.deleteSync(recursive: true);
120 }); 120 });
121 } 121 }
122 122
123 main() { 123 main() {
124 fuzzSyncMethods(); 124 fuzzSyncMethods();
125 fuzzAsyncMethods(); 125 fuzzAsyncMethods();
126 fuzzSyncRandomAccessMethods(); 126 fuzzSyncRandomAccessMethods();
127 fuzzAsyncRandomAccessMethods(); 127 fuzzAsyncRandomAccessMethods();
128 } 128 }
OLDNEW
« no previous file with comments | « tests/standalone/io/echo_server_stream_test.dart ('k') | tests/standalone/io/file_output_stream_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698