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

Function TestRouter

libs/routing/routing_benchmarks/helpers.cpp:147–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147void TestRouter(routing::IRouter & router, m2::PointD const & startPos, m2::PointD const & finalPos,
148 routing::Route & route)
149{
150 routing::RouterDelegate delegate;
151 LOG(LINFO, ("Calculating routing ...", router.GetName()));
152 base::Timer timer;
153 auto const resultCode =
154 router.CalculateRoute(routing::Checkpoints(startPos, finalPos), m2::PointD::Zero() /* startDirection */,
155 false /* adjust */, delegate, route);
156 double const elapsedSec = timer.ElapsedSeconds();
157 TEST_EQUAL(routing::RouterResultCode::NoError, resultCode, ());
158 TEST(route.IsValid(), ());
159 m2::PolylineD const & poly = route.GetPoly();
160 TEST_GREATER(poly.GetSize(), 0, ());
161 TEST(AlmostEqualAbs(poly.Front(), startPos, kMwmPointAccuracy), ());
162 TEST(AlmostEqualAbs(poly.Back(), finalPos, kMwmPointAccuracy), ());
163 LOG(LINFO, ("Route polyline size:", route.GetPoly().GetSize()));
164 LOG(LINFO, ("Route distance, meters:", route.GetTotalDistanceMeters()));
165 LOG(LINFO, ("Elapsed, seconds:", elapsedSec));
166}

Callers 2

TestCarRouterMethod · 0.85
TestRoutersMethod · 0.85

Calls 12

ZeroFunction · 0.85
TESTFunction · 0.85
ElapsedSecondsMethod · 0.80
CheckpointsClass · 0.50
AlmostEqualAbsFunction · 0.50
GetNameMethod · 0.45
CalculateRouteMethod · 0.45
IsValidMethod · 0.45
GetSizeMethod · 0.45
FrontMethod · 0.45
BackMethod · 0.45

Tested by

no test coverage detected