diff options
author | Yuri Gorshenin <y@maps.me> | 2015-07-27 12:56:45 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:57:39 +0300 |
commit | acb80ad11be5e7431cf31fac57bbe104886e3ef6 (patch) | |
tree | 013a97c129fc4eae02e655f89beefe84a8c636e4 /platform | |
parent | 2f3b3e6728cd3f660df23d7b4f64562aec85b82b (diff) |
Removed E-letter from TMapOptions set.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/country_defines.cpp | 8 | ||||
-rw-r--r-- | platform/country_defines.hpp | 8 | ||||
-rw-r--r-- | platform/country_file.cpp | 8 | ||||
-rw-r--r-- | platform/local_country_file.cpp | 20 | ||||
-rw-r--r-- | platform/local_country_file_utils.cpp | 4 | ||||
-rw-r--r-- | platform/platform_tests/country_file_tests.cpp | 20 | ||||
-rw-r--r-- | platform/platform_tests/local_country_file_tests.cpp | 78 |
7 files changed, 73 insertions, 73 deletions
diff --git a/platform/country_defines.cpp b/platform/country_defines.cpp index 8ee9691ae5..05605e7ee0 100644 --- a/platform/country_defines.cpp +++ b/platform/country_defines.cpp @@ -32,13 +32,13 @@ string DebugPrint(TMapOptions options) { switch (options) { - case TMapOptions::ENothing: + case TMapOptions::Nothing: return "Nothing"; - case TMapOptions::EMap: + case TMapOptions::Map: return "MapOnly"; - case TMapOptions::ECarRouting: + case TMapOptions::CarRouting: return "CarRouting"; - case TMapOptions::EMapWithCarRouting: + case TMapOptions::MapWithCarRouting: return "MapWithCarRouting"; } } diff --git a/platform/country_defines.hpp b/platform/country_defines.hpp index 1273b8e04c..7ba1428fa8 100644 --- a/platform/country_defines.hpp +++ b/platform/country_defines.hpp @@ -4,10 +4,10 @@ enum class TMapOptions : uint8_t { - ENothing = 0x0, - EMap = 0x1, - ECarRouting = 0x2, - EMapWithCarRouting = 0x3 + Nothing = 0x0, + Map = 0x1, + CarRouting = 0x2, + MapWithCarRouting = 0x3 }; bool HasOptions(TMapOptions mask, TMapOptions options); diff --git a/platform/country_file.cpp b/platform/country_file.cpp index b7f4210e8b..c030f4759c 100644 --- a/platform/country_file.cpp +++ b/platform/country_file.cpp @@ -16,9 +16,9 @@ string CountryFile::GetNameWithExt(TMapOptions file) const { switch (file) { - case TMapOptions::EMap: + case TMapOptions::Map: return m_name + DATA_FILE_EXTENSION; - case TMapOptions::ECarRouting: + case TMapOptions::CarRouting: return m_name + DATA_FILE_EXTENSION + ROUTING_FILE_EXTENSION; default: ASSERT(false, ("Can't get name for:", file)); @@ -35,9 +35,9 @@ void CountryFile::SetRemoteSizes(uint32_t mapSize, uint32_t routingSize) uint32_t CountryFile::GetRemoteSize(TMapOptions filesMask) const { uint32_t size = 0; - if (HasOptions(filesMask, TMapOptions::EMap)) + if (HasOptions(filesMask, TMapOptions::Map)) size += m_mapSize; - if (HasOptions(filesMask, TMapOptions::ECarRouting)) + if (HasOptions(filesMask, TMapOptions::CarRouting)) size += m_routingSize; return size; } diff --git a/platform/local_country_file.cpp b/platform/local_country_file.cpp index 3b700b9a7a..da171ebaf8 100644 --- a/platform/local_country_file.cpp +++ b/platform/local_country_file.cpp @@ -12,7 +12,7 @@ namespace platform { LocalCountryFile::LocalCountryFile() - : m_version(0), m_files(TMapOptions::ENothing), m_mapSize(0), m_routingSize() + : m_version(0), m_files(TMapOptions::Nothing), m_mapSize(0), m_routingSize() { } @@ -21,7 +21,7 @@ LocalCountryFile::LocalCountryFile(string const & directory, CountryFile const & : m_directory(directory), m_countryFile(countryFile), m_version(version), - m_files(TMapOptions::ENothing), + m_files(TMapOptions::Nothing), m_mapSize(0), m_routingSize(0) { @@ -29,23 +29,23 @@ LocalCountryFile::LocalCountryFile(string const & directory, CountryFile const & void LocalCountryFile::SyncWithDisk() { - m_files = TMapOptions::ENothing; + m_files = TMapOptions::Nothing; m_mapSize = 0; m_routingSize = 0; Platform & platform = GetPlatform(); - if (platform.GetFileSizeByFullPath(GetPath(TMapOptions::EMap), m_mapSize)) - m_files = SetOptions(m_files, TMapOptions::EMap); + if (platform.GetFileSizeByFullPath(GetPath(TMapOptions::Map), m_mapSize)) + m_files = SetOptions(m_files, TMapOptions::Map); - string const routingPath = GetPath(TMapOptions::ECarRouting); + string const routingPath = GetPath(TMapOptions::CarRouting); if (platform.GetFileSizeByFullPath(routingPath, m_routingSize)) - m_files = SetOptions(m_files, TMapOptions::ECarRouting); + m_files = SetOptions(m_files, TMapOptions::CarRouting); } void LocalCountryFile::DeleteFromDisk(TMapOptions files) const { - for (TMapOptions file : {TMapOptions::EMap, TMapOptions::ECarRouting}) + for (TMapOptions file : {TMapOptions::Map, TMapOptions::CarRouting}) { if (OnDisk(file) && HasOptions(files, file)) { @@ -63,9 +63,9 @@ string LocalCountryFile::GetPath(TMapOptions file) const uint32_t LocalCountryFile::GetSize(TMapOptions filesMask) const { uint64_t size64 = 0; - if (HasOptions(filesMask, TMapOptions::EMap)) + if (HasOptions(filesMask, TMapOptions::Map)) size64 += m_mapSize; - if (HasOptions(filesMask, TMapOptions::ECarRouting)) + if (HasOptions(filesMask, TMapOptions::CarRouting)) size64 += m_routingSize; uint32_t const size32 = static_cast<uint32_t>(size64); ASSERT_EQUAL(size32, size64, ()); diff --git a/platform/local_country_file_utils.cpp b/platform/local_country_file_utils.cpp index cdb7530392..2f9bf2fdf4 100644 --- a/platform/local_country_file_utils.cpp +++ b/platform/local_country_file_utils.cpp @@ -96,7 +96,7 @@ void CleanupMapsDirectory() if (countryName == "Japan" || countryName == "Brazil") { localFile.SyncWithDisk(); - localFile.DeleteFromDisk(TMapOptions::EMapWithCarRouting); + localFile.DeleteFromDisk(TMapOptions::MapWithCarRouting); } } } @@ -176,7 +176,7 @@ void FindAllLocalMaps(vector<LocalCountryFile> & localFiles) // Assume that empty path means the resource file. LocalCountryFile worldFile(string(), CountryFile(file), 0 /* version */); - worldFile.m_files = TMapOptions::EMap; + worldFile.m_files = TMapOptions::Map; if (i != localFiles.end()) { // Always use resource World files instead of local on disk. diff --git a/platform/platform_tests/country_file_tests.cpp b/platform/platform_tests/country_file_tests.cpp index 136aceede6..e12d8d5298 100644 --- a/platform/platform_tests/country_file_tests.cpp +++ b/platform/platform_tests/country_file_tests.cpp @@ -9,20 +9,20 @@ UNIT_TEST(CountryFile_Smoke) { CountryFile countryFile("TestCountry"); TEST_EQUAL("TestCountry", countryFile.GetNameWithoutExt(), ()); - TEST_EQUAL("TestCountry" DATA_FILE_EXTENSION, countryFile.GetNameWithExt(TMapOptions::EMap), ()); + TEST_EQUAL("TestCountry" DATA_FILE_EXTENSION, countryFile.GetNameWithExt(TMapOptions::Map), ()); TEST_EQUAL("TestCountry" DATA_FILE_EXTENSION ROUTING_FILE_EXTENSION, - countryFile.GetNameWithExt(TMapOptions::ECarRouting), ()); + countryFile.GetNameWithExt(TMapOptions::CarRouting), ()); - TEST_EQUAL(0, countryFile.GetRemoteSize(TMapOptions::ENothing), ()); - TEST_EQUAL(0, countryFile.GetRemoteSize(TMapOptions::EMap), ()); - TEST_EQUAL(0, countryFile.GetRemoteSize(TMapOptions::ECarRouting), ()); - TEST_EQUAL(0, countryFile.GetRemoteSize(TMapOptions::EMapWithCarRouting), ()); + TEST_EQUAL(0, countryFile.GetRemoteSize(TMapOptions::Nothing), ()); + TEST_EQUAL(0, countryFile.GetRemoteSize(TMapOptions::Map), ()); + TEST_EQUAL(0, countryFile.GetRemoteSize(TMapOptions::CarRouting), ()); + TEST_EQUAL(0, countryFile.GetRemoteSize(TMapOptions::MapWithCarRouting), ()); countryFile.SetRemoteSizes(1 /* mapSize */, 2 /* routingSize */); - TEST_EQUAL(0, countryFile.GetRemoteSize(TMapOptions::ENothing), ()); - TEST_EQUAL(1, countryFile.GetRemoteSize(TMapOptions::EMap), ()); - TEST_EQUAL(2, countryFile.GetRemoteSize(TMapOptions::ECarRouting), ()); - TEST_EQUAL(3, countryFile.GetRemoteSize(TMapOptions::EMapWithCarRouting), ()); + TEST_EQUAL(0, countryFile.GetRemoteSize(TMapOptions::Nothing), ()); + TEST_EQUAL(1, countryFile.GetRemoteSize(TMapOptions::Map), ()); + TEST_EQUAL(2, countryFile.GetRemoteSize(TMapOptions::CarRouting), ()); + TEST_EQUAL(3, countryFile.GetRemoteSize(TMapOptions::MapWithCarRouting), ()); } } // namespace platform diff --git a/platform/platform_tests/local_country_file_tests.cpp b/platform/platform_tests/local_country_file_tests.cpp index 945ad96fde..148fb03a02 100644 --- a/platform/platform_tests/local_country_file_tests.cpp +++ b/platform/platform_tests/local_country_file_tests.cpp @@ -68,26 +68,26 @@ UNIT_TEST(LocalCountryFile_Smoke) LocalCountryFile localFile("/test-dir", countryFile, 150309); - TEST_EQUAL("/test-dir/TestCountry" DATA_FILE_EXTENSION, localFile.GetPath(TMapOptions::EMap), ()); + TEST_EQUAL("/test-dir/TestCountry" DATA_FILE_EXTENSION, localFile.GetPath(TMapOptions::Map), ()); TEST_EQUAL("/test-dir/TestCountry" DATA_FILE_EXTENSION ROUTING_FILE_EXTENSION, - localFile.GetPath(TMapOptions::ECarRouting), ()); + localFile.GetPath(TMapOptions::CarRouting), ()); // Not synced with disk yet. - TEST_EQUAL(TMapOptions::ENothing, localFile.GetFiles(), ()); + TEST_EQUAL(TMapOptions::Nothing, localFile.GetFiles(), ()); // Any statement is true about elements of an empty set. - TEST(localFile.OnDisk(TMapOptions::ENothing), ()); + TEST(localFile.OnDisk(TMapOptions::Nothing), ()); - TEST(!localFile.OnDisk(TMapOptions::EMap), ()); - TEST(!localFile.OnDisk(TMapOptions::ECarRouting), ()); - TEST(!localFile.OnDisk(TMapOptions::EMapWithCarRouting), ()); + TEST(!localFile.OnDisk(TMapOptions::Map), ()); + TEST(!localFile.OnDisk(TMapOptions::CarRouting), ()); + TEST(!localFile.OnDisk(TMapOptions::MapWithCarRouting), ()); TEST_EQUAL("/test-dir", localFile.GetDirectory(), ()); - TEST_EQUAL(0, localFile.GetSize(TMapOptions::ENothing), ()); - TEST_EQUAL(0, localFile.GetSize(TMapOptions::EMap), ()); - TEST_EQUAL(0, localFile.GetSize(TMapOptions::ECarRouting), ()); - TEST_EQUAL(0, localFile.GetSize(TMapOptions::EMapWithCarRouting), ()); + TEST_EQUAL(0, localFile.GetSize(TMapOptions::Nothing), ()); + TEST_EQUAL(0, localFile.GetSize(TMapOptions::Map), ()); + TEST_EQUAL(0, localFile.GetSize(TMapOptions::CarRouting), ()); + TEST_EQUAL(0, localFile.GetSize(TMapOptions::MapWithCarRouting), ()); TEST_EQUAL(150309, localFile.GetVersion(), ()); } @@ -102,29 +102,29 @@ UNIT_TEST(LocalCountryFile_DiskFiles) countryFile.SetRemoteSizes(1 /* mapSize */, 2 /* routingSize */); LocalCountryFile localFile(platform.WritableDir(), countryFile, 0 /* version */); - TEST(!localFile.OnDisk(TMapOptions::EMap), ()); - TEST(!localFile.OnDisk(TMapOptions::ECarRouting), ()); - TEST(!localFile.OnDisk(TMapOptions::EMapWithCarRouting), ()); + TEST(!localFile.OnDisk(TMapOptions::Map), ()); + TEST(!localFile.OnDisk(TMapOptions::CarRouting), ()); + TEST(!localFile.OnDisk(TMapOptions::MapWithCarRouting), ()); - ScopedFile testMapFile(countryFile.GetNameWithExt(TMapOptions::EMap), "map"); + ScopedFile testMapFile(countryFile.GetNameWithExt(TMapOptions::Map), "map"); localFile.SyncWithDisk(); - TEST(localFile.OnDisk(TMapOptions::EMap), ()); - TEST(!localFile.OnDisk(TMapOptions::ECarRouting), ()); - TEST(!localFile.OnDisk(TMapOptions::EMapWithCarRouting), ()); - TEST_EQUAL(3, localFile.GetSize(TMapOptions::EMap), ()); + TEST(localFile.OnDisk(TMapOptions::Map), ()); + TEST(!localFile.OnDisk(TMapOptions::CarRouting), ()); + TEST(!localFile.OnDisk(TMapOptions::MapWithCarRouting), ()); + TEST_EQUAL(3, localFile.GetSize(TMapOptions::Map), ()); - ScopedFile testRoutingFile(countryFile.GetNameWithExt(TMapOptions::ECarRouting), "routing"); + ScopedFile testRoutingFile(countryFile.GetNameWithExt(TMapOptions::CarRouting), "routing"); localFile.SyncWithDisk(); - TEST(localFile.OnDisk(TMapOptions::EMap), ()); - TEST(localFile.OnDisk(TMapOptions::ECarRouting), ()); - TEST(localFile.OnDisk(TMapOptions::EMapWithCarRouting), ()); - TEST_EQUAL(3, localFile.GetSize(TMapOptions::EMap), ()); - TEST_EQUAL(7, localFile.GetSize(TMapOptions::ECarRouting), ()); - TEST_EQUAL(10, localFile.GetSize(TMapOptions::EMapWithCarRouting), ()); - - localFile.DeleteFromDisk(TMapOptions::EMapWithCarRouting); + TEST(localFile.OnDisk(TMapOptions::Map), ()); + TEST(localFile.OnDisk(TMapOptions::CarRouting), ()); + TEST(localFile.OnDisk(TMapOptions::MapWithCarRouting), ()); + TEST_EQUAL(3, localFile.GetSize(TMapOptions::Map), ()); + TEST_EQUAL(7, localFile.GetSize(TMapOptions::CarRouting), ()); + TEST_EQUAL(10, localFile.GetSize(TMapOptions::MapWithCarRouting), ()); + + localFile.DeleteFromDisk(TMapOptions::MapWithCarRouting); TEST(!testMapFile.Exists(), (testMapFile, "wasn't deleted by LocalCountryFile.")); testMapFile.Reset(); @@ -162,18 +162,18 @@ UNIT_TEST(LocalCountryFile_CleanupMapFiles) CleanupMapsDirectory(); japanLocalFile.SyncWithDisk(); - TEST_EQUAL(TMapOptions::ENothing, japanLocalFile.GetFiles(), ()); + TEST_EQUAL(TMapOptions::Nothing, japanLocalFile.GetFiles(), ()); TEST(!japanMapFile.Exists(), (japanMapFile)); japanMapFile.Reset(); brazilLocalFile.SyncWithDisk(); - TEST_EQUAL(TMapOptions::ENothing, brazilLocalFile.GetFiles(), ()); + TEST_EQUAL(TMapOptions::Nothing, brazilLocalFile.GetFiles(), ()); TEST(!brazilMapFile.Exists(), (brazilMapFile)); brazilMapFile.Reset(); irelandLocalFile.SyncWithDisk(); - TEST_EQUAL(TMapOptions::EMap, irelandLocalFile.GetFiles(), ()); - irelandLocalFile.DeleteFromDisk(TMapOptions::EMap); + TEST_EQUAL(TMapOptions::Map, irelandLocalFile.GetFiles(), ()); + irelandLocalFile.DeleteFromDisk(TMapOptions::Map); TEST(!irelandMapFile.Exists(), (irelandMapFile)); irelandMapFile.Reset(); @@ -216,9 +216,9 @@ UNIT_TEST(LocalCountryFile_DirectoryLookup) ScopedDir testDir("test-dir"); - ScopedFile testIrelandMapFile(testDir, irelandFile, TMapOptions::EMap, "Ireland-map"); - ScopedFile testNetherlandsMapFile(testDir, netherlandsFile, TMapOptions::EMap, "Netherlands-map"); - ScopedFile testNetherlandsRoutingFile(testDir, netherlandsFile, TMapOptions::ECarRouting, + ScopedFile testIrelandMapFile(testDir, irelandFile, TMapOptions::Map, "Ireland-map"); + ScopedFile testNetherlandsMapFile(testDir, netherlandsFile, TMapOptions::Map, "Netherlands-map"); + ScopedFile testNetherlandsRoutingFile(testDir, netherlandsFile, TMapOptions::CarRouting, "Netherlands-routing"); vector<LocalCountryFile> localFiles; @@ -228,10 +228,10 @@ UNIT_TEST(LocalCountryFile_DirectoryLookup) localFile.SyncWithDisk(); LocalCountryFile expectedIrelandFile(testDir.GetFullPath(), irelandFile, 150309); - expectedIrelandFile.m_files = TMapOptions::EMap; + expectedIrelandFile.m_files = TMapOptions::Map; LocalCountryFile expectedNetherlandsFile(testDir.GetFullPath(), netherlandsFile, 150309); - expectedNetherlandsFile.m_files = TMapOptions::EMapWithCarRouting; + expectedNetherlandsFile.m_files = TMapOptions::MapWithCarRouting; vector<LocalCountryFile> expectedLocalFiles = {expectedIrelandFile, expectedNetherlandsFile}; sort(expectedLocalFiles.begin(), expectedLocalFiles.end()); @@ -247,7 +247,7 @@ UNIT_TEST(LocalCountryFile_AllLocalFilesLookup) CountryFile const italyFile("Italy"); ScopedDir testDir("010101"); - ScopedFile testItalyMapFile(testDir, italyFile, TMapOptions::EMap, "Italy-map"); + ScopedFile testItalyMapFile(testDir, italyFile, TMapOptions::Map, "Italy-map"); vector<LocalCountryFile> localFiles; FindAllLocalMaps(localFiles); @@ -365,7 +365,7 @@ UNIT_TEST(LocalCountryFile_MakeTemporary) { string const path = GetPlatform().WritablePathForFile("minsk-pass" DATA_FILE_EXTENSION); LocalCountryFile file = LocalCountryFile::MakeTemporary(path); - TEST_EQUAL(file.GetPath(TMapOptions::EMap), path, ()); + TEST_EQUAL(file.GetPath(TMapOptions::Map), path, ()); } } // namespace platform |