aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/text_format_unittest.cc
diff options
context:
space:
mode:
authorGravatar Karol Ostrovsky <karol.ostrovsky@gmail.com>2015-06-29 16:13:33 +0200
committerGravatar Karol Ostrovsky <karol.ostrovsky@gmail.com>2015-07-01 10:09:41 +0200
commitee35402244fc463cedc470baa0f5f1a6080d905d (patch)
tree8a127c0f8762f5b07129d97dd2fba584fef20431 /src/google/protobuf/text_format_unittest.cc
parentd40a0db202433ba002a3e104165d4414e8929432 (diff)
MinGW64+MSYS2 compilation issues and portable isnan using MathLimits
Diffstat (limited to 'src/google/protobuf/text_format_unittest.cc')
-rw-r--r--src/google/protobuf/text_format_unittest.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/google/protobuf/text_format_unittest.cc b/src/google/protobuf/text_format_unittest.cc
index 1b18c5ed..76ce9875 100644
--- a/src/google/protobuf/text_format_unittest.cc
+++ b/src/google/protobuf/text_format_unittest.cc
@@ -46,6 +46,7 @@
#include <google/protobuf/io/tokenizer.h>
#include <google/protobuf/io/zero_copy_stream_impl.h>
#include <google/protobuf/stubs/strutil.h>
+#include <google/protobuf/stubs/mathlimits.h>
#include <google/protobuf/stubs/substitute.h>
#include <google/protobuf/testing/googletest.h>
#include <gtest/gtest.h>
@@ -57,11 +58,6 @@ namespace protobuf {
// Can't use an anonymous namespace here due to brokenness of Tru64 compiler.
namespace text_format_unittest {
-inline bool IsNaN(double value) {
- // NaN is never equal to anything, even itself.
- return value != value;
-}
-
// A basic string with different escapable characters for testing.
const string kEscapeTestString =
"\"A string with ' characters \n and \r newlines and \t tabs and \001 "
@@ -898,8 +894,8 @@ TEST_F(TextFormatTest, ParseExotic) {
EXPECT_EQ(message.repeated_double(8), numeric_limits<double>::infinity());
EXPECT_EQ(message.repeated_double(9), -numeric_limits<double>::infinity());
EXPECT_EQ(message.repeated_double(10), -numeric_limits<double>::infinity());
- EXPECT_TRUE(IsNaN(message.repeated_double(11)));
- EXPECT_TRUE(IsNaN(message.repeated_double(12)));
+ EXPECT_TRUE(MathLimits<double>::IsNaN(message.repeated_double(11)));
+ EXPECT_TRUE(MathLimits<double>::IsNaN(message.repeated_double(12)));
// Note: Since these string literals have \0's in them, we must explicitly
// pass their sizes to string's constructor.