diff options
author | Yuri Gorshenin <y@mmaps.me> | 2015-04-09 13:23:43 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:46:41 +0300 |
commit | 1be25a6fa7a31cc053049f0c071252e4deeefc01 (patch) | |
tree | 214dd2b6f7df896c3a2cf58a519db7a24f50c8eb /routing/routing_tests/astar_router_test.cpp | |
parent | ee132481e51bb889e3bc5803838aead555c1dc15 (diff) |
Review fixes.
Diffstat (limited to 'routing/routing_tests/astar_router_test.cpp')
-rw-r--r-- | routing/routing_tests/astar_router_test.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/routing/routing_tests/astar_router_test.cpp b/routing/routing_tests/astar_router_test.cpp index e176b6df78..3d3f48d561 100644 --- a/routing/routing_tests/astar_router_test.cpp +++ b/routing/routing_tests/astar_router_test.cpp @@ -23,11 +23,12 @@ void TestAStarRouterMock(RoadPos (&finalPos)[finalPosSize], RoadPos (&startPos)[startPosSize], RoadPos (&expected)[expectedSize]) { - RoadGraphMockSource * graph = new RoadGraphMockSource(); - InitRoadGraphMockSourceWithTest2(*graph); - AStarRouter router; - router.SetRoadGraph(graph); + { + unique_ptr<RoadGraphMockSource> graph(new RoadGraphMockSource()); + InitRoadGraphMockSourceWithTest2(*graph); + router.SetRoadGraph(move(graph)); + } vector<RoadPos> result; IRouter::ResultCode resultCode = router.CalculateRouteM2M( vector<RoadPos>(&startPos[0], &startPos[0] + ARRAY_SIZE(startPos)), @@ -44,7 +45,7 @@ void TestAStarRouterMWM(RoadPos(&finalPos)[finalPosSize], RoadPos(&startPos)[sta FeatureRoadGraphTester tester("route_test2.mwm"); AStarRouter router; - router.SetRoadGraph(tester.GetGraph()); + router.SetRoadGraph(tester.StealGraph()); vector<RoadPos> finalV(&finalPos[0], &finalPos[0] + ARRAY_SIZE(finalPos)); tester.Name2FeatureID(finalV); @@ -58,7 +59,7 @@ void TestAStarRouterMWM(RoadPos(&finalPos)[finalPosSize], RoadPos(&startPos)[sta LOG(LDEBUG, (result)); Route route(router.GetName()); - tester.GetGraph()->ReconstructPath(result, route); + router.GetGraph()->ReconstructPath(result, route); LOG(LDEBUG, (route)); TEST_EQUAL(route.GetPoly().GetSize(), pointsCount, ()); |