Index: test/cctest/test-api.cc |
=================================================================== |
--- test/cctest/test-api.cc (revision 3013) |
+++ test/cctest/test-api.cc (working copy) |
@@ -702,12 +702,18 @@ |
} |
+#if V8_HOST_ARCH_64_BIT |
+# define CAST_TO_INT64(x) (int(x)) |
Lasse Reichstein
2009/10/02 20:01:23
It seems counter-intuitive to have a macro called
|
+#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(int64_t(value), value_obj->Value()); |
+ CHECK_EQ(CAST_TO_INT64(value), value_obj->Value()); |
} |
@@ -718,7 +724,7 @@ |
CHECK(i::Smi::IsValid(value)); |
CHECK(!i::Smi::IsValid(value + 1)); |
Local<v8::Integer> value_obj = v8::Integer::New(value); |
- CHECK_EQ(int64_t(value), value_obj->Value()); |
+ CHECK_EQ(CAST_TO_INT64(value), value_obj->Value()); |
} |
@@ -728,7 +734,7 @@ |
int32_t value = (1 << 30) + 1; |
CHECK(!i::Smi::IsValid(value)); |
Local<v8::Integer> value_obj = v8::Integer::New(value); |
- CHECK_EQ(int64_t(value), value_obj->Value()); |
+ CHECK_EQ(CAST_TO_INT64(value), value_obj->Value()); |
} |
@@ -737,7 +743,7 @@ |
LocalContext env; |
uint32_t value = 239; |
Local<v8::Integer> value_obj = v8::Integer::New(value); |
- CHECK_EQ(int64_t(value), value_obj->Value()); |
+ CHECK_EQ(CAST_TO_INT64(value), value_obj->Value()); |
} |
@@ -748,7 +754,7 @@ |
CHECK(i::Smi::IsValid(value)); |
CHECK(!i::Smi::IsValid(value + 1)); |
Local<v8::Integer> value_obj = v8::Integer::New(value); |
- CHECK_EQ(int64_t(value), value_obj->Value()); |
+ CHECK_EQ(CAST_TO_INT64(value), value_obj->Value()); |
} |
@@ -758,7 +764,7 @@ |
uint32_t value = (1 << 30) + 1; |
CHECK(!i::Smi::IsValid(value)); |
Local<v8::Integer> value_obj = v8::Integer::New(value); |
- CHECK_EQ(int64_t(value), value_obj->Value()); |
+ CHECK_EQ(CAST_TO_INT64(value), value_obj->Value()); |
} |
@@ -767,7 +773,7 @@ |
LocalContext env; |
uint32_t value = uint32_t(0xffffffff); |
Local<v8::Integer> value_obj = v8::Integer::New(value); |
- CHECK_EQ(int64_t(value), value_obj->Value()); |
+ CHECK_EQ(CAST_TO_INT64(value), value_obj->Value()); |
} |