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

Unified Diff: runtime/vm/bigint_operations_test.cc

Issue 9363018: Add integer min/max constants to globals.h (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 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 | « runtime/platform/globals.h ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/bigint_operations_test.cc
diff --git a/runtime/vm/bigint_operations_test.cc b/runtime/vm/bigint_operations_test.cc
index 73a610789b69478218000a2488971864982044c1..0a7b0f935f1e1b50f419ce40e9a7ebafc4b86d61 100644
--- a/runtime/vm/bigint_operations_test.cc
+++ b/runtime/vm/bigint_operations_test.cc
@@ -78,22 +78,18 @@ TEST_CASE(BigintInt64) {
EXPECT_EQ(0, BigintOperations::Compare(big, big_test));
const Bigint& one = Bigint::Handle(BigintOperations::NewFromInt64(1));
- const int64_t kMaxValue64 =
- static_cast<int64_t>(DART_2PART_UINT64_C(0x7FFFFFFF, FFFFFFFF));
- const int64_t kMinValue64 =
- static_cast<int64_t>(DART_2PART_UINT64_C(0x80000000, 00000000));
- big = BigintOperations::NewFromInt64(kMinValue64);
+ big = BigintOperations::NewFromInt64(kMinInt64);
EXPECT(BigintOperations::FitsIntoInt64(big));
int64_t back = BigintOperations::ToInt64(big);
- EXPECT_EQ(kMinValue64, back);
+ EXPECT_EQ(kMinInt64, back);
big = BigintOperations::Subtract(big, one);
EXPECT(!BigintOperations::FitsIntoInt64(big));
- big = BigintOperations::NewFromInt64(kMaxValue64);
+ big = BigintOperations::NewFromInt64(kMaxInt64);
EXPECT(BigintOperations::FitsIntoInt64(big));
back = BigintOperations::ToInt64(big);
- EXPECT_EQ(kMaxValue64, back);
+ EXPECT_EQ(kMaxInt64, back);
big = BigintOperations::Add(big, one);
EXPECT(!BigintOperations::FitsIntoInt64(big));
@@ -101,19 +97,16 @@ TEST_CASE(BigintInt64) {
TEST_CASE(BigintUint64) {
- const uint64_t kMax =
- static_cast<uint64_t>(DART_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFF));
-
const Bigint& one = Bigint::Handle(BigintOperations::NewFromUint64(1));
EXPECT(BigintOperations::FitsIntoInt64(one));
EXPECT(BigintOperations::FitsIntoUint64(one));
- Bigint& big = Bigint::Handle(BigintOperations::NewFromUint64(kMax));
+ Bigint& big = Bigint::Handle(BigintOperations::NewFromUint64(kMaxUint64));
EXPECT(!BigintOperations::FitsIntoInt64(big));
EXPECT(BigintOperations::FitsIntoUint64(big));
uint64_t back = BigintOperations::ToUint64(big);
- EXPECT_EQ(kMax, back);
+ EXPECT_EQ(kMaxUint64, back);
big = BigintOperations::Add(big, one);
EXPECT(!BigintOperations::FitsIntoInt64(big));
« no previous file with comments | « runtime/platform/globals.h ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698