diff --git a/routing/routing_tests/road_graph_builder_test.cpp b/routing/routing_tests/road_graph_builder_test.cpp index d55186ad58..21c07e8ed7 100644 --- a/routing/routing_tests/road_graph_builder_test.cpp +++ b/routing/routing_tests/road_graph_builder_test.cpp @@ -21,7 +21,7 @@ public: bool operator() (PossibleTurn const & r) const { return (r.m_pos == m_pos && r.m_metersCovered == m_distance); } }; -bool test_result(IRoadGraph::TurnsVectorT const & vec, RoadPos const & pos, double d) +bool TestResult(IRoadGraph::TurnsVectorT const & vec, RoadPos const & pos, double d) { return find_if(vec.begin(), vec.end(), EqualPos(pos, d)) != vec.end(); } @@ -45,13 +45,13 @@ UNIT_TEST(RG_Builder_Test1) IRoadGraph::TurnsVectorT vec; src.GetPossibleTurns(RoadPos(0, false, 1), vec); TEST_EQUAL(vec.size(), 7, ()); - TEST(test_result(vec, RoadPos(0, false, 2), 5), ()); - TEST(test_result(vec, RoadPos(0, false, 3), 10), ()); - TEST(test_result(vec, RoadPos(1, true, 1), 5), ()); - TEST(test_result(vec, RoadPos(1, false, 2), 5), ()); - TEST(test_result(vec, RoadPos(2, true, 0), 10), ()); - TEST(test_result(vec, RoadPos(3, false, 0), 15), ()); - TEST(test_result(vec, RoadPos(3, true, 2), 15), ()); + TEST(TestResult(vec, RoadPos(0, false, 2), 5), ()); + TEST(TestResult(vec, RoadPos(0, false, 3), 10), ()); + TEST(TestResult(vec, RoadPos(1, true, 1), 5), ()); + TEST(TestResult(vec, RoadPos(1, false, 2), 5), ()); + TEST(TestResult(vec, RoadPos(2, true, 0), 10), ()); + TEST(TestResult(vec, RoadPos(3, false, 0), 15), ()); + TEST(TestResult(vec, RoadPos(3, true, 2), 15), ()); } { @@ -64,11 +64,11 @@ UNIT_TEST(RG_Builder_Test1) IRoadGraph::TurnsVectorT vec; src.GetPossibleTurns(RoadPos(1, false, 0), vec); TEST_EQUAL(vec.size(), 5, ()); - TEST(test_result(vec, RoadPos(1, false, 1), 5), ()); - TEST(test_result(vec, RoadPos(1, false, 2), 10), ()); - TEST(test_result(vec, RoadPos(1, false, 3), 15), ()); - TEST(test_result(vec, RoadPos(0, true, 1), 10), ()); - TEST(test_result(vec, RoadPos(0, false, 2), 10), ()); + TEST(TestResult(vec, RoadPos(1, false, 1), 5), ()); + TEST(TestResult(vec, RoadPos(1, false, 2), 10), ()); + TEST(TestResult(vec, RoadPos(1, false, 3), 15), ()); + TEST(TestResult(vec, RoadPos(0, true, 1), 10), ()); + TEST(TestResult(vec, RoadPos(0, false, 2), 10), ()); } } @@ -81,14 +81,14 @@ UNIT_TEST(RG_Builder_Test2) IRoadGraph::TurnsVectorT vec; graph.GetPossibleTurns(RoadPos(0, false, 0), vec); TEST_EQUAL(vec.size(), 8, ()); - TEST(test_result(vec, RoadPos(0, false, 1), 10), ()); - TEST(test_result(vec, RoadPos(0, false, 2), 25), ()); - TEST(test_result(vec, RoadPos(0, false, 3), 35), ()); - TEST(test_result(vec, RoadPos(0, false, 4), 70), ()); - TEST(test_result(vec, RoadPos(2, true, 1), 10), ()); - TEST(test_result(vec, RoadPos(5, false, 0), 35), ()); - TEST(test_result(vec, RoadPos(6, false, 0), 70), ()); - TEST(test_result(vec, RoadPos(4, false, 0), 25), ()); + TEST(TestResult(vec, RoadPos(0, false, 1), 10), ()); + TEST(TestResult(vec, RoadPos(0, false, 2), 25), ()); + TEST(TestResult(vec, RoadPos(0, false, 3), 35), ()); + TEST(TestResult(vec, RoadPos(0, false, 4), 70), ()); + TEST(TestResult(vec, RoadPos(2, true, 1), 10), ()); + TEST(TestResult(vec, RoadPos(5, false, 0), 35), ()); + TEST(TestResult(vec, RoadPos(6, false, 0), 70), ()); + TEST(TestResult(vec, RoadPos(4, false, 0), 25), ()); } { @@ -96,29 +96,29 @@ UNIT_TEST(RG_Builder_Test2) graph.GetPossibleTurns(RoadPos(8, true, 0), vec); double const d = m2::PointD(18, 55).Length(m2::PointD(5, 40)); TEST_EQUAL(vec.size(), 2, ()); - TEST(test_result(vec, RoadPos(1, true, 1), d), ()); - TEST(test_result(vec, RoadPos(8, true, 5), d), ()); + TEST(TestResult(vec, RoadPos(1, true, 1), d), ()); + TEST(TestResult(vec, RoadPos(8, true, 5), d), ()); } { IRoadGraph::TurnsVectorT vec; graph.GetPossibleTurns(RoadPos(2, true, 1), vec); TEST_EQUAL(vec.size(), 4, ()); - TEST(test_result(vec, RoadPos(3, true, 0), 10), ()); - TEST(test_result(vec, RoadPos(3, false, 1), 10), ()); - TEST(test_result(vec, RoadPos(2, true, 0), 10), ()); - TEST(test_result(vec, RoadPos(8, true, 4), 10 + m2::PointD(10, 10).Length(m2::PointD(12, 25))), ()); + TEST(TestResult(vec, RoadPos(3, true, 0), 10), ()); + TEST(TestResult(vec, RoadPos(3, false, 1), 10), ()); + TEST(TestResult(vec, RoadPos(2, true, 0), 10), ()); + TEST(TestResult(vec, RoadPos(8, true, 4), 10 + m2::PointD(10, 10).Length(m2::PointD(12, 25))), ()); } { IRoadGraph::TurnsVectorT vec; graph.GetPossibleTurns(RoadPos(3, false, 0), vec); TEST_EQUAL(vec.size(), 5, ()); - TEST(test_result(vec, RoadPos(3, false, 1), 5), ()); - TEST(test_result(vec, RoadPos(3, false, 2), 65), ()); - TEST(test_result(vec, RoadPos(2, true, 0), 5), ()); - TEST(test_result(vec, RoadPos(6, true, 0), 65), ()); - TEST(test_result(vec, RoadPos(6, false, 1), 65), ()); + TEST(TestResult(vec, RoadPos(3, false, 1), 5), ()); + TEST(TestResult(vec, RoadPos(3, false, 2), 65), ()); + TEST(TestResult(vec, RoadPos(2, true, 0), 5), ()); + TEST(TestResult(vec, RoadPos(6, true, 0), 65), ()); + TEST(TestResult(vec, RoadPos(6, false, 1), 65), ()); } { @@ -131,7 +131,7 @@ UNIT_TEST(RG_Builder_Test2) IRoadGraph::TurnsVectorT vec; graph.GetPossibleTurns(RoadPos(7, true, 0), vec); TEST_EQUAL(vec.size(), 1, ()); - TEST(test_result(vec, RoadPos(8, true, 1), 41), ()); + TEST(TestResult(vec, RoadPos(8, true, 1), 41), ()); } { @@ -139,16 +139,16 @@ UNIT_TEST(RG_Builder_Test2) graph.GetPossibleTurns(RoadPos(8, true, 3), vec); double d = m2::PointD(27, 25).Length(m2::PointD(37, 30)); TEST_EQUAL(vec.size(), 8, ()); - TEST(test_result(vec, RoadPos(8, true, 2), d), ()); - TEST(test_result(vec, RoadPos(5, true, 0), d), ()); - TEST(test_result(vec, RoadPos(5, false, 1), d), ()); + TEST(TestResult(vec, RoadPos(8, true, 2), d), ()); + TEST(TestResult(vec, RoadPos(5, true, 0), d), ()); + TEST(TestResult(vec, RoadPos(5, false, 1), d), ()); d += m2::PointD(37, 30).Length(m2::PointD(39, 55)); - TEST(test_result(vec, RoadPos(7, false, 0), d), ());; - TEST(test_result(vec, RoadPos(8, true, 1), d), ()); + TEST(TestResult(vec, RoadPos(7, false, 0), d), ()); + TEST(TestResult(vec, RoadPos(8, true, 1), d), ()); d += m2::PointD(18, 55).Length(m2::PointD(39, 55)); - TEST(test_result(vec, RoadPos(8, true, 0), d), ()); + TEST(TestResult(vec, RoadPos(8, true, 0), d), ()); d += m2::PointD(5, 40).Length(m2::PointD(18, 55)); - TEST(test_result(vec, RoadPos(1, true, 1), d), ()); - TEST(test_result(vec, RoadPos(8, true, 5), d), ()); + TEST(TestResult(vec, RoadPos(1, true, 1), d), ()); + TEST(TestResult(vec, RoadPos(8, true, 5), d), ()); } }