OLD | NEW |
1 // Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 import 'package:expect/expect.dart'; | 5 import 'package:expect/expect.dart'; |
6 import 'package:file/file.dart'; | 6 import 'package:file/file.dart'; |
7 | 7 |
8 // This test: | 8 // This test: |
9 // * makes heap budget 1MB | 9 // * makes heap budget 1MB |
10 // * allocates 4 GB of external memory in chunks of 1MB | 10 // * allocates 4 GB of external memory in chunks of 1MB |
11 // Without tracking external memory, this test will consume 4 GB of memory and | 11 // Without tracking external memory, this test will consume 4 GB of memory and |
(...skipping 11 matching lines...) Expand all Loading... |
23 | 23 |
24 int size = 0; | 24 int size = 0; |
25 while (size < kTotalSize) { | 25 while (size < kTotalSize) { |
26 var bytes = file.read(kChunkSize).asUint8List(); | 26 var bytes = file.read(kChunkSize).asUint8List(); |
27 Expect.equals(bytes.length, kChunkSize); | 27 Expect.equals(bytes.length, kChunkSize); |
28 size += bytes.length; | 28 size += bytes.length; |
29 } | 29 } |
30 | 30 |
31 file.close(); | 31 file.close(); |
32 } | 32 } |
OLD | NEW |