| 84 | } |
| 85 | |
| 86 | void RoutingTest::TestRouters(m2::PointD const & startPos, m2::PointD const & finalPos) |
| 87 | { |
| 88 | // Find route by A*-bidirectional algorithm. |
| 89 | routing::Route routeFoundByAstarBidirectional("", 0 /* route id */); |
| 90 | { |
| 91 | auto router = CreateRouter("test-astar-bidirectional"); |
| 92 | TestRouter(*router, startPos, finalPos, routeFoundByAstarBidirectional); |
| 93 | } |
| 94 | |
| 95 | // Find route by A* algorithm. |
| 96 | routing::Route routeFoundByAstar("", 0 /* route id */); |
| 97 | { |
| 98 | auto router = CreateRouter("test-astar"); |
| 99 | TestRouter(*router, startPos, finalPos, routeFoundByAstar); |
| 100 | } |
| 101 | |
| 102 | double constexpr kEpsilon = 1e-6; |
| 103 | TEST(AlmostEqualAbs(routeFoundByAstar.GetTotalDistanceMeters(), |
| 104 | routeFoundByAstarBidirectional.GetTotalDistanceMeters(), kEpsilon), |
| 105 | ()); |
| 106 | } |
| 107 | |
| 108 | void RoutingTest::TestTwoPointsOnFeature(m2::PointD const & startPos, m2::PointD const & finalPos) |
| 109 | { |
nothing calls this directly
no test coverage detected