From 600ed94a3d39a1ac673495cae56701395b549cd2 Mon Sep 17 00:00:00 2001 From: "danno@chromium.org" Date: Fri, 19 Apr 2013 14:20:36 +0000 Subject: [PATCH] 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 . git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14354 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- test/cctest/test-api.cc | 8 ++++---- test/cctest/test-conversions.cc | 18 +++++++++--------- test/cctest/test-heap.cc | 2 +- test/cctest/test-log.cc | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc index acc47b9..9d05c0f 100644 --- a/test/cctest/test-api.cc +++ b/test/cctest/test-api.cc @@ -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 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 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); diff --git a/test/cctest/test-conversions.cc b/test/cctest/test-conversions.cc index 4815b1b..651dc59 100644 --- a/test/cctest/test-conversions.cc +++ b/test/cctest/test-conversions.cc @@ -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)); diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc index 9aa839b..c0bd08a 100644 --- a/test/cctest/test-heap.cc +++ b/test/cctest/test-heap.cc @@ -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 s = FACTORY->NewStringFromAscii(CStrVector("fisk hest ")); CHECK(s->IsString()); diff --git a/test/cctest/test-log.cc b/test/cctest/test-log.cc index 24e5db9..89b11c9 100644 --- a/test/cctest/test-log.cc +++ b/test/cctest/test-log.cc @@ -28,10 +28,10 @@ // Tests of logging functions from log.h #ifdef __linux__ -#include #include #include #include +#include #endif // __linux__ #include "v8.h" -- 2.7.4