From 0551addfca3b34765cee748e6aecfff499830333 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Mon, 8 May 2023 10:16:10 +0200 Subject: [PATCH] Fix `Projection.MetersPerPixelAtLatitude` test (#1114) --- test/util/projection.test.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/util/projection.test.cpp b/test/util/projection.test.cpp index 96fb2e749..21c7651bc 100644 --- a/test/util/projection.test.cpp +++ b/test/util/projection.test.cpp @@ -52,14 +52,14 @@ TEST(Projection, Boundaries) { TEST(Projection, MetersPerPixelAtLatitude) { double zoom = 0; - EXPECT_DOUBLE_EQ(Projection::getMetersPerPixelAtLatitude(0, zoom), 78271.516964020484); - EXPECT_DOUBLE_EQ(Projection::getMetersPerPixelAtLatitude(-util::LATITUDE_MAX, zoom), 6752.2284729446501); + EXPECT_NEAR(Projection::getMetersPerPixelAtLatitude(0, zoom), 78271.516964020484, 1e-7); + EXPECT_NEAR(Projection::getMetersPerPixelAtLatitude(-util::LATITUDE_MAX, zoom), 6752.2284729446501, 1e-7); EXPECT_DOUBLE_EQ(Projection::getMetersPerPixelAtLatitude(util::LATITUDE_MAX, zoom), Projection::getMetersPerPixelAtLatitude(-util::LATITUDE_MAX, zoom)); zoom = 20; - EXPECT_DOUBLE_EQ(Projection::getMetersPerPixelAtLatitude(0, zoom), 0.074645535434742435); - EXPECT_DOUBLE_EQ(Projection::getMetersPerPixelAtLatitude(-util::LATITUDE_MAX, zoom), 0.0064394268731543065); + EXPECT_NEAR(Projection::getMetersPerPixelAtLatitude(0, zoom), 0.074645535434742435, 1e-7); + EXPECT_NEAR(Projection::getMetersPerPixelAtLatitude(-util::LATITUDE_MAX, zoom), 0.0064394268731543065, 1e-7); EXPECT_DOUBLE_EQ(Projection::getMetersPerPixelAtLatitude(std::numeric_limits::lowest(), zoom), Projection::getMetersPerPixelAtLatitude(std::numeric_limits::max(), zoom));