From 9213224293daab92d34f3b19bbea3c6e7bc5d111 Mon Sep 17 00:00:00 2001 From: Vladimir Byko-Ianko Date: Fri, 7 Jun 2019 10:37:23 +0300 Subject: [PATCH] [routing] Fixing routing quality and integration tests after packed_polygons.bin update. --- routing/routing_integration_tests/routing_test_tools.cpp | 4 +++- routing/routing_quality/utils.cpp | 8 ++++---- storage/country_parent_getter.hpp | 2 ++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/routing/routing_integration_tests/routing_test_tools.cpp b/routing/routing_integration_tests/routing_test_tools.cpp index a375291d5f..a7391f7a60 100644 --- a/routing/routing_integration_tests/routing_test_tools.cpp +++ b/routing/routing_integration_tests/routing_test_tools.cpp @@ -18,6 +18,7 @@ #include "indexer/data_source.hpp" #include "storage/country_parent_getter.hpp" +#include "storage/storage.hpp" #include "platform/local_country_file.hpp" #include "platform/local_country_file_utils.hpp" @@ -102,13 +103,14 @@ unique_ptr CreateVehicleRouter(DataSource & dataSource, return infoGetter.GetLimitRectForLeaf(countryId); }; + storage::Storage storage; auto numMwmIds = make_shared(); for (auto const & f : localFiles) { auto const & countryFile = f.GetCountryFile(); auto const mwmId = dataSource.GetMwmIdByCountryFile(countryFile); CHECK(mwmId.IsAlive(), ()); - if (mwmId.GetInfo()->GetType() == MwmInfo::COUNTRY && countryFile.GetName() != "minsk-pass") + if (storage.IsLeaf(countryFile.GetName())) numMwmIds->RegisterFile(countryFile); } diff --git a/routing/routing_quality/utils.cpp b/routing/routing_quality/utils.cpp index cc55ab4e9c..582754ef6f 100644 --- a/routing/routing_quality/utils.cpp +++ b/routing/routing_quality/utils.cpp @@ -76,17 +76,17 @@ private: classificator::Load(); vector localFiles; - platform::FindAllLocalMapsAndCleanup(numeric_limits::max(), localFiles); + platform::FindAllLocalMapsAndCleanup(numeric_limits::max(), localFiles); for (auto const & localFile : localFiles) { UNUSED_VALUE(m_dataSource.RegisterMap(localFile)); auto const & countryFile = localFile.GetCountryFile(); auto const mwmId = m_dataSource.GetMwmIdByCountryFile(countryFile); CHECK(mwmId.IsAlive(), ()); - // We have to exclude minsk-pass because we can't register mwm which is not from - // countries.txt. - if (mwmId.GetInfo()->GetType() == MwmInfo::COUNTRY && countryFile.GetName() != "minsk-pass") + + // Only maps from countries.txt should be used for tests. + if (m_cpg->GetStorageForTesting().IsLeaf(countryFile.GetName())) m_numMwmIds->RegisterFile(countryFile); } } diff --git a/storage/country_parent_getter.hpp b/storage/country_parent_getter.hpp index 99e0471f8a..bcbdc4ad30 100644 --- a/storage/country_parent_getter.hpp +++ b/storage/country_parent_getter.hpp @@ -14,6 +14,8 @@ public: std::string const & countriesDir = ""); std::string operator()(std::string const & id) const; + Storage const & GetStorageForTesting() const { return *m_storage; } + private: std::shared_ptr m_storage; };