diff --git a/routing/routing_integration_tests/bicycle_route_test.cpp b/routing/routing_integration_tests/bicycle_route_test.cpp index 0bc4c57abc..8bb5f21944 100644 --- a/routing/routing_integration_tests/bicycle_route_test.cpp +++ b/routing/routing_integration_tests/bicycle_route_test.cpp @@ -51,7 +51,7 @@ UNIT_TEST(NetherlandsAmsterdamBicycleNo) CalculateRouteAndTestRouteLength( GetVehicleComponents(VehicleType::Bicycle), MercatorBounds::FromLatLon(52.32716, 5.05932), {0., 0.}, - MercatorBounds::FromLatLon(52.32587, 5.06121), 363.4); + MercatorBounds::FromLatLon(52.32587, 5.06121), 338.0); } UNIT_TEST(NetherlandsAmsterdamBicycleYes) diff --git a/routing/routing_integration_tests/bicycle_turn_test.cpp b/routing/routing_integration_tests/bicycle_turn_test.cpp index 78b72edc45..4668333d6a 100644 --- a/routing/routing_integration_tests/bicycle_turn_test.cpp +++ b/routing/routing_integration_tests/bicycle_turn_test.cpp @@ -54,7 +54,7 @@ UNIT_TEST(RussiaMoscowSalameiNerisPossibleTurnCorrectionBicycleWayTurnTest) { TRouteResult const routeResult = integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Bicycle), - MercatorBounds::FromLatLon(55.85836, 37.36773), {0.0, 0.0}, + MercatorBounds::FromLatLon(55.85854, 37.36795), {0.0, 0.0}, MercatorBounds::FromLatLon(55.85364, 37.37318)); Route const & route = *routeResult.first; @@ -72,7 +72,7 @@ UNIT_TEST(RussiaMoscowSalameiNerisNoUTurnBicycleWayTurnTest) { TRouteResult const routeResult = integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Bicycle), - MercatorBounds::FromLatLon(55.85839, 37.3677), {0.0, 0.0}, + MercatorBounds::FromLatLon(55.85854, 37.36795), {0.0, 0.0}, MercatorBounds::FromLatLon(55.85765, 37.36793)); Route const & route = *routeResult.first; @@ -108,8 +108,8 @@ UNIT_TEST(RussiaMoscowTatishchevaOnewayCarRoadTurnTest) { TRouteResult const routeResult = integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Bicycle), - MercatorBounds::FromLatLon(55.71566, 37.61569), {0.0, 0.0}, - MercatorBounds::FromLatLon(55.71532, 37.61571)); + MercatorBounds::FromLatLon(55.71566, 37.61568), {0.0, 0.0}, + MercatorBounds::FromLatLon(55.71519, 37.61566)); Route const & route = *routeResult.first; RouterResultCode const result = routeResult.second; @@ -122,7 +122,7 @@ UNIT_TEST(RussiaMoscowTatishchevaOnewayCarRoadTurnTest) integration::GetNthTurn(route, 2).TestValid().TestDirection(CarDirection::TurnRight); integration::GetNthTurn(route, 3).TestValid().TestDirection(CarDirection::TurnRight); - integration::TestRouteLength(route, 333.0); + integration::TestRouteLength(route, 320.0); } UNIT_TEST(RussiaMoscowSvobodiOnewayBicycleWayTurnTest) diff --git a/routing/routing_integration_tests/pedestrian_route_test.cpp b/routing/routing_integration_tests/pedestrian_route_test.cpp index 08e84b53f3..a196f9a26a 100644 --- a/routing/routing_integration_tests/pedestrian_route_test.cpp +++ b/routing/routing_integration_tests/pedestrian_route_test.cpp @@ -38,7 +38,7 @@ UNIT_TEST(Zgrad924aToFilaretovskyChurch) integration::CalculateRouteAndTestRouteLength( integration::GetVehicleComponents(VehicleType::Pedestrian), MercatorBounds::FromLatLon(55.9844, 37.1808), {0., 0.}, - MercatorBounds::FromLatLon(55.9915, 37.1808), 1220.); + MercatorBounds::FromLatLon(55.9915, 37.1808), 1109.0); } UNIT_TEST(Zgrad924aTo1145) @@ -46,7 +46,7 @@ UNIT_TEST(Zgrad924aTo1145) integration::CalculateRouteAndTestRouteLength( integration::GetVehicleComponents(VehicleType::Pedestrian), MercatorBounds::FromLatLon(55.9844, 37.1808), {0., 0.}, - MercatorBounds::FromLatLon(55.9924, 37.1853), 1400.); + MercatorBounds::FromLatLon(55.9924, 37.1853), 1193.0); } UNIT_TEST(MoscowMuzeonToLebedinoeOzeroGorkyPark) @@ -54,7 +54,7 @@ UNIT_TEST(MoscowMuzeonToLebedinoeOzeroGorkyPark) integration::CalculateRouteAndTestRouteLength( integration::GetVehicleComponents(VehicleType::Pedestrian), MercatorBounds::FromLatLon(55.7348, 37.606), {0., 0.}, - MercatorBounds::FromLatLon(55.724, 37.5956), 1617.); + MercatorBounds::FromLatLon(55.724, 37.5956), 1767.0); } /* @@ -91,7 +91,7 @@ UNIT_TEST(AustraliaMelburn_AvoidMotorway) integration::CalculateRouteAndTestRouteLength( integration::GetVehicleComponents(VehicleType::Pedestrian), MercatorBounds::FromLatLon(-37.7936, 144.985), {0., 0.}, - MercatorBounds::FromLatLon(-37.7896, 145.025), 5015.); + MercatorBounds::FromLatLon(-37.7896, 145.025), 4659.5); } UNIT_TEST(AustriaWein_AvoidTrunk) @@ -203,7 +203,7 @@ UNIT_TEST(RussiaTaganrogSyzranov10k3ToTruseE) integration::CalculateRouteAndTestRouteLength( integration::GetVehicleComponents(VehicleType::Pedestrian), MercatorBounds::FromLatLon(47.2183, 38.8634), {0., 0.}, - MercatorBounds::FromLatLon(47.2048, 38.9441), 7994.0); + MercatorBounds::FromLatLon(47.2048, 38.9441), 7144.6); } UNIT_TEST(RussiaTaganrogSyzranov10k3ToLazo5k2) @@ -291,7 +291,7 @@ UNIT_TEST(RussiaSaintPetersburgMoyka93ToAlexanderColumn) integration::CalculateRouteAndTestRouteLength( integration::GetVehicleComponents(VehicleType::Pedestrian), MercatorBounds::FromLatLon(59.9241, 30.323), {0., 0.}, - MercatorBounds::FromLatLon(59.939, 30.3159), 2454.); + MercatorBounds::FromLatLon(59.939, 30.3159), 2247.0); } UNIT_TEST(RussiaSaintPetersburgMoyka93ToMarsovoPole) diff --git a/routing/routing_integration_tests/road_graph_tests.cpp b/routing/routing_integration_tests/road_graph_tests.cpp index bc81951cb8..e25914b62a 100644 --- a/routing/routing_integration_tests/road_graph_tests.cpp +++ b/routing/routing_integration_tests/road_graph_tests.cpp @@ -2,6 +2,7 @@ #include "platform/local_country_file.hpp" +#include "geometry/mercator.hpp" #include "geometry/point2d.hpp" #include "indexer/classificator_loader.hpp" @@ -42,7 +43,9 @@ UNIT_TEST(FakeEdgesCombinatorialExplosion) make_shared(CountryParentNameGetterFn())); Junction const j(m2::PointD(MercatorBounds::FromLatLon(50.73208, -1.21279)), feature::kDefaultAltitudeMeters); std::vector> sourceVicinity; - graph.FindClosestEdges(j.GetPoint(), 20 /* count */, sourceVicinity); + graph.FindClosestEdges(MercatorBounds::RectByCenterXYAndSizeInMeters( + j.GetPoint(), FeaturesRoadGraph::kClosestEdgesRadiusM), + 20 /* count */, {} /* ignoredFeatures */, sourceVicinity); // In case of the combinatorial explosion mentioned above all the memory was consumed for // FeaturesRoadGraph::m_fakeIngoingEdges and FeaturesRoadGraph::m_fakeOutgoingEdges fields. graph.AddFakeEdges(j, sourceVicinity); diff --git a/routing/routing_integration_tests/route_test.cpp b/routing/routing_integration_tests/route_test.cpp index 8cdeece2a5..8fdf2f251f 100644 --- a/routing/routing_integration_tests/route_test.cpp +++ b/routing/routing_integration_tests/route_test.cpp @@ -26,7 +26,7 @@ namespace integration::CalculateRouteAndTestRouteLength( integration::GetVehicleComponents(VehicleType::Car), MercatorBounds::FromLatLon(55.66216, 37.63259), {0., 0.}, - MercatorBounds::FromLatLon(55.66237, 37.63560), 2320.); + MercatorBounds::FromLatLon(55.66237, 37.63560), 1502.0); } UNIT_TEST(MoscowToSVOAirport) @@ -38,7 +38,7 @@ namespace integration::CalculateRouteAndTestRouteLength( integration::GetVehicleComponents(VehicleType::Car), MercatorBounds::FromLatLon(55.97310, 37.41460), {0., 0.}, - MercatorBounds::FromLatLon(55.75100, 37.61790), 39449.); + MercatorBounds::FromLatLon(55.75100, 37.61790), 33717.0); } // Restrictions tests. Check restrictions generation, if there are any errors. @@ -46,8 +46,8 @@ namespace { integration::CalculateRouteAndTestRouteLength( integration::GetVehicleComponents(VehicleType::Car), - MercatorBounds::FromLatLon(55.77397, 37.68465), {0., 0.}, - MercatorBounds::FromLatLon(55.77198, 37.68782), 1032.); + MercatorBounds::FromLatLon(55.77398, 37.68469), {0., 0.}, + MercatorBounds::FromLatLon(55.77201, 37.68789), 1032.); } UNIT_TEST(RestrictionTestNearMetroShodnenskaya) @@ -273,7 +273,7 @@ namespace integration::CalculateRouteAndTestRouteLength( integration::GetVehicleComponents(VehicleType::Car), MercatorBounds::FromLatLon(48.85458, 2.36291), {0., 0.}, - MercatorBounds::FromLatLon(49.85015, 2.24296), 137009.0); + MercatorBounds::FromLatLon(49.85027, 2.24283), 137009.0); } UNIT_TEST(RussiaSmolenskRussiaMoscowTimeTest) diff --git a/routing/routing_integration_tests/transit_route_test.cpp b/routing/routing_integration_tests/transit_route_test.cpp index 4994a8ca44..f0040b37e9 100644 --- a/routing/routing_integration_tests/transit_route_test.cpp +++ b/routing/routing_integration_tests/transit_route_test.cpp @@ -78,8 +78,8 @@ UNIT_TEST(Vatikan_NotEnoughGraphDataAtThenEnd) { TRouteResult routeResult = integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Transit), - MercatorBounds::FromLatLon(41.90052, 12.42642), {0.0, 0.0}, - MercatorBounds::FromLatLon(41.90253, 12.45574)); + MercatorBounds::FromLatLon(41.89543, 12.41481), {0.0, 0.0}, + MercatorBounds::FromLatLon(41.89203, 12.46263)); // TODO (@gmoryes) here must be RouteNotFound. TEST_EQUAL(routeResult.second, RouterResultCode::TransitRouteNotFoundTooLongPedestrian, ()); diff --git a/routing/routing_integration_tests/turn_test.cpp b/routing/routing_integration_tests/turn_test.cpp index ba882d22b2..1de4cde622 100644 --- a/routing/routing_integration_tests/turn_test.cpp +++ b/routing/routing_integration_tests/turn_test.cpp @@ -54,18 +54,15 @@ UNIT_TEST(RussiaMoscowLenigradskiy39UturnTurnTest) RouterResultCode const result = routeResult.second; TEST_EQUAL(result, RouterResultCode::NoError, ()); - integration::TestTurnCount(route, 4 /* expectedTurnCount */); + integration::TestTurnCount(route, 3 /* expectedTurnCount */); integration::GetNthTurn(route, 0) .TestValid() - .TestDirection(CarDirection::TurnRight); + .TestDirection(CarDirection::UTurnLeft); integration::GetNthTurn(route, 1) - .TestValid() - .TestDirection(CarDirection::UTurnLeft); - integration::GetNthTurn(route, 2) .TestValid() .TestDirection(CarDirection::TurnRight); - integration::GetNthTurn(route, 3).TestValid().TestDirection(CarDirection::TurnLeft); + integration::GetNthTurn(route, 2).TestValid().TestDirection(CarDirection::TurnLeft); integration::TestRouteLength(route, 2050.); } @@ -150,7 +147,7 @@ UNIT_TEST(RussiaMoscowPlanetnayaOnlyStraightTest) { TRouteResult const routeResult = integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Car), - MercatorBounds::FromLatLon(55.80216, 37.54668), {0., 0.}, + MercatorBounds::FromLatLon(55.80215, 37.54663), {0., 0.}, MercatorBounds::FromLatLon(55.80169, 37.54915)); Route const & route = *routeResult.first; @@ -242,7 +239,7 @@ UNIT_TEST(RussiaMoscowPankratevskiPerBolshaySuharedskazPloschadTurnTest) TRouteResult const routeResult = integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Car), MercatorBounds::FromLatLon(55.77177, 37.63556), {0., 0.}, - MercatorBounds::FromLatLon(55.77209, 37.63707)); + MercatorBounds::FromLatLon(55.77217, 37.63678)); Route const & route = *routeResult.first; RouterResultCode const result = routeResult.second; @@ -251,7 +248,7 @@ UNIT_TEST(RussiaMoscowPankratevskiPerBolshaySuharedskazPloschadTurnTest) vector t; route.GetTurnsForTesting(t); - // It's not possible to get destination with less nubber of turns due to oneway roads. + // It's not possible to get destination with less number of turns due to oneway roads. TEST_GREATER_OR_EQUAL(t.size(), 5, ()); } @@ -518,7 +515,7 @@ UNIT_TEST(RussiaMoscowLeningradskiyPrptDublToTTKTest) { TRouteResult const routeResult = integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Car), - MercatorBounds::FromLatLon(55.79059, 37.55345), {0., 0.}, + MercatorBounds::FromLatLon(55.79054, 37.55335), {0., 0.}, MercatorBounds::FromLatLon(55.78925, 37.57110)); Route const & route = *routeResult.first; @@ -858,8 +855,8 @@ UNIT_TEST(RussiaMoscowTTKToServiceTest) { TRouteResult const routeResult = integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Car), - MercatorBounds::FromLatLon(55.78874, 37.5704), {0., 0.}, - MercatorBounds::FromLatLon(55.78881, 37.57106)); + MercatorBounds::FromLatLon(55.78856, 37.57017), {0., 0.}, + MercatorBounds::FromLatLon(55.78869, 37.57133)); Route const & route = *routeResult.first; RouterResultCode const result = routeResult.second;