| 75 | } |
| 76 | |
| 77 | void NoUTurnRestrictionTest::TestRouteGeom(Segment const & start, Segment const & finish, |
| 78 | AlgorithmForWorldGraph::Result expectedRouteResult, |
| 79 | vector<m2::PointD> const & expectedRouteGeom) |
| 80 | { |
| 81 | AlgorithmForWorldGraph algorithm; |
| 82 | AlgorithmForWorldGraph::ParamsForTests<> params(*m_graph, start, finish); |
| 83 | |
| 84 | RoutingResult<Segment, RouteWeight> routingResult; |
| 85 | auto const resultCode = algorithm.FindPathBidirectional(params, routingResult); |
| 86 | |
| 87 | TEST_EQUAL(resultCode, expectedRouteResult, ()); |
| 88 | for (size_t i = 0; i < routingResult.m_path.size(); ++i) |
| 89 | { |
| 90 | static auto constexpr kEps = 1e-3; |
| 91 | auto const point = m_graph->GetWorldGraph().GetPoint(routingResult.m_path[i], true /* forward */); |
| 92 | if (!AlmostEqualAbs(mercator::FromLatLon(point), expectedRouteGeom[i], kEps)) |
| 93 | TEST(false, ("Coords missmated at index:", i, "expected:", expectedRouteGeom[i], "received:", point)); |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | // ZeroGeometryLoader ------------------------------------------------------------------------------ |
| 98 | void ZeroGeometryLoader::Load(uint32_t /* featureId */, routing::RoadGeometry & road) |
nothing calls this directly
no test coverage detected