| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 #import("dart:io"); | 5 #import("dart:io"); |
| 6 | 6 |
| 7 class FileTest { | 7 class FileTest { |
| 8 static void testReadListInvalidArgs(buffer, offset, length) { | 8 static void testReadListInvalidArgs(buffer, offset, length) { |
| 9 String filename = getFilename("tests/vm/data/fixed_length_file"); | 9 String filename = getFilename("tests/vm/data/fixed_length_file"); |
| 10 var file = (new File(filename)).openSync(); | 10 var file = (new File(filename)).openSync(); |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 }; | 99 }; |
| 100 file.close(); | 100 file.close(); |
| 101 } | 101 } |
| 102 | 102 |
| 103 static String getFilename(String path) => | 103 static String getFilename(String path) => |
| 104 new File(path).existsSync() ? path : 'runtime/$path'; | 104 new File(path).existsSync() ? path : 'runtime/$path'; |
| 105 } | 105 } |
| 106 | 106 |
| 107 main() { | 107 main() { |
| 108 FileTest.testReadListInvalidArgs(12, 0, 1); | 108 FileTest.testReadListInvalidArgs(12, 0, 1); |
| 109 FileTest.testReadListInvalidArgs(new List(10), '0', 1); | 109 FileTest.testReadListInvalidArgs(new List.fixedLength(10), '0', 1); |
| 110 FileTest.testReadListInvalidArgs(new List(10), 0, '1'); | 110 FileTest.testReadListInvalidArgs(new List.fixedLength(10), 0, '1'); |
| 111 FileTest.testWriteByteInvalidArgs('asdf'); | 111 FileTest.testWriteByteInvalidArgs('asdf'); |
| 112 FileTest.testWriteListInvalidArgs(12, 0, 1); | 112 FileTest.testWriteListInvalidArgs(12, 0, 1); |
| 113 FileTest.testWriteListInvalidArgs(new List(10), '0', 1); | 113 FileTest.testWriteListInvalidArgs(new List.fixedLength(10), '0', 1); |
| 114 FileTest.testWriteListInvalidArgs(new List(10), 0, '1'); | 114 FileTest.testWriteListInvalidArgs(new List.fixedLength(10), 0, '1'); |
| 115 } | 115 } |
| OLD | NEW |