diff options
author | Lev Dragunov <l.dragunov@corp.mail.ru> | 2016-02-11 15:55:16 +0300 |
---|---|---|
committer | Sergey Yershov <yershov@corp.mail.ru> | 2016-03-23 16:45:22 +0300 |
commit | 29013fc0ac9e26a771cbda935cc04f80d319fd53 (patch) | |
tree | 5e16d4510c6d8ae015cc1a5b1a4ae6419bb4dbe3 /routing/routing_tests/astar_router_test.cpp | |
parent | c8a5ed6a93ef8c2c355f6d731d22162a4937a661 (diff) |
Review fixes.
Diffstat (limited to 'routing/routing_tests/astar_router_test.cpp')
-rw-r--r-- | routing/routing_tests/astar_router_test.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/routing/routing_tests/astar_router_test.cpp b/routing/routing_tests/astar_router_test.cpp index 2d1dedcc32..12dc9f6753 100644 --- a/routing/routing_tests/astar_router_test.cpp +++ b/routing/routing_tests/astar_router_test.cpp @@ -29,12 +29,12 @@ void TestAStarRouterMock(Junction const & startPos, Junction const & finalPos, InitRoadGraphMockSourceWithTest2(graph); RouterDelegate delegate; - vector<Junction> path; + RoutingResult<Junction> result; TRoutingAlgorithm algorithm; TEST_EQUAL(TRoutingAlgorithm::Result::OK, - algorithm.CalculateRoute(graph, startPos, finalPos, delegate, path), ()); + algorithm.CalculateRoute(graph, startPos, finalPos, delegate, result), ()); - TEST_EQUAL(expected, path, ()); + TEST_EQUAL(expected, result.path, ()); } void AddRoad(RoadGraphMockSource & graph, double speedKMPH, initializer_list<m2::PointD> const & points) @@ -91,12 +91,12 @@ UNIT_TEST(AStarRouter_SimpleGraph_RouteIsFound) vector<Junction> const expected = {m2::PointD(0, 0), m2::PointD(0, 30), m2::PointD(0, 60), m2::PointD(40, 100)}; RouterDelegate delegate; - vector<Junction> path; + RoutingResult<Junction> result; TRoutingAlgorithm algorithm; TEST_EQUAL(TRoutingAlgorithm::Result::OK, - algorithm.CalculateRoute(graph, startPos, finalPos, delegate, path), ()); + algorithm.CalculateRoute(graph, startPos, finalPos, delegate, result), ()); - TEST_EQUAL(expected, path, ()); + TEST_EQUAL(expected, result.path, ()); } UNIT_TEST(AStarRouter_SimpleGraph_RoutesInConnectedComponents) @@ -146,11 +146,11 @@ UNIT_TEST(AStarRouter_SimpleGraph_RoutesInConnectedComponents) { RouterDelegate delegate; Junction const finalPos(roadInfo_2[j].m_points[0]); - vector<Junction> path; + RoutingResult<Junction> result; TEST_EQUAL(TRoutingAlgorithm::Result::NoPath, - algorithm.CalculateRoute(graph, startPos, finalPos, delegate, path), ()); + algorithm.CalculateRoute(graph, startPos, finalPos, delegate, result), ()); TEST_EQUAL(TRoutingAlgorithm::Result::NoPath, - algorithm.CalculateRoute(graph, finalPos, startPos, delegate, path), ()); + algorithm.CalculateRoute(graph, finalPos, startPos, delegate, result), ()); } } @@ -162,11 +162,11 @@ UNIT_TEST(AStarRouter_SimpleGraph_RoutesInConnectedComponents) { RouterDelegate delegate; Junction const finalPos(roadInfo_1[j].m_points[0]); - vector<Junction> path; + RoutingResult<Junction> result; TEST_EQUAL(TRoutingAlgorithm::Result::OK, - algorithm.CalculateRoute(graph, startPos, finalPos, delegate, path), ()); + algorithm.CalculateRoute(graph, startPos, finalPos, delegate, result), ()); TEST_EQUAL(TRoutingAlgorithm::Result::OK, - algorithm.CalculateRoute(graph, finalPos, startPos, delegate, path), ()); + algorithm.CalculateRoute(graph, finalPos, startPos, delegate, result), ()); } } @@ -178,11 +178,11 @@ UNIT_TEST(AStarRouter_SimpleGraph_RoutesInConnectedComponents) { RouterDelegate delegate; Junction const finalPos(roadInfo_2[j].m_points[0]); - vector<Junction> path; + RoutingResult<Junction> result; TEST_EQUAL(TRoutingAlgorithm::Result::OK, - algorithm.CalculateRoute(graph, startPos, finalPos, delegate, path), ()); + algorithm.CalculateRoute(graph, startPos, finalPos, delegate, result), ()); TEST_EQUAL(TRoutingAlgorithm::Result::OK, - algorithm.CalculateRoute(graph, finalPos, startPos, delegate, path), ()); + algorithm.CalculateRoute(graph, finalPos, startPos, delegate, result), ()); } } } @@ -206,12 +206,12 @@ UNIT_TEST(AStarRouter_SimpleGraph_PickTheFasterRoad1) // path3 = 1/5 + 8/4 + 1/5 = 2.4 RouterDelegate delegate; - vector<Junction> path; + RoutingResult<Junction> result; TRoutingAlgorithm algorithm; TEST_EQUAL(TRoutingAlgorithm::Result::OK, - algorithm.CalculateRoute(graph, m2::PointD(2, 2), m2::PointD(10, 2), delegate, path), + algorithm.CalculateRoute(graph, m2::PointD(2, 2), m2::PointD(10, 2), delegate, result), ()); - TEST_EQUAL(path, vector<Junction>({m2::PointD(2,2), m2::PointD(2,3), m2::PointD(4,3), m2::PointD(6,3), + TEST_EQUAL(result.path, vector<Junction>({m2::PointD(2,2), m2::PointD(2,3), m2::PointD(4,3), m2::PointD(6,3), m2::PointD(8,3), m2::PointD(10,3), m2::PointD(10,2)}), ()); } @@ -233,12 +233,12 @@ UNIT_TEST(AStarRouter_SimpleGraph_PickTheFasterRoad2) // path3 = 1/5 + 8/4.4 + 1/5 = 2.2 RouterDelegate delegate; - vector<Junction> path; + RoutingResult<Junction> result; TRoutingAlgorithm algorithm; TEST_EQUAL(TRoutingAlgorithm::Result::OK, - algorithm.CalculateRoute(graph, m2::PointD(2, 2), m2::PointD(10, 2), delegate, path), + algorithm.CalculateRoute(graph, m2::PointD(2, 2), m2::PointD(10, 2), delegate, result), ()); - TEST_EQUAL(path, vector<Junction>({m2::PointD(2,2), m2::PointD(6,2), m2::PointD(10,2)}), ()); + TEST_EQUAL(result.path, vector<Junction>({m2::PointD(2,2), m2::PointD(6,2), m2::PointD(10,2)}), ()); } UNIT_TEST(AStarRouter_SimpleGraph_PickTheFasterRoad3) @@ -259,10 +259,10 @@ UNIT_TEST(AStarRouter_SimpleGraph_PickTheFasterRoad3) // path3 = 1/5 + 8/4.9 + 1/5 = 2.03 RouterDelegate delegate; - vector<Junction> path; + RoutingResult<Junction> result; TRoutingAlgorithm algorithm; TEST_EQUAL(TRoutingAlgorithm::Result::OK, - algorithm.CalculateRoute(graph, m2::PointD(2, 2), m2::PointD(10, 2), delegate, path), + algorithm.CalculateRoute(graph, m2::PointD(2, 2), m2::PointD(10, 2), delegate, result), ()); - TEST_EQUAL(path, vector<Junction>({m2::PointD(2,2), m2::PointD(2,1), m2::PointD(10,1), m2::PointD(10,2)}), ()); + TEST_EQUAL(result.path, vector<Junction>({m2::PointD(2,2), m2::PointD(2,1), m2::PointD(10,1), m2::PointD(10,2)}), ()); } |