| 42 | } // namespace |
| 43 | |
| 44 | RoutingTest::RoutingTest(routing::IRoadGraph::Mode mode, routing::VehicleType type, |
| 45 | std::set<std::string> const & neededMaps) |
| 46 | : m_mode(mode) |
| 47 | , m_type(type) |
| 48 | , m_neededMaps(neededMaps) |
| 49 | , m_numMwmIds(std::make_unique<routing::NumMwmIds>()) |
| 50 | { |
| 51 | classificator::Load(); |
| 52 | |
| 53 | Platform & platform = GetPlatform(); |
| 54 | m_cig = storage::CountryInfoReader::CreateCountryInfoGetter(platform); |
| 55 | |
| 56 | platform::FindAllLocalMapsAndCleanup(std::numeric_limits<int64_t>::max(), m_localFiles); |
| 57 | |
| 58 | std::set<std::string> registeredMaps; |
| 59 | for (auto const & localFile : m_localFiles) |
| 60 | { |
| 61 | m_numMwmIds->RegisterFile(localFile.GetCountryFile()); |
| 62 | |
| 63 | auto const & name = localFile.GetCountryName(); |
| 64 | if (m_neededMaps.count(name) == 0) |
| 65 | continue; |
| 66 | |
| 67 | UNUSED_VALUE(m_dataSource.RegisterMap(localFile)); |
| 68 | |
| 69 | auto const & countryFile = localFile.GetCountryFile(); |
| 70 | TEST(m_dataSource.IsLoaded(countryFile), ()); |
| 71 | MwmSet::MwmId const id = m_dataSource.GetMwmIdByCountryFile(countryFile); |
| 72 | TEST(id.IsAlive(), ()); |
| 73 | |
| 74 | registeredMaps.insert(name); |
| 75 | } |
| 76 | |
| 77 | if (registeredMaps != m_neededMaps) |
| 78 | { |
| 79 | for (auto const & file : m_neededMaps) |
| 80 | if (registeredMaps.count(file) == 0) |
| 81 | LOG(LERROR, ("Can't find map:", file)); |
| 82 | TEST(false, ("Some maps can't be found. See error messages above.")); |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | void RoutingTest::TestRouters(m2::PointD const & startPos, m2::PointD const & finalPos) |
| 87 | { |
nothing calls this directly
no test coverage detected