From 09c8c1beb90b9ecd1d2853ae3eb3e157610b40a3 Mon Sep 17 00:00:00 2001 From: Vladimir Byko-Ianko Date: Mon, 24 Sep 2018 16:00:14 +0300 Subject: [PATCH] Review fixes. --- .../routing_integration_tests/route_test.cpp | 27 ++++++++----------- .../routing_test_tools.cpp | 1 + 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/routing/routing_integration_tests/route_test.cpp b/routing/routing_integration_tests/route_test.cpp index 94b9c8f7f9..90cf7cf070 100644 --- a/routing/routing_integration_tests/route_test.cpp +++ b/routing/routing_integration_tests/route_test.cpp @@ -91,24 +91,19 @@ namespace MercatorBounds::FromLatLon(55.77691, 37.70428), 150.); } - // Geometry unpacking test. UNIT_TEST(RussiaFerryToCrimeaLoadCrossGeometryTest) { - // Forward - TRouteResult route = - integration::CalculateRoute(integration::GetVehicleComponents(), - MercatorBounds::FromLatLon(45.34123, 36.67679), {0., 0.}, - MercatorBounds::FromLatLon(45.36479, 36.62194)); - TEST_EQUAL(route.second, RouterResultCode::NoError, ()); - CHECK(route.first, ()); - integration::TestRoutePointsNumber(*route.first, 62 /* expected points number */); - // And backward case - route = integration::CalculateRoute(integration::GetVehicleComponents(), - MercatorBounds::FromLatLon(45.36479, 36.62194), {0., 0.}, - MercatorBounds::FromLatLon(45.34123, 36.67679)); - TEST_EQUAL(route.second, RouterResultCode::NoError, ()); - CHECK(route.first, ()); - integration::TestRoutePointsNumber(*route.first, 50 /* expected points number */); + // To Crimea. + integration::CalculateRouteAndTestRouteLength( + integration::GetVehicleComponents(), + MercatorBounds::FromLatLon(45.34123, 36.67679), {0., 0.}, + MercatorBounds::FromLatLon(45.36479, 36.62194), 5365.0); + + // From Crimea. + integration::CalculateRouteAndTestRouteLength( + integration::GetVehicleComponents(), + MercatorBounds::FromLatLon(45.36479, 36.62194), {0., 0.}, + MercatorBounds::FromLatLon(45.34123, 36.67679), 5400.0); } UNIT_TEST(PriceIslandLoadCrossGeometryTest) diff --git a/routing/routing_integration_tests/routing_test_tools.cpp b/routing/routing_integration_tests/routing_test_tools.cpp index 8faa8f8389..d1a6789158 100644 --- a/routing/routing_integration_tests/routing_test_tools.cpp +++ b/routing/routing_integration_tests/routing_test_tools.cpp @@ -240,6 +240,7 @@ namespace integration CalculateRoute(routerComponents, startPoint, startDirection, finalPoint); RouterResultCode const result = routeResult.second; TEST_EQUAL(result, RouterResultCode::NoError, ()); + CHECK(routeResult.first, ()); TestRouteLength(*routeResult.first, expectedRouteMeters, relativeError); }