diff options
author | Constantin Shalnev <c.shalnev@corp.mail.ru> | 2015-07-20 13:48:40 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:57:03 +0300 |
commit | 0dc3e2ab69b78eeba5a40f6109daa2b9b170a290 (patch) | |
tree | a038535b01e4067892a72dc3b24c5619d422282c /routing/routing_tests/astar_router_test.cpp | |
parent | 9cd1b67fa40d07ca7ba38ce615209de66c016989 (diff) |
Pedestrian directions engine which shows up and down stairs
Diffstat (limited to 'routing/routing_tests/astar_router_test.cpp')
-rw-r--r-- | routing/routing_tests/astar_router_test.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/routing/routing_tests/astar_router_test.cpp b/routing/routing_tests/astar_router_test.cpp index 8fa33948fd..3ea96f1d43 100644 --- a/routing/routing_tests/astar_router_test.cpp +++ b/routing/routing_tests/astar_router_test.cpp @@ -20,7 +20,7 @@ namespace using TRoutingAlgorithm = AStarBidirectionalRoutingAlgorithm; void TestAStarRouterMock(Junction const & startPos, Junction const & finalPos, - m2::PolylineD const & expected) + vector<Junction> const & expected) { classificator::Load(); @@ -31,9 +31,7 @@ void TestAStarRouterMock(Junction const & startPos, Junction const & finalPos, TRoutingAlgorithm algorithm; TEST_EQUAL(TRoutingAlgorithm::Result::OK, algorithm.CalculateRoute(graph, startPos, finalPos, path), ()); - Route route(""); - graph.ReconstructPath(path, route); - TEST_EQUAL(expected, route.GetPoly(), ()); + TEST_EQUAL(expected, path, ()); } void AddRoad(RoadGraphMockSource & graph, double speedKMPH, initializer_list<m2::PointD> const & points) @@ -54,8 +52,8 @@ UNIT_TEST(AStarRouter_Graph2_Simple1) Junction const startPos = m2::PointD(0, 0); Junction const finalPos = m2::PointD(80, 55); - m2::PolylineD const expected = {m2::PointD(0, 0), m2::PointD(5, 10), m2::PointD(5, 40), - m2::PointD(18, 55), m2::PointD(39, 55), m2::PointD(80, 55)}; + vector<Junction> const expected = {m2::PointD(0, 0), m2::PointD(5, 10), m2::PointD(5, 40), + m2::PointD(18, 55), m2::PointD(39, 55), m2::PointD(80, 55)}; TestAStarRouterMock(startPos, finalPos, expected); } @@ -65,9 +63,9 @@ UNIT_TEST(AStarRouter_Graph2_Simple2) Junction const startPos = m2::PointD(80, 55); Junction const finalPos = m2::PointD(80, 0); - m2::PolylineD const expected = {m2::PointD(80, 55), m2::PointD(39, 55), m2::PointD(37, 30), - m2::PointD(70, 30), m2::PointD(70, 10), m2::PointD(70, 0), - m2::PointD(80, 0)}; + vector<Junction> const expected = {m2::PointD(80, 55), m2::PointD(39, 55), m2::PointD(37, 30), + m2::PointD(70, 30), m2::PointD(70, 10), m2::PointD(70, 0), + m2::PointD(80, 0)}; TestAStarRouterMock(startPos, finalPos, expected); } @@ -87,15 +85,13 @@ UNIT_TEST(AStarRouter_SimpleGraph_RouteIsFound) Junction const startPos = m2::PointD(0, 0); Junction const finalPos = m2::PointD(40, 100); - m2::PolylineD const expected = {m2::PointD(0, 0), m2::PointD(0, 30), m2::PointD(0, 60), m2::PointD(40, 100)}; + vector<Junction> const expected = {m2::PointD(0, 0), m2::PointD(0, 30), m2::PointD(0, 60), m2::PointD(40, 100)}; vector<Junction> path; TRoutingAlgorithm algorithm; TEST_EQUAL(TRoutingAlgorithm::Result::OK, algorithm.CalculateRoute(graph, startPos, finalPos, path), ()); - Route route(""); - graph.ReconstructPath(path, route); - TEST_EQUAL(expected, route.GetPoly(), ()); + TEST_EQUAL(expected, path, ()); } UNIT_TEST(AStarRouter_SimpleGraph_RoutesInConnectedComponents) |