diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/test_suite.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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 <string.h>
+#include <math.h>
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"));
|