| 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 int arrays. | 5 // Dart test program for testing native int arrays. |
| 6 | 6 |
| 7 // Library tag to be able to run in html test framework. | 7 // Library tag to be able to run in html test framework. |
| 8 library IntArrayTest; | 8 library IntArrayTest; |
| 9 | 9 |
| 10 import "package:expect/expect.dart"; |
| 10 import 'dart:typeddata'; | 11 import 'dart:typeddata'; |
| 11 | 12 |
| 12 void testInt16() { | 13 void testInt16() { |
| 13 Int16List intArray = new Int16List(4); | 14 Int16List intArray = new Int16List(4); |
| 14 intArray[0] = 0; | 15 intArray[0] = 0; |
| 15 intArray[1] = -1; | 16 intArray[1] = -1; |
| 16 intArray[2] = -2; | 17 intArray[2] = -2; |
| 17 intArray[3] = -3; | 18 intArray[3] = -3; |
| 18 for (int i = 0; i < intArray.length; i++) { | 19 for (int i = 0; i < intArray.length; i++) { |
| 19 intArray[i]++; | 20 intArray[i]++; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 testUint64ToSmi(); | 131 testUint64ToSmi(); |
| 131 for (int i = 0; i < 2000; i++) { | 132 for (int i = 0; i < 2000; i++) { |
| 132 testInt16(); | 133 testInt16(); |
| 133 testUint16(); | 134 testUint16(); |
| 134 testInt32ToSmi(); | 135 testInt32ToSmi(); |
| 135 testUint32ToSmi(); | 136 testUint32ToSmi(); |
| 136 testInt64ToSmi(); | 137 testInt64ToSmi(); |
| 137 testUint64ToSmi(); | 138 testUint64ToSmi(); |
| 138 } | 139 } |
| 139 } | 140 } |
| OLD | NEW |