| 7 | using namespace routing; |
| 8 | |
| 9 | UNIT_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 | |
| 27 | UNIT_TEST(DirectedAStarDegradationCheck) |
| 28 | { |
nothing calls this directly
no test coverage detected