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 // A test to compare the results of the fixnum library with the Dart VM | 5 // A test to compare the results of the fixnum library with the Dart VM |
6 | 6 |
7 library int64vmtest; | 7 library int64vmtest; |
8 import 'dart:math' as math; | 8 import 'dart:math' as math; |
9 | 9 |
10 part '../lib/src/int32.dart'; | 10 part '../lib/src/int32.dart'; |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 167 |
168 for (int a = 0; a < 19; a++) { | 168 for (int a = 0; a < 19; a++) { |
169 // Math.pow(10, a) | 169 // Math.pow(10, a) |
170 int pow = 1; | 170 int pow = 1; |
171 for (int j = 0; j < a; j++) { | 171 for (int j = 0; j < a; j++) { |
172 pow *= 10; | 172 pow *= 10; |
173 } | 173 } |
174 testSet.add(new int64.fromInt(pow)); | 174 testSet.add(new int64.fromInt(pow)); |
175 } | 175 } |
176 | 176 |
177 TEST_VALUES = new List<int64>.fixedLength(testSet.length); | 177 TEST_VALUES = new List<int64>(testSet.length); |
178 int index = 0; | 178 int index = 0; |
179 for (int64 val in testSet) { | 179 for (int64 val in testSet) { |
180 TEST_VALUES[index++] = val; | 180 TEST_VALUES[index++] = val; |
181 } | 181 } |
182 | 182 |
183 print("VALUES.length = $index"); | 183 print("VALUES.length = $index"); |
184 } | 184 } |
185 | 185 |
186 void _doTestUnary(UnaryOp op, int64 val) { | 186 void _doTestUnary(UnaryOp op, int64 val) { |
187 int ref = op.ref(val.toInt()); | 187 int ref = op.ref(val.toInt()); |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 } | 320 } |
321 } | 321 } |
322 for (int i = 0; i < RANDOM_TESTS; i++) { | 322 for (int i = 0; i < RANDOM_TESTS; i++) { |
323 int64 randomLong = _randomInt64(); | 323 int64 randomLong = _randomInt64(); |
324 for (int shift = -64; shift <= 64; shift++) { | 324 for (int shift = -64; shift <= 64; shift++) { |
325 _doTestShift(op, randomLong, shift); | 325 _doTestShift(op, randomLong, shift); |
326 } | 326 } |
327 } | 327 } |
328 } | 328 } |
329 } | 329 } |
OLD | NEW |