Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2019-02-19 17:31:26 +0300
committerVlad Mihaylenko <vxmihaylenko@gmail.com>2019-02-20 13:25:42 +0300
commit52dd478cda33909e032fa7b63d0b0301d7538727 (patch)
treef620c71664936475865e959326dd98dcbe06b59d /routing
parent19ffa837e6de5d310bdb27452f5b74b9d64a4f56 (diff)
Adding routing integration tests.
Diffstat (limited to 'routing')
-rw-r--r--routing/routing_integration_tests/route_test.cpp40
1 files changed, 39 insertions, 1 deletions
diff --git a/routing/routing_integration_tests/route_test.cpp b/routing/routing_integration_tests/route_test.cpp
index eb113d95d3..0bd7a54e92 100644
--- a/routing/routing_integration_tests/route_test.cpp
+++ b/routing/routing_integration_tests/route_test.cpp
@@ -423,11 +423,49 @@ namespace
MercatorBounds::FromLatLon(52.67316, 48.22478), {0., 0.},
MercatorBounds::FromLatLon(53.49143, 49.52386));
+ CHECK(routeResult.first, ());
+ Route const & route = *routeResult.first;
+ integration::TestRouteTime(route, 7136.04);
+ }
+
+ // Test on removing speed cameras form the route for maps from Jan 2019,
+ // and on the absence of speed cameras in maps for later maps for Switzerland.
+ UNIT_TEST(SwitzerlandNoSpeedCamerasInRouteTest)
+ {
+ TRouteResult const routeResult =
+ integration::CalculateRoute(integration::GetVehicleComponents<VehicleType::Car>(),
+ MercatorBounds::FromLatLon(47.5194, 8.73093), {0., 0.},
+ MercatorBounds::FromLatLon(52.6756, 13.2745));
+
RouterResultCode const result = routeResult.second;
TEST_EQUAL(result, RouterResultCode::NoError, ());
CHECK(routeResult.first, ());
Route const & route = *routeResult.first;
- integration::TestRouteTime(route, 7136.04);
+ auto const & routeSegments = route.GetRouteSegments();
+ for (auto const & routeSegment : routeSegments)
+ {
+ if (!routeSegment.GetSpeedCams().empty())
+ continue;
+
+ TEST(routeSegment.GetSpeedCams().empty(),
+ (routeSegment.GetSegment(), routeSegment.GetStreet()));
+ }
+ }
+
+ // Test on warning about speed cameras for countries where speed cameras partly prohibited.
+ UNIT_TEST(GermanyWarningAboutSpeedCamerasTest)
+ {
+ TRouteResult const routeResult =
+ integration::CalculateRoute(integration::GetVehicleComponents<VehicleType::Car>(),
+ MercatorBounds::FromLatLon(52.38465, 13.41906), {0., 0.},
+ MercatorBounds::FromLatLon(52.67564, 13.27453));
+
+ RouterResultCode const result = routeResult.second;
+ TEST_EQUAL(result, RouterResultCode::NoError, ());
+
+ CHECK(routeResult.first, ());
+ Route const & route = *routeResult.first;
+ TEST(route.CrossMwmsPartlyProhibitedForSpeedCams(), ());
}
} // namespace