Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1178)

Unified Diff: tests/standalone/medium_integer_test.dart

Issue 10887037: Fix issue 1146: skip regular Mint test in 64 bit. Add Mint test for 64 bit. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/standalone/standalone.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/medium_integer_test.dart
===================================================================
--- tests/standalone/medium_integer_test.dart (revision 11549)
+++ tests/standalone/medium_integer_test.dart (working copy)
@@ -7,18 +7,21 @@
#library("MediumIntegerTest.dart");
#import("dart:coreimpl");
+
class MediumIntegerTest {
static void checkSmi(int a) {
- Expect.equals(true, (a is Smi));
+ Expect.isTrue(a is Smi);
}
static void checkMint(int a) {
- Expect.equals(true, (a is Mint));
+ if (runsOn32Bit) {
+ Expect.isTrue(a is Mint);
+ }
}
static void checkBigint(int a) {
- Expect.equals(true, (a is Bigint));
+ Expect.isTrue(a is Bigint);
}
static int getMint() {
@@ -137,7 +140,11 @@
Expect.equals(mint, res);
}
- // TODO(srdjan): Add more tests.
+ // Mint both in 32- and 64-bit architecture.
+ static void testAlwaysMint() {
+ var a = 4611686018427390000;
+ Expect.isTrue(a is Mint);
+ }
static void testMain() {
checkMint(getMint());
@@ -155,10 +162,14 @@
checkMint(b);
Expect.equals(false, a.hashCode() == b.hashCode());
Expect.equals(true, a.hashCode() == (b - 1).hashCode());
+ testAlwaysMint();
}
}
+bool runsOn32Bit;
+
main() {
+ runsOn32Bit = 4294967295 is Mint;
for (int i = 0; i < 1000; i++) {
MediumIntegerTest.testMain();
}
« no previous file with comments | « no previous file | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698