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

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

Issue 25666015: Fix remaining uses of Directory.systemTemp outside test scripts. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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
« no previous file with comments | « sdk/lib/core/object.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, 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 10
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 for (var p in typePermutations(3)) { 81 for (var p in typePermutations(3)) {
82 doItSync(() => opened.readIntoSync(p[0], p[1], p[2])); 82 doItSync(() => opened.readIntoSync(p[0], p[1], p[2]));
83 doItSync(() => opened.writeFromSync(p[0], p[1], p[2])); 83 doItSync(() => opened.writeFromSync(p[0], p[1], p[2]));
84 } 84 }
85 opened.closeSync(); 85 opened.closeSync();
86 } 86 }
87 temp.deleteSync(recursive: true); 87 temp.deleteSync(recursive: true);
88 } 88 }
89 89
90 fuzzAsyncRandomAccessMethods() { 90 fuzzAsyncRandomAccessMethods() {
91 var d = new Directory('');
92 var temp = Directory.systemTemp.createTempSync('dart_file_fuzz'); 91 var temp = Directory.systemTemp.createTempSync('dart_file_fuzz');
93 var file = new File('${temp.path}/x'); 92 var file = new File('${temp.path}/x');
94 file.createSync(); 93 file.createSync();
95 var modes = [ FileMode.READ, FileMode.WRITE, FileMode.APPEND ]; 94 var modes = [ FileMode.READ, FileMode.WRITE, FileMode.APPEND ];
96 var futures = []; 95 var futures = [];
97 var openedFiles = []; 96 var openedFiles = [];
98 for (var m in modes) { 97 for (var m in modes) {
99 var opened = file.openSync(mode: m); 98 var opened = file.openSync(mode: m);
100 openedFiles.add(opened); 99 openedFiles.add(opened);
101 typeMapping.forEach((k, v) { 100 typeMapping.forEach((k, v) {
(...skipping 16 matching lines...) Expand all
118 temp.deleteSync(recursive: true); 117 temp.deleteSync(recursive: true);
119 }); 118 });
120 } 119 }
121 120
122 main() { 121 main() {
123 fuzzSyncMethods(); 122 fuzzSyncMethods();
124 fuzzAsyncMethods(); 123 fuzzAsyncMethods();
125 fuzzSyncRandomAccessMethods(); 124 fuzzSyncRandomAccessMethods();
126 fuzzAsyncRandomAccessMethods(); 125 fuzzAsyncRandomAccessMethods();
127 } 126 }
OLDNEW
« no previous file with comments | « sdk/lib/core/object.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698