From 8fa01d2e10f0778fe0ecaa1c6cd00754560b58a1 Mon Sep 17 00:00:00 2001 From: Viktor Govako Date: Mon, 15 Aug 2022 18:49:59 +0300 Subject: [PATCH] [routing][tests] Updated some Cross-MWM tests. Signed-off-by: Viktor Govako --- .../absent_regions_finder_tests.cpp | 45 +++++++++---------- .../bicycle_turn_test.cpp | 3 +- 2 files changed, 21 insertions(+), 27 deletions(-) diff --git a/routing/routing_integration_tests/absent_regions_finder_tests.cpp b/routing/routing_integration_tests/absent_regions_finder_tests.cpp index cf7e5a5055..8f432b0740 100644 --- a/routing/routing_integration_tests/absent_regions_finder_tests.cpp +++ b/routing/routing_integration_tests/absent_regions_finder_tests.cpp @@ -151,45 +151,40 @@ UNIT_CLASS_TEST(TestAbsentRegionsFinder, Colorado_Saskatchewan) TestRegions(checkpoints, planRegions); } +/// @todo OSRM/GraphHopper route differs from Organic (check the links below). The difference is not significant, +/// OM prefers major road E40 vs GraphHopper with E314. +/// @{ // From "Belgium_Flemish Brabant" to "Germany_North Rhine-Westphalia_Regierungsbezirk Koln_Aachen". -// https://www.openstreetmap.org/directions?engine=fossgis_osrm_car&route=50.878%2C4.447%3B50.775%2C6.444#map=9/50.8204/5.5810 -/// @todo OSRM route differs from Organic (check the link below). The difference is not significant, -/// just Organic wants to cross 3 countries instead of 2 (+Netherlands). +// https://www.openstreetmap.org/directions?engine=fossgis_osrm_car&route=50.87763%2C4.44676%3B50.76935%2C6.42488 UNIT_CLASS_TEST(TestAbsentRegionsFinder, Belgium_Germany) { Checkpoints const checkpoints{mercator::FromLatLon(50.87763, 4.44676), mercator::FromLatLon(50.76935, 6.42488)}; - std::set const planRegions{"Belgium_Flemish Brabant", "Belgium_Limburg", - "Germany_North Rhine-Westphalia_Regierungsbezirk Koln_Aachen", - "Netherlands_Limburg"}; - - TestRegions(checkpoints, planRegions); -} - -// From "Germany_North Rhine-Westphalia_Regierungsbezirk Koln_Aachen" to "Belgium_Flemish Brabant". -UNIT_CLASS_TEST(TestAbsentRegionsFinder, Germany_Belgium) -{ - Checkpoints const checkpoints{mercator::FromLatLon(50.76935, 6.42488), - mercator::FromLatLon(50.78285, 4.46508)}; - - // OSRM makes route via Netherlands (177km). - std::set const plan1 = { + std::set const planRegions = { "Belgium_Flemish Brabant", "Belgium_Liege", "Belgium_Limburg", "Germany_North Rhine-Westphalia_Regierungsbezirk Koln_Aachen", "Netherlands_Limburg" }; - /// @todo OM makes this route (183km). They are really equal, but need to investigate deeper. - /// But the trick here is that we also need Belgium_Walloon Brabant for a small piece of route. - std::set const plan2 = { - "Belgium_Flemish Brabant", "Belgium_Liege", "Germany_North Rhine-Westphalia_Regierungsbezirk Koln_Aachen" + TestRegions(checkpoints, planRegions); +} + +// From "Germany_North Rhine-Westphalia_Regierungsbezirk Koln_Aachen" to "Belgium_Flemish Brabant". +// https://www.openstreetmap.org/directions?engine=fossgis_osrm_car&route=50.76935%2C6.42488%3B50.78285%2C4.46508 +UNIT_CLASS_TEST(TestAbsentRegionsFinder, Germany_Belgium) +{ + Checkpoints const checkpoints{mercator::FromLatLon(50.76935, 6.42488), + mercator::FromLatLon(50.78285, 4.46508)}; + + std::set const planRegions = { + "Belgium_Flemish Brabant", "Belgium_Liege", "Belgium_Limburg", + "Germany_North Rhine-Westphalia_Regierungsbezirk Koln_Aachen" }; - /// @todo Make OR option here. - //TestRegions(checkpoints, plan1); - TestRegions(checkpoints, plan2); + TestRegions(checkpoints, planRegions); } +/// @} // From "Kazakhstan_South" to "Mongolia". UNIT_CLASS_TEST(TestAbsentRegionsFinder, Kazakhstan_Mongolia) diff --git a/routing/routing_integration_tests/bicycle_turn_test.cpp b/routing/routing_integration_tests/bicycle_turn_test.cpp index 9081cfd117..4966aad734 100644 --- a/routing/routing_integration_tests/bicycle_turn_test.cpp +++ b/routing/routing_integration_tests/bicycle_turn_test.cpp @@ -193,8 +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); + integration::TestRouteLength(route, 289.784); } UNIT_TEST(TurnsNearMoscowRiverShortFakeSegmentTest)