MCPcopy Create free account
hub / github.com/comaps/comaps / RoutingTest

Method RoutingTest

libs/routing/routing_benchmarks/helpers.cpp:44–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42} // namespace
43
44RoutingTest::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
86void RoutingTest::TestRouters(m2::PointD const & startPos, m2::PointD const & finalPos)
87{

Callers

nothing calls this directly

Calls 12

TESTFunction · 0.85
RegisterFileMethod · 0.80
GetMwmIdByCountryFileMethod · 0.80
LoadFunction · 0.50
CreateCountryInfoGetterFunction · 0.50
GetCountryNameMethod · 0.45
countMethod · 0.45
RegisterMapMethod · 0.45
IsLoadedMethod · 0.45
IsAliveMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected