| 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 |
| 8 import 'dart:math' as math; | 9 import 'dart:math' as math; |
| 9 | 10 |
| 10 part '../lib/src/int32.dart'; | 11 part 'package:fixnum/src/int32.dart'; |
| 11 part '../lib/src/int64.dart'; | 12 part 'package:fixnum/src/int64.dart'; |
| 12 part '../lib/src/intx.dart'; | 13 part 'package:fixnum/src/intx.dart'; |
| 13 | 14 |
| 14 final random = new math.Random(); | 15 final random = new math.Random(); |
| 15 | 16 |
| 16 void main() { | 17 void main() { |
| 17 int64VMTest test = new int64VMTest(); | 18 int64VMTest test = new int64VMTest(); |
| 18 test.doTestBinary(new BinaryOp("&", (a, b) => a & b)); | 19 test.doTestBinary(new BinaryOp("&", (a, b) => a & b)); |
| 19 test.doTestBinary(new BinaryOp("|", (a, b) => a | b)); | 20 test.doTestBinary(new BinaryOp("|", (a, b) => a | b)); |
| 20 test.doTestBinary(new BinaryOp("^", (a, b) => a ^ b)); | 21 test.doTestBinary(new BinaryOp("^", (a, b) => a ^ b)); |
| 21 test.doTestBinary(new BinaryOp("+", (a, b) => a + b)); | 22 test.doTestBinary(new BinaryOp("+", (a, b) => a + b)); |
| 22 test.doTestBinary(new BinaryOp("-", (a, b) => a - b)); | 23 test.doTestBinary(new BinaryOp("-", (a, b) => a - b)); |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 } | 321 } |
| 321 } | 322 } |
| 322 for (int i = 0; i < RANDOM_TESTS; i++) { | 323 for (int i = 0; i < RANDOM_TESTS; i++) { |
| 323 int64 randomLong = _randomInt64(); | 324 int64 randomLong = _randomInt64(); |
| 324 for (int shift = -64; shift <= 64; shift++) { | 325 for (int shift = -64; shift <= 64; shift++) { |
| 325 _doTestShift(op, randomLong, shift); | 326 _doTestShift(op, randomLong, shift); |
| 326 } | 327 } |
| 327 } | 328 } |
| 328 } | 329 } |
| 329 } | 330 } |
| OLD | NEW |