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 "package:expect/expect.dart"; |
11 import 'dart:typeddata'; | 11 import 'dart:typed_data'; |
12 | 12 |
13 void testInt16() { | 13 void testInt16() { |
14 Int16List intArray = new Int16List(4); | 14 Int16List intArray = new Int16List(4); |
15 intArray[0] = 0; | 15 intArray[0] = 0; |
16 intArray[1] = -1; | 16 intArray[1] = -1; |
17 intArray[2] = -2; | 17 intArray[2] = -2; |
18 intArray[3] = -3; | 18 intArray[3] = -3; |
19 for (int i = 0; i < intArray.length; i++) { | 19 for (int i = 0; i < intArray.length; i++) { |
20 intArray[i]++; | 20 intArray[i]++; |
21 } | 21 } |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 testUint64ToSmi(); | 131 testUint64ToSmi(); |
132 for (int i = 0; i < 2000; i++) { | 132 for (int i = 0; i < 2000; i++) { |
133 testInt16(); | 133 testInt16(); |
134 testUint16(); | 134 testUint16(); |
135 testInt32ToSmi(); | 135 testInt32ToSmi(); |
136 testUint32ToSmi(); | 136 testUint32ToSmi(); |
137 testInt64ToSmi(); | 137 testInt64ToSmi(); |
138 testUint64ToSmi(); | 138 testUint64ToSmi(); |
139 } | 139 } |
140 } | 140 } |
OLD | NEW |