ADL for AlmostEqual* and use math:: instead of base:: (#9634)

* ADL for AlmostEqual* and use math:: instead of base::

Signed-off-by: Alexander Borsuk <me@alex.bio>
This commit is contained in:
Alexander Borsuk
2025-07-07 20:49:00 +02:00
committed by Konstantin Pastbin
parent 82133c5743
commit 30718e106e
175 changed files with 542 additions and 559 deletions

View File

@@ -8,14 +8,15 @@
#include <cstdint>
#include <vector>
using namespace std;
namespace chart_generator_tests
{
using std::vector;
using maps::kAltitudeChartBPP;
namespace
{
double constexpr kEpsilon = 0.00001;
using namespace maps;
bool AlmostEqualAbs(vector<double> const & v1, vector<double> const & v2)
{
if (v1.size() != v2.size())
@@ -23,7 +24,7 @@ bool AlmostEqualAbs(vector<double> const & v1, vector<double> const & v2)
for (size_t i = 0; i < v1.size(); ++i)
{
if (!base::AlmostEqualAbs(v1[i], v2[i], kEpsilon))
if (!::AlmostEqualAbs(v1[i], v2[i], kEpsilon))
return false;
}
return true;
@@ -50,6 +51,7 @@ void TestAngleColors(size_t width, size_t height, vector<uint8_t> const & frameB
TEST(IsColor(frameBuffer, kAltitudeChartBPP * height * width - kAltitudeChartBPP /* startColorIdx */,
expectedR, expectedG, expectedB, expectedA), ());
}
} // namespace
UNIT_TEST(ScaleChartData_Test)
{
@@ -261,4 +263,4 @@ UNIT_TEST(GenerateChart_Test)
230 /* expectedG */, 140 /* expectedB */, 255 /* expectedA */),
());
}
} // namespace
} // namespace chart_generator_tests