mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-08 05:17:56 +00:00
Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run: git remote add om-historic [om-historic.git repo url] git fetch --tags om-historic git replace squashed-history historic-commits
This commit is contained in:
31
storage/storage_tests/country_name_getter_tests.cpp
Normal file
31
storage/storage_tests/country_name_getter_tests.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "testing/testing.hpp"
|
||||
|
||||
#include "storage/country_name_getter.hpp"
|
||||
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
UNIT_TEST(CountryNameGetterTest)
|
||||
{
|
||||
string const shortJson =
|
||||
"\
|
||||
{\
|
||||
\"Russia_Moscow\":\"Москва\",\
|
||||
\"Russia_Rostov-on-Don\":\"Ростов-на-Дону\"\
|
||||
}";
|
||||
|
||||
storage::CountryNameGetter getter;
|
||||
|
||||
TEST_EQUAL(string(), getter.GetLocale(), ());
|
||||
TEST_EQUAL(string("Russia_Moscow"), getter("Russia_Moscow"), ());
|
||||
TEST_EQUAL(string("Russia_Rostov-on-Don"), getter("Russia_Rostov-on-Don"), ());
|
||||
TEST_EQUAL(string("Russia_Murmansk"), getter("Russia_Murmansk"), ());
|
||||
|
||||
getter.SetLocaleForTesting(shortJson, "ru");
|
||||
|
||||
TEST_EQUAL(string("ru"), getter.GetLocale(), ());
|
||||
TEST_EQUAL(string("Москва"), getter("Russia_Moscow"), ());
|
||||
TEST_EQUAL(string("Ростов-на-Дону"), getter("Russia_Rostov-on-Don"), ());
|
||||
TEST_EQUAL(string("Russia_Murmansk"), getter("Russia_Murmansk"), ());
|
||||
}
|
||||
Reference in New Issue
Block a user