Commit 600ed94a authored by danno@chromium.org's avatar danno@chromium.org

Update tests to use std::isnan instead of isnan

Should fix compilation breakage after r14352

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

Patch from Jochen Eisinger <jochen@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14354 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 0f348e55
......@@ -3344,7 +3344,7 @@ THREADED_TEST(ConversionException) {
CheckUncle(&try_catch);
double number_value = obj->NumberValue();
CHECK_NE(0, isnan(number_value));
CHECK_NE(0, std::isnan(number_value));
CheckUncle(&try_catch);
int64_t integer_value = obj->IntegerValue();
......@@ -15445,7 +15445,7 @@ static uint64_t DoubleToBits(double value) {
static double DoubleToDateTime(double input) {
double date_limit = 864e13;
if (isnan(input) || input < -date_limit || input > date_limit) {
if (std::isnan(input) || input < -date_limit || input > date_limit) {
return i::OS::nan_value();
}
return (input < 0) ? -(floor(-input)) : floor(input);
......@@ -15506,7 +15506,7 @@ THREADED_TEST(QuietSignalingNaNs) {
// Check that Number::New preserves non-NaNs and quiets SNaNs.
v8::Handle<v8::Value> number = v8::Number::New(test_value);
double stored_number = number->NumberValue();
if (!isnan(test_value)) {
if (!std::isnan(test_value)) {
CHECK_EQ(test_value, stored_number);
} else {
uint64_t stored_bits = DoubleToBits(stored_number);
......@@ -15525,7 +15525,7 @@ THREADED_TEST(QuietSignalingNaNs) {
v8::Handle<v8::Value> date = v8::Date::New(test_value);
double expected_stored_date = DoubleToDateTime(test_value);
double stored_date = date->NumberValue();
if (!isnan(expected_stored_date)) {
if (!std::isnan(expected_stored_date)) {
CHECK_EQ(expected_stored_date, stored_date);
} else {
uint64_t stored_bits = DoubleToBits(stored_date);
......
......@@ -81,10 +81,10 @@ TEST(MalformedOctal) {
CHECK_EQ(81.0, StringToDouble(&uc, "081", ALLOW_HEX | ALLOW_OCTALS));
CHECK_EQ(78.0, StringToDouble(&uc, "078", ALLOW_HEX | ALLOW_OCTALS));
CHECK(isnan(StringToDouble(&uc, "07.7", ALLOW_HEX | ALLOW_OCTALS)));
CHECK(isnan(StringToDouble(&uc, "07.8", ALLOW_HEX | ALLOW_OCTALS)));
CHECK(isnan(StringToDouble(&uc, "07e8", ALLOW_HEX | ALLOW_OCTALS)));
CHECK(isnan(StringToDouble(&uc, "07e7", ALLOW_HEX | ALLOW_OCTALS)));
CHECK(std::isnan(StringToDouble(&uc, "07.7", ALLOW_HEX | ALLOW_OCTALS)));
CHECK(std::isnan(StringToDouble(&uc, "07.8", ALLOW_HEX | ALLOW_OCTALS)));
CHECK(std::isnan(StringToDouble(&uc, "07e8", ALLOW_HEX | ALLOW_OCTALS)));
CHECK(std::isnan(StringToDouble(&uc, "07e7", ALLOW_HEX | ALLOW_OCTALS)));
CHECK_EQ(8.7, StringToDouble(&uc, "08.7", ALLOW_HEX | ALLOW_OCTALS));
CHECK_EQ(8e7, StringToDouble(&uc, "08e7", ALLOW_HEX | ALLOW_OCTALS));
......@@ -123,9 +123,9 @@ TEST(TrailingJunk) {
TEST(NonStrDecimalLiteral) {
UnicodeCache uc;
CHECK(isnan(StringToDouble(&uc, " ", NO_FLAGS, OS::nan_value())));
CHECK(isnan(StringToDouble(&uc, "", NO_FLAGS, OS::nan_value())));
CHECK(isnan(StringToDouble(&uc, " ", NO_FLAGS, OS::nan_value())));
CHECK(std::isnan(StringToDouble(&uc, " ", NO_FLAGS, OS::nan_value())));
CHECK(std::isnan(StringToDouble(&uc, "", NO_FLAGS, OS::nan_value())));
CHECK(std::isnan(StringToDouble(&uc, " ", NO_FLAGS, OS::nan_value())));
CHECK_EQ(0.0, StringToDouble(&uc, "", NO_FLAGS));
CHECK_EQ(0.0, StringToDouble(&uc, " ", NO_FLAGS));
}
......@@ -140,8 +140,8 @@ TEST(IntegerStrLiteral) {
CHECK_EQ(-1.0, StringToDouble(&uc, "-1", NO_FLAGS));
CHECK_EQ(-1.0, StringToDouble(&uc, " -1 ", NO_FLAGS));
CHECK_EQ(1.0, StringToDouble(&uc, " +1 ", NO_FLAGS));
CHECK(isnan(StringToDouble(&uc, " - 1 ", NO_FLAGS)));
CHECK(isnan(StringToDouble(&uc, " + 1 ", NO_FLAGS)));
CHECK(std::isnan(StringToDouble(&uc, " - 1 ", NO_FLAGS)));
CHECK(std::isnan(StringToDouble(&uc, " + 1 ", NO_FLAGS)));
CHECK_EQ(0.0, StringToDouble(&uc, "0e0", ALLOW_HEX | ALLOW_OCTALS));
CHECK_EQ(0.0, StringToDouble(&uc, "0e1", ALLOW_HEX | ALLOW_OCTALS));
......
......@@ -199,7 +199,7 @@ TEST(HeapObjects) {
// nan oddball checks
CHECK(heap->nan_value()->IsNumber());
CHECK(isnan(heap->nan_value()->Number()));
CHECK(std::isnan(heap->nan_value()->Number()));
Handle<String> s = FACTORY->NewStringFromAscii(CStrVector("fisk hest "));
CHECK(s->IsString());
......
......@@ -28,10 +28,10 @@
// Tests of logging functions from log.h
#ifdef __linux__
#include <math.h>
#include <pthread.h>
#include <signal.h>
#include <unistd.h>
#include <cmath>
#endif // __linux__
#include "v8.h"
......
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