From 440503b584e089969c860b6d2037fbb6000b553a Mon Sep 17 00:00:00 2001 From: Arsentiy Milchakov Date: Fri, 27 Sep 2019 13:35:47 +0300 Subject: [PATCH] [storage] got rid using mapOptions::Nothing option --- platform/platform_tests/country_file_tests.cpp | 4 ---- platform/platform_tests/local_country_file_tests.cpp | 1 - storage/storage.cpp | 9 --------- 3 files changed, 14 deletions(-) diff --git a/platform/platform_tests/country_file_tests.cpp b/platform/platform_tests/country_file_tests.cpp index fc6263c5eb..b5b4a4e127 100644 --- a/platform/platform_tests/country_file_tests.cpp +++ b/platform/platform_tests/country_file_tests.cpp @@ -22,14 +22,12 @@ UNIT_TEST(CountryFile_SmokeTwoComponentMwm) version::FOR_TESTING_TWO_COMPONENT_MWM1); TEST_EQUAL("TestCountry" DATA_FILE_EXTENSION ROUTING_FILE_EXTENSION, routingFileName, ()); - TEST_EQUAL(0, countryFile.GetRemoteSize(MapOptions::Nothing), ()); TEST_EQUAL(0, countryFile.GetRemoteSize(MapOptions::Map), ()); TEST_EQUAL(0, countryFile.GetRemoteSize(MapOptions::CarRouting), ()); TEST_EQUAL(0, countryFile.GetRemoteSize(MapOptions::MapWithCarRouting), ()); countryFile.SetRemoteSizes(1 /* mapSize */, 2 /* routingSize */); - TEST_EQUAL(0, countryFile.GetRemoteSize(MapOptions::Nothing), ()); TEST_EQUAL(1, countryFile.GetRemoteSize(MapOptions::Map), ()); TEST_EQUAL(2, countryFile.GetRemoteSize(MapOptions::CarRouting), ()); TEST_EQUAL(3, countryFile.GetRemoteSize(MapOptions::MapWithCarRouting), ()); @@ -44,14 +42,12 @@ UNIT_TEST(CountryFile_SmokeOneComponentMwm) TEST_EQUAL("TestCountryOneComponent" DATA_FILE_EXTENSION, mapFileName, ()); - TEST_EQUAL(0, countryFile.GetRemoteSize(MapOptions::Nothing), ()); TEST_EQUAL(0, countryFile.GetRemoteSize(MapOptions::Map), ()); TEST_EQUAL(0, countryFile.GetRemoteSize(MapOptions::CarRouting), ()); TEST_EQUAL(0, countryFile.GetRemoteSize(MapOptions::MapWithCarRouting), ()); countryFile.SetRemoteSizes(3 /* mapSize */, 0 /* routingSize */); - TEST_EQUAL(0, countryFile.GetRemoteSize(MapOptions::Nothing), ()); TEST_EQUAL(3, countryFile.GetRemoteSize(MapOptions::Map), ()); TEST_EQUAL(0, countryFile.GetRemoteSize(MapOptions::CarRouting), ()); TEST_EQUAL(3, countryFile.GetRemoteSize(MapOptions::MapWithCarRouting), ()); diff --git a/platform/platform_tests/local_country_file_tests.cpp b/platform/platform_tests/local_country_file_tests.cpp index 103e289e94..d77a0da809 100644 --- a/platform/platform_tests/local_country_file_tests.cpp +++ b/platform/platform_tests/local_country_file_tests.cpp @@ -86,7 +86,6 @@ UNIT_TEST(LocalCountryFile_Smoke) TEST_EQUAL("/test-dir", localFile.GetDirectory(), ()); - TEST_EQUAL(0, localFile.GetSize(MapOptions::Nothing), ()); TEST_EQUAL(0, localFile.GetSize(MapOptions::Map), ()); TEST_EQUAL(0, localFile.GetSize(MapOptions::CarRouting), ()); TEST_EQUAL(0, localFile.GetSize(MapOptions::MapWithCarRouting), ()); diff --git a/storage/storage.cpp b/storage/storage.cpp index 2a50bf36b9..da41f1baf4 100644 --- a/storage/storage.cpp +++ b/storage/storage.cpp @@ -564,9 +564,6 @@ void Storage::DownloadCountry(CountryId const & countryId, MapOptions opt) { CHECK_THREAD_CHECKER(m_threadChecker, ()); - if (opt == MapOptions::Nothing) - return; - if (FindCountryInQueue(countryId) != nullptr) return; @@ -697,8 +694,6 @@ void Storage::DownloadNextFile(QueuedCountry const & country) uint64_t size; auto & p = GetPlatform(); - ASSERT(opt != MapOptions::Nothing, (countryId)); - // Since a downloaded valid diff file may be either with .diff or .diff.ready extension, // we have to check these both cases in order to find // the diff file which is ready to apply. @@ -1006,8 +1001,6 @@ void Storage::OnMapDownloadFinished(CountryId const & countryId, HttpRequest::St { CHECK_THREAD_CHECKER(m_threadChecker, ()); ASSERT(m_didDownload != nullptr, ("Storage::Init wasn't called")); - ASSERT_NOT_EQUAL(MapOptions::Nothing, options, - ("This method should not be called for empty files set.")); alohalytics::LogEvent("$OnMapDownloadFinished", alohalytics::TStringMap( @@ -2043,8 +2036,6 @@ MwmSize Storage::GetRemoteSize(CountryFile const & file, MapOptions opt, int64_t { if (version::IsSingleMwm(version)) { - if (opt == MapOptions::Nothing) - return 0; uint64_t size; if (m_diffManager.SizeFor(file.GetName(), size)) return size;