MCPcopy Create free account
hub / github.com/comaps/comaps / TestRouteGeom

Method TestRouteGeom

libs/routing/routing_tests/index_graph_tools.cpp:77–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77void 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 ------------------------------------------------------------------------------
98void ZeroGeometryLoader::Load(uint32_t /* featureId */, routing::RoadGeometry & road)

Callers

nothing calls this directly

Calls 6

TESTFunction · 0.85
FindPathBidirectionalMethod · 0.80
AlmostEqualAbsFunction · 0.50
FromLatLonFunction · 0.50
sizeMethod · 0.45
GetPointMethod · 0.45

Tested by

no test coverage detected