Merge pull request #5492 from bykoianko/master-routing-integration-tests-fix

routing integration test fix.
This commit is contained in:
Yuri Gorshenin 2017-03-01 14:18:56 +03:00 committed by GitHub
commit 41acb759a9
3 changed files with 13 additions and 3 deletions

View file

@ -79,14 +79,20 @@ namespace integration
unique_ptr<CarRouter> CreateCarRouter(Index & index,
storage::CountryInfoGetter const & infoGetter,
traffic::TrafficCache const & trafficCache)
traffic::TrafficCache const & trafficCache,
vector<LocalCountryFile> const & localFiles)
{
auto const countryFileGetter = [&infoGetter](m2::PointD const & pt) {
return infoGetter.GetRegionCountryId(pt);
};
shared_ptr<NumMwmIds> numMwmIds = make_shared<NumMwmIds>();
for (LocalCountryFile const & f : localFiles)
numMwmIds->RegisterFile(f.GetCountryFile());
auto carRouter = make_unique<CarRouter>(index, countryFileGetter,
SingleMwmRouter::CreateCarRouter(countryFileGetter, nullptr, trafficCache, index));
SingleMwmRouter::CreateCarRouter(countryFileGetter, numMwmIds,
trafficCache, index));
return carRouter;
}
@ -109,7 +115,8 @@ namespace integration
public:
OsrmRouterComponents(vector<LocalCountryFile> const & localFiles)
: IRouterComponents(localFiles)
, m_carRouter(CreateCarRouter(m_featuresFetcher->GetIndex(), *m_infoGetter, m_trafficCache))
, m_carRouter(CreateCarRouter(m_featuresFetcher->GetIndex(), *m_infoGetter, m_trafficCache,
localFiles))
{
}

View file

@ -297,6 +297,7 @@ unique_ptr<SingleMwmRouter> SingleMwmRouter::CreateCarRouter(
TCountryFileFn const & countryFileFn, shared_ptr<NumMwmIds> numMwmIds,
traffic::TrafficCache const & trafficCache, Index & index)
{
CHECK(numMwmIds, ());
auto vehicleModelFactory = make_shared<CarModelFactory>();
// @TODO Bicycle turn generation engine is used now. It's ok for the time being.
// But later a special car turn generation engine should be implemented.

View file

@ -40,6 +40,8 @@ public:
Route & route) override;
void SetCountry(string const & country) { m_country = country; }
/// \note |numMwmIds| should not be null.
static unique_ptr<SingleMwmRouter> CreateCarRouter(TCountryFileFn const & countryFileFn,
shared_ptr<NumMwmIds> numMwmIds,
traffic::TrafficCache const & trafficCache,