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

Function UNIT_TEST

libs/routing/routing_tests/astar_progress_test.cpp:9–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7using namespace routing;
8
9UNIT_TEST(DirectedAStarProgressCheck)
10{
11 ms::LatLon start = ms::LatLon(0.0, 1.0);
12 ms::LatLon finish = ms::LatLon(0.0, 3.0);
13 ms::LatLon middle = ms::LatLon(0.0, 2.0);
14
15 AStarProgress progress;
16 progress.AppendSubProgress({start, finish, 1.0 /* contributionCoef */});
17 TEST_LESS(progress.UpdateProgress(start, finish), 0.1, ());
18 TEST_LESS(progress.UpdateProgress(middle, finish), 51.0, ());
19 TEST_GREATER(progress.UpdateProgress(middle, finish), 49.0, ());
20
21 static auto constexpr kEps = 0.001;
22 TEST_GREATER(progress.UpdateProgress(finish, finish), AStarProgress::kMaxPercent - kEps, ());
23
24 progress.PushAndDropLastSubProgress();
25}
26
27UNIT_TEST(DirectedAStarDegradationCheck)
28{

Callers

nothing calls this directly

Calls 4

AppendSubProgressMethod · 0.80
UpdateProgressMethod · 0.80
LatLonClass · 0.50

Tested by

no test coverage detected