From 5b054ae7b8319a6d7b2e071f83a59231980054fd Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Fri, 6 Jun 2014 11:04:27 -0700 Subject: [PATCH] Test signbit. --- test/format-test.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/format-test.cc b/test/format-test.cc index f00d01e5..70bceee0 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -49,6 +49,7 @@ FILE *FOpen(const char *filename, const char *mode) { #include "util.h" #include "gtest-extra.h" +#include #include #undef min @@ -1232,6 +1233,7 @@ TEST(FormatterTest, FormatNaN) { double nan = std::numeric_limits::quiet_NaN(); EXPECT_EQ("nan", str(Format("{}") << nan)); EXPECT_EQ("+nan", str(Format("{:+}") << nan)); + EXPECT_EQ(1, signbit(-nan)); EXPECT_EQ("-nan", str(Format("{}") << -nan)); EXPECT_EQ(" nan", str(Format("{: }") << nan)); EXPECT_EQ("NAN", str(Format("{:F}") << nan));