| 20 | using Algorithm = AStarAlgorithm<uint32_t, SimpleEdge, double>; |
| 21 | |
| 22 | void TestAStar(UndirectedGraph & graph, vector<unsigned> const & expectedRoute, double const & expectedDistance) |
| 23 | { |
| 24 | Algorithm algo; |
| 25 | |
| 26 | Algorithm::ParamsForTests<> params(graph, 0u /* startVertex */, 4u /* finishVertex */); |
| 27 | |
| 28 | RoutingResult<unsigned /* Vertex */, double /* Weight */> actualRoute; |
| 29 | TEST_EQUAL(Algorithm::Result::OK, algo.FindPath(params, actualRoute), ()); |
| 30 | TEST_EQUAL(expectedRoute, actualRoute.m_path, ()); |
| 31 | TEST_ALMOST_EQUAL_ULPS(expectedDistance, actualRoute.m_distance, ()); |
| 32 | |
| 33 | actualRoute.m_path.clear(); |
| 34 | TEST_EQUAL(Algorithm::Result::OK, algo.FindPathBidirectional(params, actualRoute), ()); |
| 35 | TEST_EQUAL(expectedRoute, actualRoute.m_path, ()); |
| 36 | TEST_ALMOST_EQUAL_ULPS(expectedDistance, actualRoute.m_distance, ()); |
| 37 | } |
| 38 | |
| 39 | UNIT_TEST(AStarAlgorithm_Sample) |
| 40 | { |
no test coverage detected