Merge commit '211e3fb4' into traffic

# Conflicts:
#	android/app/src/main/cpp/CMakeLists.txt
#	android/app/src/main/java/app/organicmaps/sdk/util/Config.java
#	android/app/src/main/java/app/organicmaps/settings/SettingsPrefsFragment.java
#	android/app/src/main/java/app/organicmaps/widget/placepage/sections/PlacePageLinksFragment.java
#	android/sdk/src/main/cpp/app/organicmaps/sdk/OrganicMaps.cpp
#	indexer/ftypes_matcher.hpp
#	iphone/Maps/Maps.xcodeproj/project.pbxproj
This commit is contained in:
mvglasow
2025-08-16 18:04:14 +03:00
1752 changed files with 25177 additions and 870703 deletions

View File

@@ -12,7 +12,6 @@
#include "geometry/point2d.hpp"
#include "geometry/rect2d.hpp"
#include "platform/mwm_version.hpp"
#include "platform/platform.hpp"
#include "base/assert.hpp"
@@ -27,11 +26,13 @@
#include <utility>
#include <vector>
namespace country_info_getter_tests
{
using namespace storage;
using namespace std;
namespace
{
static double constexpr kRectCompareEpsilon = 1e-2;
bool IsEmptyName(map<string, CountryInfo> const & id2info, string const & id)
{
auto const it = id2info.find(id);
@@ -75,7 +76,6 @@ Cont Flatten(vector<Cont> const & cs)
res.insert(res.end(), c.begin(), c.end());
return res;
}
} // namespace
UNIT_TEST(CountryInfoGetter_GetByPoint_Smoke)
{
@@ -224,7 +224,7 @@ UNIT_TEST(CountryInfoGetter_GetLimitRectForLeafSingleMwm)
m2::RectD const expectedBoundingBox = {9.205259 /* minX */, -18.34456 /* minY */,
24.08212 /* maxX */, -4.393187 /* maxY */};
TEST(AlmostEqualRectsAbs(boundingBox, expectedBoundingBox), ());
TEST(AlmostEqualAbs(boundingBox, expectedBoundingBox, kRectCompareEpsilon), ());
}
UNIT_TEST(CountryInfoGetter_RegionRects)
@@ -245,7 +245,7 @@ UNIT_TEST(CountryInfoGetter_RegionRects)
for (auto const & region : regions)
region.ForEachPoint([&](m2::PointD const & point) { rect.Add(point); });
TEST(AlmostEqualRectsAbs(rect, countries[i].m_rect), (rect, countries[i].m_rect));
TEST(AlmostEqualAbs(rect, countries[i].m_rect, kRectCompareEpsilon), (rect, countries[i].m_rect));
}
}
@@ -424,3 +424,4 @@ BENCHMARK_TEST(CountryInfoGetter_RegionsByRect)
avgTimeByCountry[longest]));
}
}
} // namespace country_info_getter_tests

View File

@@ -14,13 +14,4 @@ std::unique_ptr<storage::CountryInfoGetter> CreateCountryInfoGetter()
{
return CountryInfoReader::CreateCountryInfoGetter(GetPlatform());
}
bool AlmostEqualRectsAbs(const m2::RectD & r1, const m2::RectD & r2)
{
double constexpr kEpsilon = 1e-2;
return base::AlmostEqualAbs(r1.maxX(), r2.maxX(), kEpsilon)
&& base::AlmostEqualAbs(r1.maxY(), r2.maxY(), kEpsilon)
&& base::AlmostEqualAbs(r1.minX(), r2.minX(), kEpsilon)
&& base::AlmostEqualAbs(r1.minY(), r2.minY(), kEpsilon);
}
} // namespace storage

View File

@@ -10,5 +10,4 @@ class CountryInfoGetter;
std::unique_ptr<CountryInfoGetter> CreateCountryInfoGetter();
bool AlmostEqualRectsAbs(const m2::RectD & r1, const m2::RectD & r2);
} // namespace storage

View File

@@ -1162,7 +1162,8 @@ UNIT_CLASS_TEST(StorageTest, CalcLimitRect)
m2::RectD const expectedBoundingBox = {-8.6689 /* minX */, 19.32443 /* minY */,
11.99734 /* maxX */, 45.23 /* maxY */};
TEST(AlmostEqualRectsAbs(boundingBox, expectedBoundingBox), ());
static double constexpr kEpsilon = 1e-2;
TEST(AlmostEqualAbs(boundingBox, expectedBoundingBox, kEpsilon), ());
}
UNIT_TEST(StorageTest_CountriesNamesTest)