[new downloader] Fix integration tests

This commit is contained in:
Sergey Yershov 2016-03-16 18:05:13 +03:00
parent b6877e7cee
commit b5a0cdbe5a
3 changed files with 9 additions and 9 deletions

View file

@ -32,9 +32,9 @@ string const kMapTestDir = "map-tests";
class InterruptException : public exception {};
void Update(LocalCountryFile const & localCountryFile)
void Update(TCountryId const &, storage::Storage::TLocalFilePtr const localCountryFile)
{
TEST_EQUAL(localCountryFile.GetCountryName(), kCountryId, ());
TEST_EQUAL(localCountryFile->GetCountryName(), kCountryId, ());
}
void ChangeCountry(Storage & storage, TCountryId const & countryId)
@ -47,7 +47,7 @@ void ChangeCountry(Storage & storage, TCountryId const & countryId)
void InitStorage(Storage & storage, Storage::TProgressFunction const & onProgressFn)
{
storage.Init(Update);
storage.Init(Update, [](TCountryId const &, storage::Storage::TLocalFilePtr const){return false;});
storage.RegisterAllLocalMaps();
storage.Subscribe(bind(&ChangeCountry, ref(storage), _1), onProgressFn);
storage.SetDownloadingUrlsForTesting({kTestWebServer});

View file

@ -265,13 +265,13 @@ void TestDownloadDelete(bool downloadOneByOne, bool deleteOneByOne)
TEST(version::IsSingleMwm(storage.GetCurrentDataVersion()), ());
string const version = strings::to_string(storage.GetCurrentDataVersion());
auto onUpdatedFn = [&](LocalCountryFile const & localCountryFile)
auto onUpdatedFn = [&](TCountryId const &, storage::Storage::TLocalFilePtr const localCountryFile)
{
TCountryId const countryId = localCountryFile.GetCountryName();
TCountryId const countryId = localCountryFile->GetCountryName();
TEST(kLeafCountriesIds.find(countryId) != kLeafCountriesIds.end(), ());
};
storage.Init(onUpdatedFn);
storage.Init(onUpdatedFn, [](TCountryId const &, storage::Storage::TLocalFilePtr const){return false;});
storage.RegisterAllLocalMaps();
storage.SetDownloadingUrlsForTesting({kTestWebServer});

View file

@ -28,9 +28,9 @@ string const kMapTestDir = "map-tests";
string const kTestWebServer = "http://new-search.mapswithme.com/";
void Update(LocalCountryFile const & localCountryFile)
void Update(TCountryId const &, storage::Storage::TLocalFilePtr const localCountryFile)
{
TEST_EQUAL(localCountryFile.GetCountryName(), kCountryId, ());
TEST_EQUAL(localCountryFile->GetCountryName(), kCountryId, ());
}
} // namespace
@ -61,7 +61,7 @@ UNIT_TEST(StorageDownloadNodeAndDeleteNodeTests)
TEST_EQUAL(countryId, kCountryId, (countryId));
};
storage.Init(Update);
storage.Init(Update, [](TCountryId const &, storage::Storage::TLocalFilePtr const){return false;});
storage.RegisterAllLocalMaps();
storage.Subscribe(ChangeCountryFunction, ProgressFunction);
storage.SetDownloadingUrlsForTesting({kTestWebServer});