diff options
author | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2013-09-18 17:49:56 +0000 |
---|---|---|
committer | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2013-09-18 17:49:56 +0000 |
commit | be1b3b66822cc3929f3da700973cef88bf45849a (patch) | |
tree | 87b8d6bdc73d7b0105e7837aab4d77402437ebf2 /test | |
parent | 1cb04aa3e99c736bbd1eb90ebda3d6117355aacc (diff) | |
download | googletest-be1b3b66822cc3929f3da700973cef88bf45849a.tar.gz |
avoids clash with the max() macro on Windows
git-svn-id: http://googletest.googlecode.com/svn/trunk@663 861a406c-534a-0410-8894-cb66d6ee9925
Diffstat (limited to 'test')
-rw-r--r-- | test/gtest-death-test_test.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/test/gtest-death-test_test.cc b/test/gtest-death-test_test.cc index 4f37996..c2d26df 100644 --- a/test/gtest-death-test_test.cc +++ b/test/gtest-death-test_test.cc @@ -45,7 +45,6 @@ using testing::internal::AlwaysTrue; # else # include <unistd.h> # include <sys/wait.h> // For waitpid. -# include <limits> // For std::numeric_limits. # endif // GTEST_OS_WINDOWS # include <limits.h> @@ -1123,17 +1122,16 @@ TEST(AutoHandleTest, AutoHandleWorks) { # if GTEST_OS_WINDOWS typedef unsigned __int64 BiggestParsable; typedef signed __int64 BiggestSignedParsable; -const BiggestParsable kBiggestParsableMax = ULLONG_MAX; -const BiggestSignedParsable kBiggestSignedParsableMax = LLONG_MAX; # else typedef unsigned long long BiggestParsable; typedef signed long long BiggestSignedParsable; -const BiggestParsable kBiggestParsableMax = - ::std::numeric_limits<BiggestParsable>::max(); -const BiggestSignedParsable kBiggestSignedParsableMax = - ::std::numeric_limits<BiggestSignedParsable>::max(); # endif // GTEST_OS_WINDOWS +// We cannot use std::numeric_limits<T>::max() as it clashes with the +// max() macro defined by <windows.h>. +const BiggestParsable kBiggestParsableMax = ULLONG_MAX; +const BiggestSignedParsable kBiggestSignedParsableMax = LLONG_MAX; + TEST(ParseNaturalNumberTest, RejectsInvalidFormat) { BiggestParsable result = 0; |