| 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 // Dart test program for testing native byte arrays. | 5 // Dart test program for testing native byte arrays. |
| 6 | 6 |
| 7 // Library tag to be able to run in html test framework. |
| 8 #library("ByteArrayTest.dart"); |
| 9 |
| 7 #import('dart:scalarlist'); | 10 #import('dart:scalarlist'); |
| 8 | 11 |
| 9 void testCreateByteArray() { | 12 void testCreateByteArray() { |
| 10 Uint8List byteArray; | 13 Uint8List byteArray; |
| 11 | 14 |
| 12 byteArray = new Uint8List(0); | 15 byteArray = new Uint8List(0); |
| 13 Expect.equals(0, byteArray.length); | 16 Expect.equals(0, byteArray.length); |
| 14 | 17 |
| 15 byteArray = new Uint8List(10); | 18 byteArray = new Uint8List(10); |
| 16 Expect.equals(10, byteArray.length); | 19 Expect.equals(10, byteArray.length); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 } | 79 } |
| 77 | 80 |
| 78 main() { | 81 main() { |
| 79 for (int i = 0; i < 2000; i++) { | 82 for (int i = 0; i < 2000; i++) { |
| 80 testCreateByteArray(); | 83 testCreateByteArray(); |
| 81 testSetRange(); | 84 testSetRange(); |
| 82 testIndexOutOfRange(); | 85 testIndexOutOfRange(); |
| 83 testIndexOf(); | 86 testIndexOf(); |
| 84 } | 87 } |
| 85 } | 88 } |
| OLD | NEW |