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

Unified Diff: runtime/vm/snapshot_test.cc

Issue 11421064: Cleanups and added more checks for valid Integer allocation (must be Smi, Mint or Bigint for their … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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
« runtime/lib/integers.cc ('K') | « runtime/vm/object_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/snapshot_test.cc
===================================================================
--- runtime/vm/snapshot_test.cc (revision 15292)
+++ runtime/vm/snapshot_test.cc (working copy)
@@ -373,7 +373,9 @@
// Write snapshot with object content.
uint8_t* buffer;
MessageWriter writer(&buffer, &zone_allocator);
- const Bigint& bigint = Bigint::Handle(Bigint::New(DART_INT64_C(0xfffffffff)));
+ const char* cstr = "0x270FFFFFFFFFFFFFD8F0";
+ const String& str = String::Handle(String::New(cstr));
+ const Bigint& bigint = Bigint::Handle(Bigint::New(str));
writer.WriteMessage(bigint);
intptr_t buffer_len = writer.BytesWritten();
@@ -383,7 +385,8 @@
Bigint& obj = Bigint::Handle();
obj ^= reader.ReadObject();
- EXPECT_EQ(BigintOperations::ToMint(bigint), BigintOperations::ToMint(obj));
+ EXPECT_STREQ(BigintOperations::ToHexCString(bigint, &allocator),
+ BigintOperations::ToHexCString(obj, &allocator));
// Read object back from the snapshot into a C structure.
ApiNativeScope scope;
@@ -392,7 +395,7 @@
// Bigint not supported.
EXPECT_NOTNULL(root);
EXPECT_EQ(Dart_CObject::kBigint, root->type);
- EXPECT_STREQ("FFFFFFFFF", root->value.as_bigint);
+ EXPECT_STREQ("270FFFFFFFFFFFFFD8F0", root->value.as_bigint);
CheckEncodeDecodeMessage(root);
}
« runtime/lib/integers.cc ('K') | « runtime/vm/object_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698