From 4365e749419054e114c4f73dac8f6df58a50799f Mon Sep 17 00:00:00 2001 From: Vladimir Byko-Ianko Date: Wed, 25 Apr 2018 10:04:21 +0300 Subject: [PATCH] Two more routing integration tests. --- .../routing_integration_tests/turn_test.cpp | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/routing/routing_integration_tests/turn_test.cpp b/routing/routing_integration_tests/turn_test.cpp index f4b695bb70..2f5c9fdc29 100644 --- a/routing/routing_integration_tests/turn_test.cpp +++ b/routing/routing_integration_tests/turn_test.cpp @@ -929,3 +929,34 @@ UNIT_TEST(USATampaTest) integration::GetNthTurn(route, 0).TestValid().TestOneOfDirections( {CarDirection::TurnSlightRight, CarDirection::TurnRight}); } + +// Test on go straight direction if it's possible to go through a roundabout. +UNIT_TEST(RussiaMoscowMinskia1TurnTest) +{ + TRouteResult const routeResult = + integration::CalculateRoute(integration::GetVehicleComponents(), + MercatorBounds::FromLatLon(55.7355, 37.48717), {0., 0.}, + MercatorBounds::FromLatLon(55.73694, 37.48587)); + + 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::GoStraight); +} + +UNIT_TEST(RussiaMoscowMinskia2TurnTest) +{ + TRouteResult const routeResult = + integration::CalculateRoute(integration::GetVehicleComponents(), + MercatorBounds::FromLatLon(55.74244, 37.4808), {0., 0.}, + MercatorBounds::FromLatLon(55.74336, 37.48124)); + + 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); +}