Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #9904 from shuffle2/msvc-volatile-ut
unittests: remove some msvc-specific casts
  • Loading branch information
Tilka committed Jul 18, 2021
2 parents e9068e1 + 1009825 commit 8feff42
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Source/UnitTests/Common/FloatUtilsTest.cpp
Expand Up @@ -28,10 +28,8 @@ TEST(FloatUtils, FlushToZero)
// we want the multiplication to occur at test runtime.
volatile float s = std::numeric_limits<float>::denorm_min();
volatile double d = std::numeric_limits<double>::denorm_min();
// Casting away the volatile attribute is required in order for msvc to resolve this to the
// correct instance of the comparison function.
EXPECT_LT(0.f, (float)(s * 2));
EXPECT_LT(0.0, (double)(d * 2));
EXPECT_LT(0.f, s * 2);
EXPECT_LT(0.0, d * 2);

EXPECT_EQ(+0.0, Common::FlushToZero(+std::numeric_limits<double>::denorm_min()));
EXPECT_EQ(-0.0, Common::FlushToZero(-std::numeric_limits<double>::denorm_min()));
Expand Down

0 comments on commit 8feff42

Please sign in to comment.