summaryrefslogtreecommitdiff
path: root/Source/UnitTests/Common/MathUtilTest.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2016-04-03 19:08:47 -0400
committerLioncash <mathew1800@gmail.com>2016-04-03 19:16:47 -0400
commit8d9221a71e235393db3c03322e1324f400d0d915 (patch)
treefafeb01f3492a353372a0163e5f67e0b114e8ef6 /Source/UnitTests/Common/MathUtilTest.cpp
parentb3c77fd96a4eb5ada025b3b7937757a3456434bf (diff)
MathUtilTest: Fix tests on MSVC - Document compiler bug
MSVC's implementation of numeric_limits currently generates incorrect signaling NaNs. The resulting values are actually quiet NaNs instead. This commit is based off of a solution by shuffle2. The only difference is a template specialization for floats is also added to cover all bases
Diffstat (limited to 'Source/UnitTests/Common/MathUtilTest.cpp')
-rw-r--r--Source/UnitTests/Common/MathUtilTest.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/UnitTests/Common/MathUtilTest.cpp b/Source/UnitTests/Common/MathUtilTest.cpp
index f7427cc8c3..0eabd14694 100644
--- a/Source/UnitTests/Common/MathUtilTest.cpp
+++ b/Source/UnitTests/Common/MathUtilTest.cpp
@@ -23,13 +23,13 @@ TEST(MathUtil, Clamp)
TEST(MathUtil, IsQNAN)
{
EXPECT_TRUE(MathUtil::IsQNAN(std::numeric_limits<double>::quiet_NaN()));
- EXPECT_FALSE(MathUtil::IsQNAN(std::numeric_limits<double>::signaling_NaN()));
+ EXPECT_FALSE(MathUtil::IsQNAN(MathUtil::SNANConstant<double>()));
}
TEST(MathUtil, IsSNAN)
{
EXPECT_FALSE(MathUtil::IsSNAN(std::numeric_limits<double>::quiet_NaN()));
- EXPECT_TRUE(MathUtil::IsSNAN(std::numeric_limits<double>::signaling_NaN()));
+ EXPECT_TRUE(MathUtil::IsSNAN(MathUtil::SNANConstant<double>()));
}
TEST(MathUtil, IntLog2)