[routing][tests] Updated integration tests.

Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
This commit is contained in:
Viktor Govako
2025-07-05 15:21:12 -03:00
committed by Konstantin Pastbin
parent 76d7ef146c
commit 001246fd10
3 changed files with 12 additions and 13 deletions

View File

@@ -87,11 +87,10 @@ UNIT_TEST(Zgrad924aToKrukovo)
UNIT_TEST(MoscowMailRuStarbucksToPetrovskoRazumovskyAlley) UNIT_TEST(MoscowMailRuStarbucksToPetrovskoRazumovskyAlley)
{ {
// Avoids footway gravel (-> path) and uses footway compacted.
integration::CalculateRouteAndTestRouteLength( integration::CalculateRouteAndTestRouteLength(
integration::GetVehicleComponents(VehicleType::Pedestrian), integration::GetVehicleComponents(VehicleType::Pedestrian),
mercator::FromLatLon(55.7971, 37.5376), {0., 0.}, mercator::FromLatLon(55.7971, 37.5376), {0., 0.},
mercator::FromLatLon(55.7953, 37.5597), 1849.6); mercator::FromLatLon(55.7953, 37.5597), 1802.31);
} }
UNIT_TEST(AustraliaMelburn_AvoidMotorway) UNIT_TEST(AustraliaMelburn_AvoidMotorway)
@@ -373,10 +372,12 @@ UNIT_TEST(ItalyRome_WalkOverStreetWithSidewalkBoth)
UNIT_TEST(USARedlandsEsriHQToRedlandsCommunity) UNIT_TEST(USARedlandsEsriHQToRedlandsCommunity)
{ {
// OM makes like OSRM with footway.
// Valhalla uses shorter South San Mateo + West Olive.
integration::CalculateRouteAndTestRouteLength( integration::CalculateRouteAndTestRouteLength(
integration::GetVehicleComponents(VehicleType::Pedestrian), integration::GetVehicleComponents(VehicleType::Pedestrian),
mercator::FromLatLon(34.0556, -117.19567), {0., 0.}, mercator::FromLatLon(34.0556, -117.19567), {0., 0.},
mercator::FromLatLon(34.03682, -117.20649), 3142.15); mercator::FromLatLon(34.03682, -117.20649), 3212.65);
} }
UNIT_TEST(USANewYorkEmpireStateBuildingToUnitedNations) UNIT_TEST(USANewYorkEmpireStateBuildingToUnitedNations)
@@ -629,7 +630,7 @@ UNIT_TEST(France_Uphill_Downlhill)
TEST(routeResult.first, ()); TEST(routeResult.first, ());
Route const & route = *routeResult.first; Route const & route = *routeResult.first;
TestRouteLength(route, 20388.7); TestRouteLength(route, 19771);
timeDownhill = route.GetTotalTimeSec(); timeDownhill = route.GetTotalTimeSec();
TEST_GREATER(timeDownhill, 4 * 3600, ()); TEST_GREATER(timeDownhill, 4 * 3600, ());
} }
@@ -643,7 +644,7 @@ UNIT_TEST(France_Uphill_Downlhill)
TEST(routeResult.first, ()); TEST(routeResult.first, ());
Route const & route = *routeResult.first; Route const & route = *routeResult.first;
TestRouteLength(route, 20388.7); TestRouteLength(route, 19771);
timeUphill = route.GetTotalTimeSec(); timeUphill = route.GetTotalTimeSec();
TEST_GREATER(timeUphill, 4 * 3600, ()); TEST_GREATER(timeUphill, 4 * 3600, ());
} }

View File

@@ -246,10 +246,10 @@ UNIT_TEST(CanadaBridgeCrossToEdwardIsland)
UNIT_TEST(ParisCrossDestinationInForwardHeapCase) UNIT_TEST(ParisCrossDestinationInForwardHeapCase)
{ {
// Forward. // Forward.
// Updated after fixing primary/trunk factors. Route looks good, but it differs from OSRM/Valhalla/GraphHopper. // Updated after fixing primary/trunk factors. Route looks good, but it differs from Valhalla.
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Car), CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Car),
FromLatLon(49.85015, 2.24296), {0., 0.}, FromLatLon(49.85015, 2.24296), {0., 0.},
FromLatLon(48.85458, 2.36291), 128749); FromLatLon(48.85458, 2.36291), 132906);
// Backward. // Backward.
// OM makes the same as GraphHopper and Valhalla. OSRM makes a bit shorter route. // OM makes the same as GraphHopper and Valhalla. OSRM makes a bit shorter route.
@@ -269,11 +269,11 @@ UNIT_TEST(RussiaSmolenskRussiaMoscowTimeTest)
TEST(routeResult.first, ()); TEST(routeResult.first, ());
Route const & route = *routeResult.first; Route const & route = *routeResult.first;
TestRouteLength(route, 391659); TestRouteLength(route, 391699);
// https://www.openstreetmap.org/directions?engine=graphhopper_car&route=54.800%2C32.055%3B55.753%2C37.602 // https://www.openstreetmap.org/directions?engine=graphhopper_car&route=54.800%2C32.055%3B55.753%2C37.602
// Middle between GraphHopper and OSRM // Middle between GraphHopper and OSRM
TestRouteTime(route, 18607.2); TestRouteTime(route, 19079.5);
} }
UNIT_TEST(Russia_Moscow_Leningradskiy39GeroevPanfilovtsev22TimeTest) UNIT_TEST(Russia_Moscow_Leningradskiy39GeroevPanfilovtsev22TimeTest)
@@ -287,7 +287,7 @@ UNIT_TEST(Russia_Moscow_Leningradskiy39GeroevPanfilovtsev22TimeTest)
TEST(routeResult.first, ()); TEST(routeResult.first, ());
Route const & route = *routeResult.first; Route const & route = *routeResult.first;
TestRouteLength(route, 14276.3); TestRouteLength(route, 14276.3);
TestRouteTime(route, 1126.09); TestRouteTime(route, 1163.63);
} }
UNIT_TEST(Russia_Moscow_Leningradskiy39GeroevPanfilovtsev22SubrouteTest) UNIT_TEST(Russia_Moscow_Leningradskiy39GeroevPanfilovtsev22SubrouteTest)

View File

@@ -781,9 +781,7 @@ UNIT_TEST(Russia_Moscow_LeninskyProsp_TurnTest)
TEST_EQUAL(result, RouterResultCode::NoError, ()); TEST_EQUAL(result, RouterResultCode::NoError, ());
/// @todo Temporary fix until the construction will be finished. integration::TestTurnCount(route, 6 /* expectedTurnCount */);
integration::TestTurnCount(route, 5 /* expectedTurnCount */);
//integration::GetNthTurn(route, 0).TestValid().TestDirection(CarDirection::ExitHighwayToRight);
} }
// Test on the route from TTK (primary) to a link. // Test on the route from TTK (primary) to a link.