Skip to content

Commit

Permalink
Fix ScalarNearlyEqual test (flutter#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdero authored and dnfield committed Apr 27, 2022
1 parent 9d6048a commit 2a1b560
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions impeller/geometry/geometry_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<float>::epsilon()*4));
ASSERT_TRUE(ScalarNearlyEqual(
1.0f, 1.0f + std::numeric_limits<float>::epsilon() * 4));
}

TEST(GeometryTest, RotationMatrix) {
Expand Down

0 comments on commit 2a1b560

Please sign in to comment.