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

Unified Diff: runtime/vm/object_test.cc

Issue 2982823002: Option to truncate integers to 64 bits, part 2 (Closed)
Patch Set: Fixes for review comments Created 3 years, 5 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
Index: runtime/vm/object_test.cc
diff --git a/runtime/vm/object_test.cc b/runtime/vm/object_test.cc
index e8e04b106c3b4543f4f3dd235aaf0d5fa1142a67..bf4515386ce299bdd4e9cc0e6f74c584796de247 100644
--- a/runtime/vm/object_test.cc
+++ b/runtime/vm/object_test.cc
@@ -337,13 +337,16 @@ ISOLATE_UNIT_TEST_CASE(Smi) {
EXPECT_EQ(-1, c.CompareWith(mint1));
EXPECT_EQ(1, c.CompareWith(mint2));
- Bigint& big1 = Bigint::Handle(Bigint::NewFromCString("10000000000000000000"));
- Bigint& big2 =
- Bigint::Handle(Bigint::NewFromCString("-10000000000000000000"));
- EXPECT_EQ(-1, a.CompareWith(big1));
- EXPECT_EQ(1, a.CompareWith(big2));
- EXPECT_EQ(-1, c.CompareWith(big1));
- EXPECT_EQ(1, c.CompareWith(big2));
+ if (!Bigint::IsDisabled()) {
+ Bigint& big1 =
+ Bigint::Handle(Bigint::NewFromCString("10000000000000000000"));
+ Bigint& big2 =
+ Bigint::Handle(Bigint::NewFromCString("-10000000000000000000"));
+ EXPECT_EQ(-1, a.CompareWith(big1));
+ EXPECT_EQ(1, a.CompareWith(big2));
+ EXPECT_EQ(-1, c.CompareWith(big1));
+ EXPECT_EQ(1, c.CompareWith(big2));
+ }
}
ISOLATE_UNIT_TEST_CASE(StringCompareTo) {
@@ -492,13 +495,16 @@ ISOLATE_UNIT_TEST_CASE(Mint) {
EXPECT_EQ(-1, c.CompareWith(smi1));
EXPECT_EQ(-1, c.CompareWith(smi2));
- Bigint& big1 = Bigint::Handle(Bigint::NewFromCString("10000000000000000000"));
- Bigint& big2 =
- Bigint::Handle(Bigint::NewFromCString("-10000000000000000000"));
- EXPECT_EQ(-1, a.CompareWith(big1));
- EXPECT_EQ(1, a.CompareWith(big2));
- EXPECT_EQ(-1, c.CompareWith(big1));
- EXPECT_EQ(1, c.CompareWith(big2));
+ if (!Bigint::IsDisabled()) {
+ Bigint& big1 =
+ Bigint::Handle(Bigint::NewFromCString("10000000000000000000"));
+ Bigint& big2 =
+ Bigint::Handle(Bigint::NewFromCString("-10000000000000000000"));
+ EXPECT_EQ(-1, a.CompareWith(big1));
+ EXPECT_EQ(1, a.CompareWith(big2));
+ EXPECT_EQ(-1, c.CompareWith(big1));
+ EXPECT_EQ(1, c.CompareWith(big2));
+ }
int64_t mint_value = DART_2PART_UINT64_C(0x7FFFFFFF, 64);
const String& mint_string = String::Handle(String::New("0x7FFFFFFF00000064"));
@@ -596,6 +602,10 @@ ISOLATE_UNIT_TEST_CASE(Double) {
}
ISOLATE_UNIT_TEST_CASE(Bigint) {
+ if (Bigint::IsDisabled()) {
+ return;
+ }
+
Bigint& b = Bigint::Handle();
EXPECT(b.IsNull());
const char* cstr = "18446744073709551615000";
@@ -643,10 +653,10 @@ ISOLATE_UNIT_TEST_CASE(Integer) {
EXPECT(i.IsSmi());
i = Integer::NewCanonical(
String::Handle(String::New("12345678901234567890")));
- EXPECT(i.IsBigint());
+ EXPECT(FLAG_limit_ints_to_64_bits ? i.IsNull() : i.IsBigint());
i = Integer::NewCanonical(
String::Handle(String::New("-12345678901234567890111222")));
- EXPECT(i.IsBigint());
+ EXPECT(FLAG_limit_ints_to_64_bits ? i.IsNull() : i.IsBigint());
}
ISOLATE_UNIT_TEST_CASE(String) {
@@ -4164,7 +4174,7 @@ ISOLATE_UNIT_TEST_CASE(PrintJSONPrimitives) {
buffer);
}
// Bigint reference
- {
+ if (!Bigint::IsDisabled()) {
JSONStream js;
const String& bigint_str =
String::Handle(String::New("44444444444444444444444444444444"));

Powered by Google App Engine
This is Rietveld 408576698