diff options
author | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2018-02-28 15:38:33 +0300 |
---|---|---|
committer | mpimenov <mpimenov@users.noreply.github.com> | 2018-03-01 14:40:31 +0300 |
commit | 8b11d84535b75ff3cf041a1aef041d90362816bd (patch) | |
tree | c01726c2aeb1effdbf2f241d7d9c34ffdbd6d981 /routing | |
parent | 0aa93d44ca852c3ac3e83c8a6748f7a9c0ff379c (diff) |
Tests on exit turn generation.
Diffstat (limited to 'routing')
-rw-r--r-- | routing/routing_integration_tests/turn_test.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/routing/routing_integration_tests/turn_test.cpp b/routing/routing_integration_tests/turn_test.cpp index 6084d1a8cd..da839fa7a6 100644 --- a/routing/routing_integration_tests/turn_test.cpp +++ b/routing/routing_integration_tests/turn_test.cpp @@ -845,3 +845,51 @@ TRouteResult const routeResult = integration::TestTurnCount(route, 1 /* expectedTurnCount */); integration::GetNthTurn(route, 0).TestValid().TestDirection(CarDirection::ExitHighwayToRight); } + +// Test on the turn from TTK (primary) to a secondary road. +UNIT_TEST(RussiaMoscowTTKToBegovayAlleyaTest) +{ + TRouteResult const routeResult = + integration::CalculateRoute(integration::GetVehicleComponents<VehicleType::Car>(), + MercatorBounds::FromLatLon(55.77946, 37.55779), {0., 0.}, + MercatorBounds::FromLatLon(55.77956, 37.55891)); + + Route const & route = *routeResult.first; + IRouter::ResultCode const result = routeResult.second; + + TEST_EQUAL(result, IRouter::NoError, ()); + integration::TestTurnCount(route, 1 /* expectedTurnCount */); + integration::GetNthTurn(route, 0).TestValid().TestDirection(CarDirection::TurnRight); +} + +// Test on the turn from TTK (primary) to a service road. The angle of the turn is not slight. +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)); + + Route const & route = *routeResult.first; + IRouter::ResultCode const result = routeResult.second; + + TEST_EQUAL(result, IRouter::NoError, ()); + integration::TestTurnCount(route, 1 /* expectedTurnCount */); + integration::GetNthTurn(route, 0).TestValid().TestDirection(CarDirection::TurnRight); +} + +// Test on a turn from TTK (primary) to an unclassified road. The angle of the turn is slight. +UNIT_TEST(RussiaMoscowTTKToNMaslovkaTest) +{ + TRouteResult const routeResult = + integration::CalculateRoute(integration::GetVehicleComponents<VehicleType::Car>(), + MercatorBounds::FromLatLon(55.79057, 37.57292), {0., 0.}, + MercatorBounds::FromLatLon(55.79132, 37.57481)); + + Route const & route = *routeResult.first; + IRouter::ResultCode const result = routeResult.second; + + TEST_EQUAL(result, IRouter::NoError, ()); + integration::TestTurnCount(route, 1 /* expectedTurnCount */); + integration::GetNthTurn(route, 0).TestValid().TestDirection(CarDirection::ExitHighwayToRight); +} |