Commit 4095600a authored by danno@chromium.org's avatar danno@chromium.org

Fix windows build breakage due to 15645

R=ulan@chromium.org

Review URL: https://codereview.chromium.org/18915009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15648 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent da7f6a68
......@@ -27,6 +27,8 @@
#include <stdlib.h>
#include <limits>
#include "v8.h"
#include "cctest.h"
......@@ -44,7 +46,8 @@
using namespace v8::internal;
typedef int32_t STDCALL (*ConvertDToIFunc)(double input);
typedef int32_t STDCALL ConvertDToIFuncType(double input);
typedef ConvertDToIFuncType* ConvertDToIFunc;
int STDCALL ConvertDToICVersion(double d) {
......@@ -79,7 +82,8 @@ int STDCALL ConvertDToICVersion(double d) {
void RunOneTruncationTestWithTest(ConvertDToIFunc func,
double from,
int64_t to) {
double raw) {
uint64_t to = static_cast<int64_t>(raw);
int result = (*func)(from);
CHECK_EQ(static_cast<int>(to), result);
}
......@@ -87,8 +91,8 @@ void RunOneTruncationTestWithTest(ConvertDToIFunc func,
// #define NaN and Infinity so that it's possible to cut-and-paste these tests
// directly to a .js file and run them.
#define NaN NAN
#define Infinity INFINITY
#define NaN (OS::nan_value())
#define Infinity (std::numeric_limits<double>::infinity())
#define RunOneTruncationTest(p1, p2) RunOneTruncationTestWithTest(func, p1, p2)
void RunAllTruncationTests(ConvertDToIFunc func) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment