diff --git a/routing/routing_integration_tests/bicycle_route_test.cpp b/routing/routing_integration_tests/bicycle_route_test.cpp index d70ed3487d..73fda00fe3 100644 --- a/routing/routing_integration_tests/bicycle_route_test.cpp +++ b/routing/routing_integration_tests/bicycle_route_test.cpp @@ -8,6 +8,8 @@ #include "base/math.hpp" +namespace bicycle_route_test +{ using namespace integration; using namespace routing; using namespace routing::turns; @@ -146,10 +148,12 @@ UNIT_TEST(CrossMwmKaliningradRegionToLiepaja) // Test on riding up from Adeje (sea level) to Vilaflor (altitude 1400 meters). UNIT_TEST(SpainTenerifeAdejeVilaflor) { + // Route length: 30440 meters. ETA: 10022.6 seconds. + // Can't say ETA is good or not, but avg speed is 3m/s, which looks ok. integration::CalculateRouteAndTestRouteTime( integration::GetVehicleComponents(VehicleType::Bicycle), mercator::FromLatLon(28.11984, -16.72592), {0.0, 0.0}, - mercator::FromLatLon(28.15865, -16.63704), 10787.6 /* expectedTimeSeconds */); + mercator::FromLatLon(28.15865, -16.63704), 10022.6 /* expectedTimeSeconds */); } // Test on riding down from Vilaflor (altitude 1400 meters) to Adeje (sea level). @@ -182,8 +186,10 @@ UNIT_TEST(Munich_OnewayBicycle2) // https://github.com/organicmaps/organicmaps/issues/1603 UNIT_TEST(London_GreenwichTunnel) { + // Avoiding barrier=gate https://www.openstreetmap.org/node/3881243716 integration::CalculateRouteAndTestRouteLength( integration::GetVehicleComponents(VehicleType::Bicycle), mercator::FromLatLon(51.4817397, -0.0100070258), {0.0, 0.0}, - mercator::FromLatLon(51.4883739, -0.00809729298), 1222.44 /* expectedRouteMeters */); + mercator::FromLatLon(51.4883739, -0.00809729298), 1332.8 /* expectedRouteMeters */); } +} // namespace bicycle_route_test diff --git a/routing/routing_integration_tests/bicycle_turn_test.cpp b/routing/routing_integration_tests/bicycle_turn_test.cpp index eb9fa040af..9081cfd117 100644 --- a/routing/routing_integration_tests/bicycle_turn_test.cpp +++ b/routing/routing_integration_tests/bicycle_turn_test.cpp @@ -6,6 +6,8 @@ #include "routing/route.hpp" +namespace bicycle_turn_test +{ using namespace routing; using namespace routing::turns; @@ -191,6 +193,7 @@ UNIT_TEST(TurnsNearAltufievskoeShosseLongFakeSegmentTest) integration::GetNthTurn(route, 1).TestValid().TestDirection(CarDirection::TurnLeft); integration::GetNthTurn(route, 2).TestValid().TestDirection(CarDirection::TurnRight); + /// @todo Check how end point snapping on "nearest" edge works. Visually, closest road is on North (now on South). integration::TestRouteLength(route, 279.0); } @@ -205,11 +208,13 @@ UNIT_TEST(TurnsNearMoscowRiverShortFakeSegmentTest) RouterResultCode const result = routeResult.second; TEST_EQUAL(result, RouterResultCode::NoError, ()); - integration::TestTurnCount(route, 1 /* expectedTurnCount */); + // Closest snapping road is a footway on East, and there are 2 turns, obviously. + integration::TestTurnCount(route, 2 /* expectedTurnCount */); integration::GetNthTurn(route, 0).TestValid().TestDirection(CarDirection::TurnRight); + integration::GetNthTurn(route, 1).TestValid().TestDirection(CarDirection::TurnRight); - integration::TestRouteLength(route, 382.2); + integration::TestRouteLength(route, 401.2); } UNIT_TEST(TurnsNearMKAD85kmShortFakeSegmentTest) @@ -225,7 +230,7 @@ UNIT_TEST(TurnsNearMKAD85kmShortFakeSegmentTest) integration::TestTurnCount(route, 9 /* expectedTurnCount */); integration::GetNthTurn(route, 0).TestValid().TestDirection(CarDirection::TurnRight); - integration::GetNthTurn(route, 1).TestValid().TestDirection(CarDirection::GoStraight); + integration::GetNthTurn(route, 1).TestValid().TestDirection(CarDirection::TurnLeft); integration::GetNthTurn(route, 2).TestValid().TestDirection(CarDirection::TurnRight); integration::GetNthTurn(route, 3).TestValid().TestDirection(CarDirection::EnterRoundAbout); integration::GetNthTurn(route, 4).TestValid().TestDirection(CarDirection::LeaveRoundAbout); @@ -255,3 +260,4 @@ UNIT_TEST(TurnsNearKhladkombinatTest) integration::TestRouteLength(route, 484.3); } +} // namespace bicycle_turn_test diff --git a/routing/routing_integration_tests/guides_tests.cpp b/routing/routing_integration_tests/guides_tests.cpp index 6765f4ed04..6e456a908c 100644 --- a/routing/routing_integration_tests/guides_tests.cpp +++ b/routing/routing_integration_tests/guides_tests.cpp @@ -86,11 +86,7 @@ UNIT_TEST(Guides_FinishPointOnTrack) Checkpoints const checkpoints{mercator::FromLatLon(48.1394659, 11.575924), mercator::FromLatLon(48.1407632, 11.5716992)}; - double const expectedDistM = 840.1; - double const expectedTimeS = 771.3; - size_t const expectedPointsCount = 37; - - TestGuideRoute(checkpoints, expectedDistM, expectedTimeS, expectedPointsCount); + TestGuideRoute(checkpoints, 840.1 /* expectedDistM */, 771.3 /* expectedTimeS */, 37 /* expectedPointsCount */); } // Start checkpoint is on the track, finish checkpoint is far away. We build the first part of the @@ -100,11 +96,7 @@ UNIT_TEST(Guides_StartPointOnTrack) Checkpoints const checkpoints{mercator::FromLatLon(48.14168, 11.57244), mercator::FromLatLon(48.13741, 11.56095)}; - double const expectedDistM = 1200.45; - double const expectedTimeS = 1142.43; - size_t const expectedPointsCount = 52; - - TestGuideRoute(checkpoints, expectedDistM, expectedTimeS, expectedPointsCount); + TestGuideRoute(checkpoints, 1200.45 /* expectedDistM */, 1116.43 /* expectedTimeS */, 52 /* expectedPointsCount */); } // Start and finish lie on the track; 3 intermediate points are far away from the track. @@ -115,10 +107,6 @@ UNIT_TEST(Guides_MultipleIntermediatePoints) mercator::FromLatLon(48.14192, 11.57548), mercator::FromLatLon(48.14106, 11.57279), mercator::FromLatLon(48.14044, 11.57061)}); - double const expectedDistM = 1258.05; - double const expectedTimeS = 1113.8; - size_t const expectedPointsCount = 77; - - TestGuideRoute(checkpoints, expectedDistM, expectedTimeS, expectedPointsCount); + TestGuideRoute(checkpoints, 1258.05 /* expectedDistM */, 1094.78 /* expectedTimeS */, 66 /* expectedPointsCount */); } } // namespace guides_tests diff --git a/routing/routing_integration_tests/transit_route_test.cpp b/routing/routing_integration_tests/transit_route_test.cpp index 987d84a280..87e0995070 100644 --- a/routing/routing_integration_tests/transit_route_test.cpp +++ b/routing/routing_integration_tests/transit_route_test.cpp @@ -4,10 +4,10 @@ #include "geometry/mercator.hpp" +namespace transit_route_test +{ using namespace routing; -namespace -{ UNIT_TEST(Transit_Moscow_CenterToKotelniki_CrossMwm) { TRouteResult routeResult = @@ -58,8 +58,8 @@ UNIT_TEST(Transit_Piter_FrunzenskyaToPlochadVosstaniya) mercator::FromLatLon(59.93096, 30.35872)); TEST_EQUAL(routeResult.second, RouterResultCode::NoError, ()); - /// @todo https://github.com/organicmaps/organicmaps/issues/1669 - integration::TestRouteLength(*routeResult.first, 4952.43); + /// @todo Check https://github.com/organicmaps/organicmaps/issues/1669 for details. + integration::TestRouteLength(*routeResult.first, 5593.96); CHECK(routeResult.first, ()); integration::CheckSubwayExistence(*routeResult.first); @@ -95,7 +95,8 @@ UNIT_TEST(Transit_Vatikan_CorneliaToOttaviano) TEST_EQUAL(routeResult.second, RouterResultCode::NoError, ()); - integration::TestRouteLength(*routeResult.first, 4255.16); + // I don't see any bad routing sections here. Make actual value. + integration::TestRouteLength(*routeResult.first, 4316.61); CHECK(routeResult.first, ()); integration::CheckSubwayExistence(*routeResult.first); @@ -126,7 +127,7 @@ UNIT_TEST(Transit_London_DeptfordBridgeToCyprus) TEST_EQUAL(routeResult.second, RouterResultCode::NoError, ()); // I don't see any bad routing sections here. Make actual value. - integration::TestRouteLength(*routeResult.first, 12707.1); + integration::TestRouteLength(*routeResult.first, 12882.2); CHECK(routeResult.first, ()); integration::CheckSubwayExistence(*routeResult.first); @@ -156,9 +157,10 @@ UNIT_TEST(Transit_NewYork_GrassmereToPleasantPlains) TEST_EQUAL(routeResult.second, RouterResultCode::NoError, ()); - integration::TestRouteLength(*routeResult.first, 17224.5); + // I don't see any bad routing sections here. Make actual value. + integration::TestRouteLength(*routeResult.first, 17433.7); CHECK(routeResult.first, ()); integration::CheckSubwayExistence(*routeResult.first); } -} // namespace +} // namespace transit_route_test diff --git a/routing/routing_integration_tests/turn_test.cpp b/routing/routing_integration_tests/turn_test.cpp index 8c251bfa64..d39070b323 100644 --- a/routing/routing_integration_tests/turn_test.cpp +++ b/routing/routing_integration_tests/turn_test.cpp @@ -294,16 +294,17 @@ UNIT_TEST(Russia_HugeRoundabout_TurnTest) Route const & route = *routeResult.first; RouterResultCode const result = routeResult.second; + /// @todo Actualized exit num. But one exit is highway=unclassified, that (probably?) should not be counted? TEST_EQUAL(result, RouterResultCode::NoError, ()); integration::TestTurnCount(route, 2 /* expectedTurnCount */); integration::GetNthTurn(route, 0) .TestValid() .TestDirection(CarDirection::EnterRoundAbout) - .TestRoundAboutExitNum(5); + .TestRoundAboutExitNum(6); integration::GetNthTurn(route, 1) .TestValid() .TestDirection(CarDirection::LeaveRoundAbout) - .TestRoundAboutExitNum(5); + .TestRoundAboutExitNum(6); } UNIT_TEST(Belarus_Misk_ProspNezavisimostiMKAD_TurnTest)