From f3ab3b740dded1fb61b07628f4b2ac71989ecc59 Mon Sep 17 00:00:00 2001 From: Lev Dragunov Date: Wed, 8 Apr 2015 18:10:17 +0300 Subject: [PATCH] PR fixes --- integration_tests/osrm_test_tools.cpp | 10 +++-- map/framework.cpp | 2 +- map/routing_session.cpp | 4 +- map/routing_session.hpp | 5 ++- .../pedestrian_routing_test.cpp | 2 +- routing/astar_router.cpp | 8 ++-- routing/astar_router.hpp | 6 +-- routing/async_router.cpp | 24 +++++------- routing/async_router.hpp | 27 +++++++------ routing/dijkstra_router.cpp | 3 +- routing/dijkstra_router.hpp | 5 +-- routing/osrm_online_router.hpp | 1 - routing/osrm_router.cpp | 39 +++++++++++-------- routing/osrm_router.hpp | 4 +- routing/road_graph_router.cpp | 10 ++--- routing/road_graph_router.hpp | 10 ++--- routing/router.hpp | 13 +++---- routing/routing.pro | 35 +++++++++-------- routing/routing_tests/astar_router_test.cpp | 8 ++-- .../routing_tests/dijkstra_router_test.cpp | 7 ++-- 20 files changed, 113 insertions(+), 110 deletions(-) diff --git a/integration_tests/osrm_test_tools.cpp b/integration_tests/osrm_test_tools.cpp index 7b929f6724..c24e98516b 100644 --- a/integration_tests/osrm_test_tools.cpp +++ b/integration_tests/osrm_test_tools.cpp @@ -76,14 +76,14 @@ namespace integration } shared_ptr CreateOsrmRouter(shared_ptr featuresFetcher, - shared_ptr searchEngine) + shared_ptr searchEngine) { ASSERT(featuresFetcher, ()); ASSERT(searchEngine, ()); shared_ptr osrmRouter(new OsrmRouter(&featuresFetcher->GetIndex(), - [searchEngine] (m2::PointD const & pt) - { + [searchEngine](m2::PointD const & pt) + { return searchEngine->GetCountryFile(pt); })); return osrmRouter; @@ -97,6 +97,7 @@ namespace integration m_searchEngine(CreateSearchEngine(m_featuresFetcher)), m_osrmRouter(CreateOsrmRouter(m_featuresFetcher, m_searchEngine)) {} OsrmRouter * GetOsrmRouter() const { return m_osrmRouter.get(); } + private: shared_ptr m_featuresFetcher; shared_ptr m_searchEngine; @@ -141,7 +142,8 @@ namespace integration OsrmRouter * osrmRouter = routerComponents->GetOsrmRouter(); ASSERT(osrmRouter, ()); shared_ptr route(new Route("mapsme")); - OsrmRouter::ResultCode result = osrmRouter->CalculateRoute(startPt, startDr, finalPt, *route.get()); + OsrmRouter::ResultCode result = + osrmRouter->CalculateRoute(startPt, startDr, finalPt, *route.get()); return RouteResultT(route, result); } diff --git a/map/framework.cpp b/map/framework.cpp index 4f233ddd07..80fccd0e66 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -276,7 +276,7 @@ Framework::Framework() m_storage.Init(bind(&Framework::UpdateAfterDownload, this, _1, _2)); LOG(LDEBUG, ("Storage initialized")); - m_routingSession.SetRouter(new AStarRouter(&m_model.GetIndex())); + m_routingSession.SetRouter(unique_ptr(new AStarRouter(&m_model.GetIndex()))); /*m_routingSession.SetRouter(new OsrmRouter(&m_model.GetIndex(), [this] (m2::PointD const & pt) { return GetSearchEngine()->GetCountryFile(pt); diff --git a/map/routing_session.cpp b/map/routing_session.cpp index 79eb8715e4..4a6cca3c96 100644 --- a/map/routing_session.cpp +++ b/map/routing_session.cpp @@ -186,9 +186,9 @@ void RoutingSession::AssignRoute(Route & route) m_route.Swap(route); } -void RoutingSession::SetRouter(IRouter * router) +void RoutingSession::SetRouter(unique_ptr && router) { - m_router.reset(new AsyncRouter(router)); + m_router.reset(new AsyncRouter(move(router))); } void RoutingSession::DeleteIndexFile(string const & fileName) diff --git a/map/routing_session.hpp b/map/routing_session.hpp index f9b275f146..799bd9afa5 100644 --- a/map/routing_session.hpp +++ b/map/routing_session.hpp @@ -45,7 +45,7 @@ public: */ RoutingSession(); - void SetRouter(IRouter * router); + void SetRouter(unique_ptr && router); typedef function TReadyCallbackFn; @@ -64,7 +64,8 @@ public: void DeleteIndexFile(string const & fileName); void MatchLocationToRoute(location::GpsInfo & location, location::RouteMatchingInfo & routeMatchingInfo) const; - void ActivateAdditionalFeatures() {} //TODO (Dragunov) Make activation of the pedestrian routing + // TODO (Dragunov) Make activation of the pedestrian routing + void ActivateAdditionalFeatures() {} private: struct DoReadyCallback diff --git a/pedestrian_routing_benchmarks/pedestrian_routing_test.cpp b/pedestrian_routing_benchmarks/pedestrian_routing_test.cpp index 4e96901d3d..20119307c9 100644 --- a/pedestrian_routing_benchmarks/pedestrian_routing_test.cpp +++ b/pedestrian_routing_benchmarks/pedestrian_routing_test.cpp @@ -56,7 +56,7 @@ void TestTwoPoints(uint32_t featureIdStart, uint32_t segIdStart, uint32_t featur my::Timer timer; LOG(LINFO, ("Calculating routing...")); - router.CalculateRouteOnMwm(startPos, finalPos, route); + router.CalculateM2MRoute(startPos, finalPos, route); LOG(LINFO, ("Route length:", route.size())); LOG(LINFO, ("Elapsed:", timer.ElapsedSeconds(), "seconds")); } diff --git a/routing/astar_router.cpp b/routing/astar_router.cpp index d64dc7b87b..76bdac64dd 100644 --- a/routing/astar_router.cpp +++ b/routing/astar_router.cpp @@ -9,7 +9,6 @@ namespace routing { - static double const kMaxSpeedMPS = 5000.0 / 3600; // This implementation is based on the view that the A* algorithm @@ -24,11 +23,12 @@ static double const kMaxSpeedMPS = 5000.0 / 3600; // // The vertices of the graph are of type RoadPos. // The edges of the graph are of type PossibleTurn. -void AStarRouter::CalculateRouteOnMwm(vector const & startPos, vector const & finalPos, vector & route) +void AStarRouter::CalculateM2MRoute(vector const & startPos, + vector const & finalPos, vector & route) { #if defined(DEBUG) for (auto const & roadPos : finalPos) - LOG(LDEBUG, ("AStarRouter::CalculateRouteOnMwm(): finalPos:", roadPos)); + LOG(LDEBUG, ("AStarRouter::CalculateM2MRoute(): finalPos:", roadPos)); #endif // defined(DEBUG) ASSERT_GREATER(finalPos.size(), 0, ()); @@ -40,7 +40,7 @@ void AStarRouter::CalculateRouteOnMwm(vector const & startPos, vector const & startPos, - vector const & finalPos, - vector & route) override; + // TODO (Dragunov) ResultCode returning + void CalculateM2MRoute(vector const & startPos, vector const & finalPos, + vector & route) override; protected: diff --git a/routing/async_router.cpp b/routing/async_router.cpp index acb62237b6..227389d778 100644 --- a/routing/async_router.cpp +++ b/routing/async_router.cpp @@ -1,27 +1,24 @@ #include "async_router.hpp" -#include "../base/macros.hpp" #include "../platform/platform.hpp" +#include "../base/macros.hpp" #include "../base/logging.hpp" namespace routing { -AsyncRouter::AsyncRouter(IRouter * router) : m_router(router) +AsyncRouter::AsyncRouter(unique_ptr && router) : m_router(move(router)) { m_isReadyThread.clear(); } -AsyncRouter::~AsyncRouter() -{ - ClearState(); -} +AsyncRouter::~AsyncRouter() { ClearState(); } void AsyncRouter::CalculateRoute(m2::PointD const & startPoint, m2::PointD const & direction, m2::PointD const & finalPoint, ReadyCallback const & callback) { ASSERT(m_router, ()); { - threads::MutexGuard guard(m_paramsMutex); + lock_guard guard(m_paramsMutex); UNUSED_VALUE(guard); m_startPoint = startPoint; @@ -31,7 +28,7 @@ void AsyncRouter::CalculateRoute(m2::PointD const & startPoint, m2::PointD const m_router->Cancel(); } - GetPlatform().RunAsync(bind(&AsyncRouter::CalculateRouteAsync, this, callback)); + GetPlatform().RunAsync(bind(&AsyncRouter::CalculateRouteImpl, this, callback)); } void AsyncRouter::ClearState() @@ -39,12 +36,11 @@ void AsyncRouter::ClearState() ASSERT(m_router, ()); m_router->Cancel(); - threads::MutexGuard guard(m_routeMutex); - UNUSED_VALUE(guard); + lock_guard guard(m_routeMutex); m_router->ClearState(); } -void AsyncRouter::CalculateRouteAsync(ReadyCallback const & callback) +void AsyncRouter::CalculateRouteImpl(ReadyCallback const & callback) { if (m_isReadyThread.test_and_set()) return; @@ -52,15 +48,13 @@ void AsyncRouter::CalculateRouteAsync(ReadyCallback const & callback) Route route(m_router->GetName()); IRouter::ResultCode code; - threads::MutexGuard guard(m_routeMutex); - UNUSED_VALUE(guard); + lock_guard guard(m_routeMutex); m_isReadyThread.clear(); m2::PointD startPoint, finalPoint, startDirection; { - threads::MutexGuard params(m_paramsMutex); - UNUSED_VALUE(params); + lock_guard params(m_paramsMutex); startPoint = m_startPoint; finalPoint = m_finalPoint; diff --git a/routing/async_router.hpp b/routing/async_router.hpp index 4a2e494310..593c5fc9b4 100644 --- a/routing/async_router.hpp +++ b/routing/async_router.hpp @@ -3,23 +3,25 @@ #include "route.hpp" #include "router.hpp" -#include "../base/mutex.hpp" +#include "../std/mutex.hpp" #include "../std/atomic.hpp" #include "../std/unique_ptr.hpp" namespace routing { - /// Callback takes ownership of passed route. -typedef function ReadyCallback; +typedef function ReadyCallback; class AsyncRouter { public: /// AsyncRouter is a wrapper class to run routing routines in the different thread - /// @param router pointer to the router realisation. AsyncRouter will destroy's router - AsyncRouter(IRouter * router); + /// @param router pointer to the router implementation. AsyncRouter will take ownership over + /// router. + AsyncRouter(unique_ptr && router); + + virtual ~AsyncRouter(); /// Main method to calulate new route from startPt to finalPt with start direction /// Processed result will be passed to callback. Callback will called at GUI thread. @@ -29,21 +31,22 @@ public: /// @param finalPoint target point for route /// @param callback function to return routing result virtual void CalculateRoute(m2::PointD const & startPoint, m2::PointD const & direction, - m2::PointD const & finalPoint, ReadyCallback const & callback); + m2::PointD const & finalPoint, ReadyCallback const & callback); /// Interrupt routing and clear buffers virtual void ClearState(); - virtual ~AsyncRouter(); - private: - void CalculateRouteAsync(ReadyCallback const & callback); + /// This function is called in async mode + void CalculateRouteImpl(ReadyCallback const & callback); - threads::Mutex m_paramsMutex; - threads::Mutex m_routeMutex; + mutex m_paramsMutex; + mutex m_routeMutex; atomic_flag m_isReadyThread; - m2::PointD m_startPoint, m_finalPoint, m_startDirection; + m2::PointD m_startPoint; + m2::PointD m_finalPoint; + m2::PointD m_startDirection; unique_ptr m_router; }; diff --git a/routing/dijkstra_router.cpp b/routing/dijkstra_router.cpp index c0b3da6655..920b825988 100644 --- a/routing/dijkstra_router.cpp +++ b/routing/dijkstra_router.cpp @@ -9,7 +9,8 @@ namespace routing DijkstraRouter::ShortestPath const * const DijkstraRouter::ShortestPath::FINAL_POS = reinterpret_cast(1); -void DijkstraRouter::CalculateRouteOnMwm(vector const & startPos, vector const & finalPos, vector & route) +void DijkstraRouter::CalculateM2MRoute(vector const & startPos, + vector const & finalPos, vector & route) { m_entries = PathSet(); m_queue = PossiblePathQueue(); diff --git a/routing/dijkstra_router.hpp b/routing/dijkstra_router.hpp index e82c2c46fc..c7f48a31f4 100644 --- a/routing/dijkstra_router.hpp +++ b/routing/dijkstra_router.hpp @@ -20,9 +20,8 @@ public: DijkstraRouter(Index const * pIndex = 0) : BaseT(pIndex) {} virtual string GetName() const { return "routeme"; } - virtual void CalculateRouteOnMwm(vector const & startPos, vector const & finalPos, - vector & route); - + virtual void CalculateM2MRoute(vector const & startPos, vector const & finalPos, + vector & route); private: class ShortestPath diff --git a/routing/osrm_online_router.hpp b/routing/osrm_online_router.hpp index 471ad30d0e..72f9652df6 100644 --- a/routing/osrm_online_router.hpp +++ b/routing/osrm_online_router.hpp @@ -9,7 +9,6 @@ namespace downloader { class HttpRequest; } namespace routing { - class OsrmOnlineRouter : public AsyncRouter { m2::PointD m_finalPt; diff --git a/routing/osrm_router.cpp b/routing/osrm_router.cpp index 970e0cc5a4..c60507a6d7 100644 --- a/routing/osrm_router.cpp +++ b/routing/osrm_router.cpp @@ -27,6 +27,12 @@ #include "3party/osrm/osrm-backend/RoutingAlgorithms/ShortestPathRouting.h" #include "3party/osrm/osrm-backend/RoutingAlgorithms/NToMManyToManyRouting.h" +#define INTERRUPT_WHEN_CANCELLED() \ + do \ + { \ + if (IsCancelled()) \ + return Cancelled; \ + } while (false) namespace routing { @@ -363,7 +369,8 @@ RoutingMappingPtrT RoutingIndexManager::GetMappingByName(string const & fName, I OsrmRouter::OsrmRouter(Index const * index, CountryFileFnT const & fn) : m_pIndex(index), m_indexManager(fn) -{} +{ +} string OsrmRouter::GetName() const { @@ -618,8 +625,7 @@ public: OsrmRouter::ResultCode OsrmRouter::CalculateRoute(m2::PointD const & startPoint, m2::PointD const & startDirection, - m2::PointD const & finalPoint, - Route & route) + m2::PointD const & finalPoint, Route & route) { my::HighResTimer timer(true); RoutingMappingPtrT startMapping = m_indexManager.GetMappingByPoint(startPoint, m_pIndex); @@ -673,7 +679,7 @@ OsrmRouter::ResultCode OsrmRouter::CalculateRoute(m2::PointD const & startPoint, m_CachedTargetPoint = finalPoint; } } - ROUTING_CANCEL_INTERRUPT_CHECK; + INTERRUPT_WHEN_CANCELLED(); LOG(LINFO, ("Duration of the start/stop points lookup", timer.ElapsedNano())); timer.Reset(); @@ -693,7 +699,7 @@ OsrmRouter::ResultCode OsrmRouter::CalculateRoute(m2::PointD const & startPoint, { return RouteNotFound; } - ROUTING_CANCEL_INTERRUPT_CHECK; + INTERRUPT_WHEN_CANCELLED(); // 5. Restore route. @@ -702,8 +708,7 @@ OsrmRouter::ResultCode OsrmRouter::CalculateRoute(m2::PointD const & startPoint, vector points; turns::TurnsGeomT turnsGeom; - MakeTurnAnnotation(routingResult, startMapping, points, turnsDir, times, - turnsGeom); + MakeTurnAnnotation(routingResult, startMapping, points, turnsDir, times, turnsGeom); route.SetGeometry(points.begin(), points.end()); route.SetTurnInstructions(turnsDir); @@ -781,7 +786,7 @@ OsrmRouter::ResultCode OsrmRouter::CalculateRoute(m2::PointD const & startPoint, if (weights.empty()) return StartPointNotFound; - ROUTING_CANCEL_INTERRUPT_CHECK; + INTERRUPT_WHEN_CANCELLED(); // Load target data LastCrossFinder targetFinder(targetMapping, m_CachedTargetTask); @@ -808,7 +813,7 @@ OsrmRouter::ResultCode OsrmRouter::CalculateRoute(m2::PointD const & startPoint, { if (weights[j] == INVALID_EDGE_WEIGHT) continue; - ROUTING_CANCEL_INTERRUPT_CHECK; + INTERRUPT_WHEN_CANCELLED(); string const & nextMwm = startMapping->m_crossContext.getOutgoingMwmName((mwmOutsIter.first + j)->m_outgoingIndex); RoutingMappingPtrT nextMapping; @@ -852,7 +857,7 @@ OsrmRouter::ResultCode OsrmRouter::CalculateRoute(m2::PointD const & startPoint, { while (getPathWeight(crossTasks.top())= finalWeight) continue; - ROUTING_CANCEL_INTERRUPT_CHECK; + INTERRUPT_WHEN_CANCELLED(); string const & nextMwm = currentContext.getOutgoingMwmName(oit->m_outgoingIndex); RoutingMappingPtrT nextMapping; @@ -986,10 +991,12 @@ m2::PointD OsrmRouter::GetPointForTurnAngle(OsrmMappingTypes::FtSeg const & seg, return nextPnt; } -OsrmRouter::ResultCode OsrmRouter::MakeTurnAnnotation( - RawRoutingResultT const & routingResult, RoutingMappingPtrT const & mapping, - vector & points, Route::TurnsT & turnsDir, - Route::TimesT & times, turns::TurnsGeomT & turnsGeom) +OsrmRouter::ResultCode OsrmRouter::MakeTurnAnnotation(RawRoutingResultT const & routingResult, + RoutingMappingPtrT const & mapping, + vector & points, + Route::TurnsT & turnsDir, + Route::TimesT & times, + turns::TurnsGeomT & turnsGeom) { typedef OsrmMappingTypes::FtSeg SegT; SegT const & segBegin = routingResult.m_sourceEdge.m_seg; @@ -1006,7 +1013,7 @@ OsrmRouter::ResultCode OsrmRouter::MakeTurnAnnotation( #endif for (auto i : osrm::irange(0, routingResult.m_routePath.unpacked_path_segments.size())) { - ROUTING_CANCEL_INTERRUPT_CHECK; + INTERRUPT_WHEN_CANCELLED(); // Get all the coordinates for the computed route size_t const n = routingResult.m_routePath.unpacked_path_segments[i].size(); diff --git a/routing/osrm_router.hpp b/routing/osrm_router.hpp index b84f525905..787d2883c3 100644 --- a/routing/osrm_router.hpp +++ b/routing/osrm_router.hpp @@ -166,8 +166,8 @@ protected: */ ResultCode MakeTurnAnnotation(RawRoutingResultT const & routingResult, RoutingMappingPtrT const & mapping, vector & points, - Route::TurnsT & turnsDir, - Route::TimesT & times, turns::TurnsGeomT & turnsGeom); + Route::TurnsT & turnsDir, Route::TimesT & times, + turns::TurnsGeomT & turnsGeom); private: typedef pair MwmOutT; diff --git a/routing/road_graph_router.cpp b/routing/road_graph_router.cpp index ef45a1f8a7..bba292cc7a 100644 --- a/routing/road_graph_router.cpp +++ b/routing/road_graph_router.cpp @@ -108,13 +108,9 @@ bool RoadGraphRouter::IsMyMWM(size_t mwmID) const } IRouter::ResultCode RoadGraphRouter::CalculateRoute(m2::PointD const & startPoint, - m2::PointD const & startDirection, - m2::PointD const & finalPoint, - Route & route) + m2::PointD const & /* startDirection */, + m2::PointD const & finalPoint, Route & route) { - // We can make easy turnaround when walking. So we will not use direction for route calculation - UNUSED_VALUE(startDirection); - vector finalPos; size_t mwmID = GetRoadPos(finalPoint, finalPos); @@ -135,7 +131,7 @@ IRouter::ResultCode RoadGraphRouter::CalculateRoute(m2::PointD const & startPoin vector routePos; - CalculateRouteOnMwm(startPos, finalPos, routePos); + CalculateM2MRoute(startPos, finalPos, routePos); LOG(LINFO, ("Route calculation time: ", timer.ElapsedSeconds())); diff --git a/routing/road_graph_router.hpp b/routing/road_graph_router.hpp index 2fbd5d42f7..4fc94ce9ab 100644 --- a/routing/road_graph_router.hpp +++ b/routing/road_graph_router.hpp @@ -22,14 +22,14 @@ public: RoadGraphRouter(Index const * pIndex); ~RoadGraphRouter(); - virtual void CalculateRouteOnMwm(vector const & startPos, - vector const & finalPos, vector & route) = 0; + virtual void CalculateM2MRoute(vector const & startPos, vector const & finalPos, + vector & route) = 0; virtual void SetRoadGraph(IRoadGraph * pRoadGraph) { m_pRoadGraph.reset(pRoadGraph); } - virtual ResultCode CalculateRoute(m2::PointD const & startPoint, m2::PointD const & startDirection, - m2::PointD const & finalPoint, Route & route) override; + ResultCode CalculateRoute(m2::PointD const & startPoint, m2::PointD const & startDirection, + m2::PointD const & finalPoint, Route & route) override; - protected: +protected: size_t GetRoadPos(m2::PointD const & pt, vector & pos); bool IsMyMWM(size_t mwmID) const; diff --git a/routing/router.hpp b/routing/router.hpp index 612bbc6d58..3a2c47f4c6 100644 --- a/routing/router.hpp +++ b/routing/router.hpp @@ -7,8 +7,6 @@ #include "std/function.hpp" #include "std/string.hpp" -#define ROUTING_CANCEL_INTERRUPT_CHECK if (IsCancelled()) return Cancelled; - namespace routing { @@ -43,14 +41,15 @@ public: /// It will be called in separate thread and only one function will processed in same time. /// @warning please support Cancellable interface calls. You must stop processing when it is true. /// - /// @param startPt point to start routing - /// @param direction start direction for routers with high cost of the turnarounds - /// @param finalPt target point for route + /// @param startPoint point to start routing + /// @param startDirection start direction for routers with high cost of the turnarounds + /// @param finalPoint target point for route /// @param route result route /// @return ResultCode error code or NoError if route was initialised /// @see Cancellable - virtual ResultCode CalculateRoute(m2::PointD const & startingPt, m2::PointD const & startDirection, - m2::PointD const & finalPt, Route & route) = 0; + virtual ResultCode CalculateRoute(m2::PointD const & startPoint, + m2::PointD const & startDirection, + m2::PointD const & finalPoint, Route & route) = 0; }; } diff --git a/routing/routing.pro b/routing/routing.pro index 2f24757419..5df1107422 100644 --- a/routing/routing.pro +++ b/routing/routing.pro @@ -12,35 +12,36 @@ INCLUDEPATH += $$ROOT_DIR/3party/jansson/src \ $$ROOT_DIR/3party/osrm/osrm-backend/Include SOURCES += \ + astar_router.cpp \ + async_router.cpp \ cross_routing_context.cpp \ - osrm_router.cpp \ - osrm_online_router.cpp \ + dijkstra_router.cpp \ + features_road_graph.cpp \ osrm2feature_map.cpp \ + osrm_online_router.cpp \ + osrm_router.cpp \ + road_graph.cpp \ + road_graph_router.cpp \ route.cpp \ routing_mapping.cpp \ turns.cpp \ vehicle_model.cpp \ - astar_router.cpp \ - dijkstra_router.cpp \ - features_road_graph.cpp \ - road_graph_router.cpp \ - road_graph.cpp \ - async_router.cpp \ + HEADERS += \ + astar_router.hpp \ + async_router.hpp \ cross_routing_context.hpp \ - osrm_router.hpp \ - osrm_online_router.hpp \ - osrm_data_facade.hpp \ + dijkstra_router.hpp \ + features_road_graph.hpp \ osrm2feature_map.hpp \ + osrm_data_facade.hpp \ + osrm_online_router.hpp \ + osrm_router.hpp \ + road_graph.hpp \ + road_graph_router.hpp \ route.hpp \ router.hpp \ routing_mapping.h \ turns.hpp \ vehicle_model.hpp \ - astar_router.hpp \ - dijkstra_router.hpp \ - features_road_graph.hpp \ - road_graph_router.hpp \ - road_graph.hpp \ - async_router.hpp \ diff --git a/routing/routing_tests/astar_router_test.cpp b/routing/routing_tests/astar_router_test.cpp index 5941b206c6..e410fa52e9 100644 --- a/routing/routing_tests/astar_router_test.cpp +++ b/routing/routing_tests/astar_router_test.cpp @@ -29,9 +29,9 @@ void TestAStarRouterMock(RoadPos (&finalPos)[finalPosSize], AStarRouter router; router.SetRoadGraph(graph); vector result; - router.CalculateRouteOnMwm(vector(&startPos[0], &startPos[0] + ARRAY_SIZE(startPos)), - vector(&finalPos[0], &finalPos[0] + ARRAY_SIZE(finalPos)), - result); + router.CalculateM2MRoute(vector(&startPos[0], &startPos[0] + ARRAY_SIZE(startPos)), + vector(&finalPos[0], &finalPos[0] + ARRAY_SIZE(finalPos)), + result); TEST_EQUAL(vector(&expected[0], &expected[0] + ARRAY_SIZE(expected)), result, ()); } @@ -54,7 +54,7 @@ void TestAStarRouterMWM(RoadPos (&finalPos)[finalPosSize], tester.Name2FeatureID(startV); vector result; - router.CalculateRouteOnMwm(startV, finalV, result); + router.CalculateM2MRoute(startV, finalV, result); LOG(LDEBUG, (result)); Route route(router.GetName()); diff --git a/routing/routing_tests/dijkstra_router_test.cpp b/routing/routing_tests/dijkstra_router_test.cpp index a0161b58cc..ad2ea1da41 100644 --- a/routing/routing_tests/dijkstra_router_test.cpp +++ b/routing/routing_tests/dijkstra_router_test.cpp @@ -31,8 +31,9 @@ void TestDijkstraRouterMock(RoadPos (&finalPos)[finalPosSize], router.SetRoadGraph(graph); vector result; - router.CalculateRouteOnMwm(vector(&startPos[0], &startPos[0] + ARRAY_SIZE(startPos)), - vector(&finalPos[0], &finalPos[0] + ARRAY_SIZE(finalPos)), result); + router.CalculateM2MRoute(vector(&startPos[0], &startPos[0] + ARRAY_SIZE(startPos)), + vector(&finalPos[0], &finalPos[0] + ARRAY_SIZE(finalPos)), + result); TEST_EQUAL(vector(&expected[0], &expected[0] + ARRAY_SIZE(expected)), result, ()); } @@ -55,7 +56,7 @@ void TestDijkstraRouterMWM(RoadPos (&finalPos)[finalPosSize], tester.Name2FeatureID(startV); vector result; - router.CalculateRouteOnMwm(startV, finalV, result); + router.CalculateM2MRoute(startV, finalV, result); LOG(LDEBUG, (result)); Route route(router.GetName());