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

Unified Diff: tests/standalone/io/file_invalid_arguments_test.dart

Issue 14018007: Rename RandomAccessFile.readList and RandomAccessFile.writeList to RandomAccessFile.readInto and Ra… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/standalone/io/file_fuzz_test.dart ('k') | tests/standalone/io/file_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/file_invalid_arguments_test.dart
diff --git a/tests/standalone/io/file_invalid_arguments_test.dart b/tests/standalone/io/file_invalid_arguments_test.dart
index 1406290934e676d6a26c7636af278c7c9caa3284..cea8a134df95f05097dc9b99de90668cd9b1bc85 100644
--- a/tests/standalone/io/file_invalid_arguments_test.dart
+++ b/tests/standalone/io/file_invalid_arguments_test.dart
@@ -33,12 +33,12 @@ void testReadInvalidArgs(arg) {
});
}
-void testReadListInvalidArgs(buffer, offset, length) {
+void testReadIntoInvalidArgs(buffer, start, end) {
var port = new ReceivePort();
String filename = getFilename("tests/vm/data/fixed_length_file");
var file = (new File(filename)).openSync();
try {
- file.readListSync(buffer, offset, length);
+ file.readIntoSync(buffer, start, end);
Expect.fail('exception expected');
} catch (e) {
Expect.isTrue(e is FileIOException);
@@ -46,8 +46,8 @@ void testReadListInvalidArgs(buffer, offset, length) {
}
var errors = 0;
- var readListFuture = file.readList(buffer, offset, length);
- readListFuture.then((bytes) {
+ var readIntoFuture = file.readInto(buffer, start, end);
+ readIntoFuture.then((bytes) {
Expect.fail('exception expected');
}).catchError((e) {
errors++;
@@ -84,20 +84,20 @@ void testWriteByteInvalidArgs(value) {
});
}
-void testWriteListInvalidArgs(buffer, offset, bytes) {
+void testWriteFromInvalidArgs(buffer, start, end) {
var port = new ReceivePort();
String filename = getFilename("tests/vm/data/fixed_length_file");
var file = (new File("${filename}_out")).openSync(mode: FileMode.WRITE);
try {
- file.writeListSync(buffer, offset, bytes);
+ file.writeFromSync(buffer, start, end);
Expect.fail('exception expected');
} catch (e) {
Expect.isTrue(e is FileIOException);
Expect.isTrue(e.toString().contains('Invalid arguments'));
}
- var writeListFuture = file.writeList(buffer, offset, bytes);
- writeListFuture.then((ignore) {
+ var writeFromFuture = file.writeFrom(buffer, start, end);
+ writeFromFuture.then((ignore) {
Expect.fail('exception expected');
}).catchError((s) {
Expect.isTrue(s.error is FileIOException);
@@ -136,12 +136,12 @@ String getFilename(String path) {
main() {
testReadInvalidArgs('asdf');
- testReadListInvalidArgs(12, 0, 1);
- testReadListInvalidArgs(new List(10), '0', 1);
- testReadListInvalidArgs(new List(10), 0, '1');
+ testReadIntoInvalidArgs(12, 0, 1);
+ testReadIntoInvalidArgs(new List(10), '0', 1);
+ testReadIntoInvalidArgs(new List(10), 0, '1');
testWriteByteInvalidArgs('asdf');
- testWriteListInvalidArgs(12, 0, 1);
- testWriteListInvalidArgs(new List(10), '0', 1);
- testWriteListInvalidArgs(new List(10), 0, '1');
+ testWriteFromInvalidArgs(12, 0, 1);
+ testWriteFromInvalidArgs(new List(10), '0', 1);
+ testWriteFromInvalidArgs(new List(10), 0, '1');
testWriteStringInvalidArgs("Hello, world", 42);
}
« no previous file with comments | « tests/standalone/io/file_fuzz_test.dart ('k') | tests/standalone/io/file_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698