From d0443c425588b2fd75ca4fc26456588705b93768 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sun, 12 Feb 2017 20:33:54 -0800 Subject: [PATCH] Fixed VS build. --- tests/vsnprintf_test.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/tests/vsnprintf_test.cpp b/tests/vsnprintf_test.cpp index 9b29d5f..d47ed08 100644 --- a/tests/vsnprintf_test.cpp +++ b/tests/vsnprintf_test.cpp @@ -5,12 +5,8 @@ #include "test.h" #include +#include #include -#include - -#ifndef NAN -# define NAN (0.0/0.0) -#endif // NAN TEST_CASE("vsnprintf NULL buffer", "No output buffer provided.") { @@ -58,12 +54,12 @@ TEST_CASE("vsnprintf f", "") REQUIRE(test("13.370 ", "%-8.3f", 13.37) ); REQUIRE(test("13.370 ", "%*.*f", -8, 3, 13.37) ); - REQUIRE(test("nan ", "%-8f", NAN) ); - REQUIRE(test(" nan", "%8f", NAN) ); - REQUIRE(test("-NAN ", "%-8F", -NAN) ); - REQUIRE(test(" inf", "%8f", INFINITY) ); - REQUIRE(test("inf ", "%-8f", INFINITY) ); - REQUIRE(test(" -INF", "%8F", -INFINITY) ); + REQUIRE(test("nan ", "%-8f", std::numeric_limits::quiet_NaN() ) ); + REQUIRE(test(" nan", "%8f", std::numeric_limits::quiet_NaN() ) ); + REQUIRE(test("-NAN ", "%-8F", -std::numeric_limits::quiet_NaN() ) ); + REQUIRE(test(" inf", "%8f", std::numeric_limits::infinity() ) ); + REQUIRE(test("inf ", "%-8f", std::numeric_limits::infinity() ) ); + REQUIRE(test(" -INF", "%8F", -std::numeric_limits::infinity() ) ); } TEST_CASE("vsnprintf d/i/o/u/x", "")