diff options
author | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2020-01-20 17:17:42 +0300 |
---|---|---|
committer | gmoryes <gmoryes@gmail.com> | 2020-01-21 13:02:02 +0300 |
commit | ff2c6e480887db5f7dbe7ab5b52a732f581ff147 (patch) | |
tree | 56a74029089b9305217d102eedf35932cbb2302f /routing/routing_tests | |
parent | bba3e1c2494353521fabccc4cb890db5b6ecf36e (diff) |
[routing] Testing case when rebuild route returns an error.
Diffstat (limited to 'routing/routing_tests')
-rw-r--r-- | routing/routing_tests/routing_session_test.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/routing/routing_tests/routing_session_test.cpp b/routing/routing_tests/routing_session_test.cpp index 9c3d5c0277..2c3d52911b 100644 --- a/routing/routing_tests/routing_session_test.cpp +++ b/routing/routing_tests/routing_session_test.cpp @@ -580,7 +580,7 @@ UNIT_CLASS_TEST(AsyncGuiThreadTestWithRoutingSession, TestRouteRebuildingError) TestMovingByUpdatingLat(sessionStateTest, latitudes, info, *m_session); } - // Leaving the route until switching to |SessionState::RouteNeedRebuild| state. + // Test 1. Leaving the route and returning to the route when state is |SessionState::RouteNeedRebuil|. TestLeavingRoute(*m_session, info); // Continue moving along the route. @@ -591,18 +591,16 @@ UNIT_CLASS_TEST(AsyncGuiThreadTestWithRoutingSession, TestRouteRebuildingError) TestMovingByUpdatingLat(sessionStateTest, latitudes, info, *m_session); } - // Leaving the route until switching to |SessionState::RouteRebuilding| state. + // Test 2. Leaving the route until, can not rebuilding it, and going along an old route. + // It happens we the route is left and it's impossible to build a new route. + // In this case the navigation is continued based on the former route. TestLeavingRoute(*m_session, info); { SessionStateTest sessionStateTest( - {SessionState::RouteNeedRebuild, SessionState::RouteRebuilding, - SessionState::RouteNotStarted - }, - *m_session); + {SessionState::RouteNeedRebuild, SessionState::RouteRebuilding}, *m_session); TimedSignal signal; GetPlatform().RunTask(Platform::Thread::Gui, [this, &signal]() { m_session->SetState(SessionState::RouteRebuilding); - m_session->SetState(SessionState::RouteNotStarted); signal.Signal(); }); TEST(signal.WaitUntil(steady_clock::now() + kRouteBuildingMaxDuration), @@ -611,7 +609,8 @@ UNIT_CLASS_TEST(AsyncGuiThreadTestWithRoutingSession, TestRouteRebuildingError) // Continue moving along the route again. { - SessionStateTest sessionStateTest({SessionState::RouteNotStarted, SessionState::OnRoute}, + // Test on state is not changed. + SessionStateTest sessionStateTest({SessionState::RouteRebuilding, SessionState::OnRoute}, *m_session); vector<double> const latitudes = {0.003, 0.0035, 0.004}; TestMovingByUpdatingLat(sessionStateTest, latitudes, info, *m_session); |