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

Unified Diff: test/cctest/test-api.cc

Issue 261024: X64: Fix incompatability with previous revision. (Closed)
Patch Set: Created 11 years, 2 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 | « src/x64/virtual-frame-x64.cc ('k') | test/cctest/test-macro-assembler-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index f1e94d6ed4a702f8a51f44298931352d69574a38..2a35014aa8d2ec39362796e6ddde99748c189a89 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -713,21 +713,27 @@ THREADED_TEST(BigSmiInteger) {
v8::HandleScope scope;
LocalContext env;
int32_t value = i::Smi::kMaxValue;
- CHECK(i::Smi::IsValid(value));
- CHECK(!i::Smi::IsValid(value + 1));
- Local<v8::Integer> value_obj = v8::Integer::New(value);
- CHECK_EQ(static_cast<int64_t>(value), value_obj->Value());
+ // We cannot add one to a Smi::kMaxValue without wrapping.
+ if (i::kSmiValueSize < 32) {
+ CHECK(i::Smi::IsValid(value));
+ CHECK(!i::Smi::IsValid(value + 1));
+ Local<v8::Integer> value_obj = v8::Integer::New(value);
+ CHECK_EQ(static_cast<int64_t>(value), value_obj->Value());
+ }
}
THREADED_TEST(BigInteger) {
v8::HandleScope scope;
LocalContext env;
- int32_t value = i::Smi::kMaxValue + 1;
- CHECK(value > i::Smi::kMaxValue);
- CHECK(!i::Smi::IsValid(value));
- Local<v8::Integer> value_obj = v8::Integer::New(value);
- CHECK_EQ(static_cast<int64_t>(value), value_obj->Value());
+ // We cannot add one to a Smi::kMaxValue without wrapping.
+ if (i::kSmiValueSize < 32) {
+ int32_t value = i::Smi::kMaxValue + 1;
+ CHECK(value > i::Smi::kMaxValue);
+ CHECK(!i::Smi::IsValid(value));
+ Local<v8::Integer> value_obj = v8::Integer::New(value);
+ CHECK_EQ(static_cast<int64_t>(value), value_obj->Value());
+ }
}
« no previous file with comments | « src/x64/virtual-frame-x64.cc ('k') | test/cctest/test-macro-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698