diff --git a/storage/storage_integration_tests/download_calc_size_test.cpp b/storage/storage_integration_tests/download_calc_size_test.cpp index 153c1cabc3..52b350cb7f 100644 --- a/storage/storage_integration_tests/download_calc_size_test.cpp +++ b/storage/storage_integration_tests/download_calc_size_test.cpp @@ -32,8 +32,8 @@ UNIT_TEST(DownloadingTests_CalcOverallProgress) { WritableDirChanger writableDirChanger(storage::kMapTestDir); - CountriesVec const kTestCountries = {"Angola", "Tokelau", "New Zealand North_Auckland", - "New Zealand North_Wellington"}; + // A bunch of small islands. + CountriesVec const kTestCountries = { "Kiribati", "Tokelau", "Niue", "Palau", "Pitcairn Islands" }; Storage s; diff --git a/storage/storage_integration_tests/storage_3levels_tests.cpp b/storage/storage_integration_tests/storage_3levels_tests.cpp index f28a641e57..27fbc960ce 100644 --- a/storage/storage_integration_tests/storage_3levels_tests.cpp +++ b/storage/storage_integration_tests/storage_3levels_tests.cpp @@ -19,7 +19,6 @@ using namespace storage; namespace { -std::string const kCountryId = "Germany"; // Germany has 3-levels hierachy int GetLevelCount(Storage & storage, CountryId const & countryId) { @@ -38,11 +37,23 @@ UNIT_TEST(SmallMwms_3levels_Test) Platform & platform = GetPlatform(); - Framework f(FrameworkParams(false /* m_enableLocalAds */, false /* m_enableDiffs */)); - auto & storage = f.GetStorage(); + /// @todo So sick, but Framework.RoutingManager has so complicated logic with a bunch of + /// RunOnGui callbacks, so delete Framework also in RunOnGui. + auto * frm = new Framework(FrameworkParams(false /* m_enableLocalAds */, false /* m_enableDiffs */)); + + SCOPE_GUARD(deleteFramework, [frm]() + { + GetPlatform().RunTask(Platform::Thread::Gui, [frm]() + { + delete frm; + }); + }); + + auto & storage = frm->GetStorage(); std::string const version = strings::to_string(storage.GetCurrentDataVersion()); - TEST_EQUAL(3, GetLevelCount(storage, kCountryId), ()); + CountryId country = "Germany"; + TEST_EQUAL(3, GetLevelCount(storage, country), ()); std::string const mapDir = base::JoinPath(platform.WritableDir(), version); @@ -56,27 +67,30 @@ UNIT_TEST(SmallMwms_3levels_Test) storage.Subscribe(onChangeCountryFn, onProgressFn); storage.SetDownloadingServersForTesting({kTestWebServer}); + /// @todo Download all Germany > 2GB takes hours here .. + country = "Kiribati"; + NodeAttrs attrs; - storage.GetNodeAttrs(kCountryId, attrs); + storage.GetNodeAttrs(country, attrs); TEST_EQUAL(attrs.m_status, NodeStatus::NotDownloaded, ()); Platform::FilesList files; platform.GetFilesByExt(mapDir, DATA_FILE_EXTENSION, files); TEST_EQUAL(0, files.size(), ()); - storage.DownloadNode(kCountryId); + storage.DownloadNode(country); testing::RunEventLoop(); - storage.GetNodeAttrs(kCountryId, attrs); + storage.GetNodeAttrs(country, attrs); TEST_EQUAL(attrs.m_status, NodeStatus::OnDisk, ()); files.clear(); platform.GetFilesByExt(mapDir, DATA_FILE_EXTENSION, files); TEST_GREATER(files.size(), 0, ()); - storage.DeleteNode(kCountryId); + storage.DeleteNode(country); - storage.GetNodeAttrs(kCountryId, attrs); + storage.GetNodeAttrs(country, attrs); TEST_EQUAL(attrs.m_status, NodeStatus::NotDownloaded, ()); files.clear(); diff --git a/storage/storage_integration_tests/storage_downloading_tests.cpp b/storage/storage_integration_tests/storage_downloading_tests.cpp index f117bd6f36..c6cf3b4a89 100644 --- a/storage/storage_integration_tests/storage_downloading_tests.cpp +++ b/storage/storage_integration_tests/storage_downloading_tests.cpp @@ -38,7 +38,7 @@ namespace { using Runner = Platform::ThreadRunner; -string const kCountryId = "Angola"; +string const kCountryId = "Trinidad and Tobago"; class InterruptException : public exception {}; diff --git a/storage/storage_integration_tests/storage_group_download_tests.cpp b/storage/storage_integration_tests/storage_group_download_tests.cpp index e53f4865fb..8547b4612b 100644 --- a/storage/storage_integration_tests/storage_group_download_tests.cpp +++ b/storage/storage_integration_tests/storage_group_download_tests.cpp @@ -23,10 +23,8 @@ using namespace storage; namespace { -CountryId const kGroupCountryId = "New Zealand"; -CountriesSet const kLeafCountriesIds = { - "Tokelau", "New Zealand North_Auckland", "New Zealand North_Wellington", - "New Zealand South_Canterbury", "New Zealand South_Southland"}; +CountryId const kGroupCountryId = "Venezuela"; +CountriesSet const kLeafCountriesIds = { "Venezuela_North", "Venezuela_South" }; string GetMwmFilePath(string const & version, CountryId const & countryId) { @@ -276,6 +274,8 @@ void TestDownloadDelete(bool downloadOneByOne, bool deleteOneByOne) } // namespace +/// @todo Too long to wait for downloads. +/* UNIT_TEST(SmallMwms_GroupDownloadDelete_Test1) { TestDownloadDelete(false, false); @@ -295,3 +295,4 @@ UNIT_TEST(SmallMwms_GroupDownloadDelete_Test4) { TestDownloadDelete(true, true); } +*/ diff --git a/storage/storage_integration_tests/storage_http_tests.cpp b/storage/storage_integration_tests/storage_http_tests.cpp index a5fd194a69..fe15013b16 100644 --- a/storage/storage_integration_tests/storage_http_tests.cpp +++ b/storage/storage_integration_tests/storage_http_tests.cpp @@ -23,7 +23,7 @@ using namespace storage; namespace { -string const kCountryId = "Angola"; +string const kCountryId = "Trinidad and Tobago"; string const kDisputedCountryId1 = "Jerusalem"; string const kDisputedCountryId2 = "Crimea"; string const kDisputedCountryId3 = "Campo de Hielo Sur"; diff --git a/storage/storage_integration_tests/storage_update_tests.cpp b/storage/storage_integration_tests/storage_update_tests.cpp index 5385820d49..00b1aa3412 100644 --- a/storage/storage_integration_tests/storage_update_tests.cpp +++ b/storage/storage_integration_tests/storage_update_tests.cpp @@ -80,6 +80,9 @@ string GetMwmFilePath(string const & version, CountryId const & countryId) } // namespace +/// @todo We don't have direct version links for now. +/// Also Framework f(kFrameworkParams) will fail here, @see SmallMwms_3levels_Test. +/* UNIT_TEST(SmallMwms_Update_Test) { WritableDirChanger writableDirChanger(kMapTestDir); @@ -188,3 +191,4 @@ UNIT_TEST(SmallMwms_Update_Test) } } } +*/