From 2a1b56096b47e0e77a782e8b98c9c2c9854cc2fb Mon Sep 17 00:00:00 2001 From: Brandon DeRosier Date: Mon, 7 Mar 2022 11:01:05 -0800 Subject: [PATCH] Fix ScalarNearlyEqual test (#56) --- impeller/geometry/geometry_unittests.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/impeller/geometry/geometry_unittests.cc b/impeller/geometry/geometry_unittests.cc index 6c4f2a867754c..8299c45eb4873 100644 --- a/impeller/geometry/geometry_unittests.cc +++ b/impeller/geometry/geometry_unittests.cc @@ -18,11 +18,12 @@ namespace impeller { namespace testing { TEST(GeometryTest, ScalarNearlyEqual) { - ASSERT_FALSE(ScalarNearlyEqual(0.002f, 0.001f)); + ASSERT_FALSE(ScalarNearlyEqual(0.0021f, 0.001f)); + ASSERT_TRUE(ScalarNearlyEqual(0.0019f, 0.001f)); ASSERT_TRUE(ScalarNearlyEqual(0.002f, 0.001f, 0.0011f)); ASSERT_FALSE(ScalarNearlyEqual(0.002f, 0.001f, 0.0009f)); - ASSERT_TRUE( - ScalarNearlyEqual(1.0f, 1.0f + std::numeric_limits::epsilon()*4)); + ASSERT_TRUE(ScalarNearlyEqual( + 1.0f, 1.0f + std::numeric_limits::epsilon() * 4)); } TEST(GeometryTest, RotationMatrix) {