From 80b42fef5f070c980584b45de7b4a84322c749a0 Mon Sep 17 00:00:00 2001 From: Marco Paland Date: Sat, 26 Jan 2019 15:57:10 +0100 Subject: fix(printf): fixed support of NaN (hot) fixes #37 --- test/test_suite.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test') diff --git a/test/test_suite.cpp b/test/test_suite.cpp index 66ba5f3..2103a5b 100644 --- a/test/test_suite.cpp +++ b/test/test_suite.cpp @@ -31,6 +31,7 @@ #include "catch.hpp" #include +#include namespace test { // use functions in own test namespace to avoid stdio conflicts @@ -1019,6 +1020,9 @@ TEST_CASE("length", "[]" ) { TEST_CASE("float", "[]" ) { char buffer[100]; + test::sprintf(buffer, "%.4f", NAN); // using the NAN macro of math.h + REQUIRE(!strcmp(buffer, "nan")); + test::sprintf(buffer, "%.4f", 3.1415354); REQUIRE(!strcmp(buffer, "3.1415")); -- cgit v1.2.3