[routing] Adding tests for total route time for pedestrian and bicycle routing in case of going up and going down.

This commit is contained in:
Vladimir Byko-Ianko 2019-01-24 09:46:25 +03:00 committed by Vlad Mihaylenko
parent ad9d8ec97d
commit 93e1dae02d
2 changed files with 37 additions and 1 deletions

View file

@ -64,7 +64,7 @@ UNIT_TEST(NetherlandsAmsterdamBicycleYes)
Route const & route = *routeResult.first;
RouterResultCode const result = routeResult.second;
TEST_EQUAL(result, RouterResultCode::NoError, ());
TEST(base::AlmostEqualAbs(route.GetTotalTimeSec(), 293.4, 1.0), (route.GetTotalTimeSec()));
TEST(base::AlmostEqualAbs(route.GetTotalTimeSec(), 343.5, 1.0), (route.GetTotalTimeSec()));
}
// This test on tag cycleway=opposite for a streets which have oneway=yes.
@ -119,3 +119,21 @@ UNIT_TEST(CrossMwmKaliningradRegionToLiepaja)
MercatorBounds::FromLatLon(55.15414, 20.85378), {0., 0.},
MercatorBounds::FromLatLon(56.51119, 21.01847), 192000);
}
// Test on riding up from Adeje (sea level) to Vilaflor (altitude 1400 meters).
UNIT_TEST(SpainTenerifeAdejeVilaflor)
{
integration::CalculateRouteAndTestRouteTime(
integration::GetVehicleComponents<VehicleType::Bicycle>(),
MercatorBounds::FromLatLon(28.11984, -16.72592), {0.0, 0.0},
MercatorBounds::FromLatLon(28.15865, -16.63704), 23500.4 /* expectedTimeSeconds */);
}
// Test on riding down from Vilaflor (altitude 1400 meters) to Adeje (sea level).
UNIT_TEST(SpainTenerifeVilaflorAdeje)
{
integration::CalculateRouteAndTestRouteTime(
integration::GetVehicleComponents<VehicleType::Bicycle>(),
MercatorBounds::FromLatLon(28.15865, -16.63704), {0.0, 0.0},
MercatorBounds::FromLatLon(28.11984, -16.72592), 12365.3 /* expectedTimeSeconds */);
}

View file

@ -505,3 +505,21 @@ UNIT_TEST(ItalyVenicePedestrianPastFerry)
MercatorBounds::FromLatLon(45.4375, 12.33549), {0.0, 0.0},
MercatorBounds::FromLatLon(45.44057, 12.33393), 725.4);
}
// Test on climbing from Priut11 to Elbrus mountain.
UNIT_TEST(RussiaPriut11Elbrus)
{
integration::CalculateRouteAndTestRouteTime(
integration::GetVehicleComponents<VehicleType::Pedestrian>(),
MercatorBounds::FromLatLon(43.31475, 42.46035), {0., 0.},
MercatorBounds::FromLatLon(43.35254, 42.43788), 37300.8 /* expectedTimeSeconds */);
}
// Test on going down from Elbrus mountain to Priut11.
UNIT_TEST(RussiaElbrusPriut11)
{
integration::CalculateRouteAndTestRouteTime(
integration::GetVehicleComponents<VehicleType::Pedestrian>(),
MercatorBounds::FromLatLon(43.35254, 42.43788), {0., 0.},
MercatorBounds::FromLatLon(43.31475, 42.46035), 5980.33 /* expectedTimeSeconds */);
}