A version of test-api.cc that compiles both on Mac and on Linux.
authorerikcorry <erikcorry@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 11 Apr 2012 13:41:48 +0000 (13:41 +0000)
committererikcorry <erikcorry@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 11 Apr 2012 13:41:48 +0000 (13:41 +0000)
Review URL: http://codereview.chromium.org/10050013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11275 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

test/cctest/test-api.cc

index fbc2f4a..a37b850 100644 (file)
@@ -10865,14 +10865,18 @@ THREADED_TEST(NestedHandleScopeAndContexts) {
 }
 
 
+static int64_t cast(intptr_t x) { return static_cast<int64_t>(x); }
+
+
 THREADED_TEST(ExternalAllocatedMemory) {
   v8::HandleScope outer;
   v8::Persistent<Context> env(Context::New());
   CHECK(!env.IsEmpty());
   const intptr_t kSize = 1024*1024;
-  CHECK_EQ(v8::V8::AdjustAmountOfExternalAllocatedMemory(kSize), kSize);
-  CHECK_EQ(v8::V8::AdjustAmountOfExternalAllocatedMemory(-kSize),
-           static_cast<intptr_t>(0));
+  CHECK_EQ(cast(v8::V8::AdjustAmountOfExternalAllocatedMemory(kSize)),
+           cast(kSize));
+  CHECK_EQ(cast(v8::V8::AdjustAmountOfExternalAllocatedMemory(-kSize)),
+           cast(0));
 }