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.dart"); | 8 library IntArrayTest; |
9 | 9 |
10 #import('dart:scalarlist'); | 10 import 'dart:scalarlist'; |
11 | 11 |
12 void testInt32ToSmi() { | 12 void testInt32ToSmi() { |
13 Int32List intArray; | 13 Int32List intArray; |
14 | 14 |
15 intArray = new Int32List(4); | 15 intArray = new Int32List(4); |
16 intArray[0] = 1073741823; // SmiMax | 16 intArray[0] = 1073741823; // SmiMax |
17 intArray[1] = -1073741824; // SmiMin | 17 intArray[1] = -1073741824; // SmiMin |
18 intArray[2] = 1073741824; // SmiMax+1 | 18 intArray[2] = 1073741824; // SmiMax+1 |
19 intArray[3] = -1073741825; // SmiMin-1 | 19 intArray[3] = -1073741825; // SmiMin-1 |
20 var x = intArray[0]; | 20 var x = intArray[0]; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 main() { | 86 main() { |
87 testUint64ToSmi(); | 87 testUint64ToSmi(); |
88 return; | 88 return; |
89 for (int i = 0; i < 2000; i++) { | 89 for (int i = 0; i < 2000; i++) { |
90 testInt32ToSmi(); | 90 testInt32ToSmi(); |
91 testUint32ToSmi(); | 91 testUint32ToSmi(); |
92 testInt64ToSmi(); | 92 testInt64ToSmi(); |
93 testUint64ToSmi(); | 93 testUint64ToSmi(); |
94 } | 94 } |
95 } | 95 } |
OLD | NEW |