From 9092296d88f70847ba7868858139cb7fa22cd607 Mon Sep 17 00:00:00 2001 From: Vladimir Byko-Ianko Date: Thu, 18 Jan 2018 16:49:00 +0300 Subject: [PATCH] Review fixes. --- .../get_altitude_test.cpp | 11 ++++---- .../routing_integration_tests/route_test.cpp | 25 ++++++++----------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/routing/routing_integration_tests/get_altitude_test.cpp b/routing/routing_integration_tests/get_altitude_test.cpp index f6cbfcbbba..bbaa3a6b9d 100644 --- a/routing/routing_integration_tests/get_altitude_test.cpp +++ b/routing/routing_integration_tests/get_altitude_test.cpp @@ -25,18 +25,19 @@ namespace { using namespace feature; +using namespace platform; -LocalCountryFile GetLocalCountryFileByCountryId(string const & countryId) +LocalCountryFile GetLocalCountryFileByCountryId(CountryFile const & country) { vector localFiles; integration::GetAllLocalFiles(localFiles); for (auto const & lf : localFiles) { - if (lf.GetCountryName() == countryId) + if (lf.GetCountryFile() == country) return lf; } - return LocalCountryFile(); + return {}; } void TestAltitudeOfAllMwmFeatures(string const & countryId, TAltitude const altitudeLowerBoundMeters, @@ -44,8 +45,8 @@ void TestAltitudeOfAllMwmFeatures(string const & countryId, TAltitude const alti { Index index; - platform::LocalCountryFile const country = GetLocalCountryFileByCountryId(countryId); - TEST_NOT_EQUAL(country, platform::LocalCountryFile(), ()); + LocalCountryFile const country = GetLocalCountryFileByCountryId(CountryFile(countryId)); + TEST_NOT_EQUAL(country, LocalCountryFile(), ()); TEST_NOT_EQUAL(country.GetFiles(), MapOptions::Nothing, (country)); pair const regResult = index.RegisterMap(country); diff --git a/routing/routing_integration_tests/route_test.cpp b/routing/routing_integration_tests/route_test.cpp index 6737779445..837de39f66 100644 --- a/routing/routing_integration_tests/route_test.cpp +++ b/routing/routing_integration_tests/route_test.cpp @@ -26,20 +26,17 @@ namespace MercatorBounds::FromLatLon(55.66237, 37.63560), 1700.); } -// Fails because checkpoints are far from roads (inside Kremlin and inside the airport). -// This test is commented because the feature, the test is on, will not implement -// in short time perspective. When it does the test should be uncommented. -// UNIT_TEST(MoscowToSVOAirport) -// { -// integration::CalculateRouteAndTestRouteLength( -// integration::GetVehicleComponents(), -// MercatorBounds::FromLatLon(55.75100, 37.61790), {0., 0.}, -// MercatorBounds::FromLatLon(55.97310, 37.41460), 30470.); -// integration::CalculateRouteAndTestRouteLength( -// integration::GetVehicleComponents(), -// MercatorBounds::FromLatLon(55.97310, 37.41460), {0., 0.}, -// MercatorBounds::FromLatLon(55.75100, 37.61790), 30470.); -// } + UNIT_TEST(MoscowToSVOAirport) + { + integration::CalculateRouteAndTestRouteLength( + integration::GetVehicleComponents(), + MercatorBounds::FromLatLon(55.75100, 37.61790), {0., 0.}, + MercatorBounds::FromLatLon(55.97310, 37.41460), 37284.); + integration::CalculateRouteAndTestRouteLength( + integration::GetVehicleComponents(), + MercatorBounds::FromLatLon(55.97310, 37.41460), {0., 0.}, + MercatorBounds::FromLatLon(55.75100, 37.61790), 39449.); + } // Restrictions tests. Check restrictions generation, if there are any errors. UNIT_TEST(RestrictionTestNeatBaumanAndTTK)