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

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

Issue 256048: Add CHECK_INT64_EQ function to avoid operand size ambiguities. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
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/checks.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
===================================================================
--- test/cctest/test-api.cc (revision 3015)
+++ test/cctest/test-api.cc (working copy)
@@ -702,18 +702,12 @@
}
-#if V8_HOST_ARCH_64_BIT
-# define CAST_TO_INT64(x) (int(x))
-#else
-# define CAST_TO_INT64(x) (int64_t(x))
-#endif
-
THREADED_TEST(TinyInteger) {
v8::HandleScope scope;
LocalContext env;
int32_t value = 239;
Local<v8::Integer> value_obj = v8::Integer::New(value);
- CHECK_EQ(CAST_TO_INT64(value), value_obj->Value());
+ CHECK_INT64_EQ(static_cast<int64_t>(value), value_obj->Value());
}
@@ -724,7 +718,7 @@
CHECK(i::Smi::IsValid(value));
CHECK(!i::Smi::IsValid(value + 1));
Local<v8::Integer> value_obj = v8::Integer::New(value);
- CHECK_EQ(CAST_TO_INT64(value), value_obj->Value());
+ CHECK_INT64_EQ(static_cast<int64_t>(value), value_obj->Value());
}
@@ -734,7 +728,7 @@
int32_t value = (1 << 30) + 1;
CHECK(!i::Smi::IsValid(value));
Local<v8::Integer> value_obj = v8::Integer::New(value);
- CHECK_EQ(CAST_TO_INT64(value), value_obj->Value());
+ CHECK_INT64_EQ(static_cast<int64_t>(value), value_obj->Value());
}
@@ -743,7 +737,7 @@
LocalContext env;
uint32_t value = 239;
Local<v8::Integer> value_obj = v8::Integer::New(value);
- CHECK_EQ(CAST_TO_INT64(value), value_obj->Value());
+ CHECK_INT64_EQ(static_cast<int64_t>(value), value_obj->Value());
}
@@ -754,7 +748,7 @@
CHECK(i::Smi::IsValid(value));
CHECK(!i::Smi::IsValid(value + 1));
Local<v8::Integer> value_obj = v8::Integer::New(value);
- CHECK_EQ(CAST_TO_INT64(value), value_obj->Value());
+ CHECK_INT64_EQ(static_cast<int64_t>(value), value_obj->Value());
}
@@ -764,7 +758,7 @@
uint32_t value = (1 << 30) + 1;
CHECK(!i::Smi::IsValid(value));
Local<v8::Integer> value_obj = v8::Integer::New(value);
- CHECK_EQ(CAST_TO_INT64(value), value_obj->Value());
+ CHECK_INT64_EQ(static_cast<int64_t>(value), value_obj->Value());
}
@@ -773,7 +767,7 @@
LocalContext env;
uint32_t value = uint32_t(0xffffffff);
Local<v8::Integer> value_obj = v8::Integer::New(value);
- CHECK_EQ(CAST_TO_INT64(value), value_obj->Value());
+ CHECK_INT64_EQ(static_cast<int64_t>(value), value_obj->Value());
}
« no previous file with comments | « src/checks.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698