diff --git a/editor/editor_tests/osm_editor_test.cpp b/editor/editor_tests/osm_editor_test.cpp index e6159d318f..946c61a3b4 100644 --- a/editor/editor_tests/osm_editor_test.cpp +++ b/editor/editor_tests/osm_editor_test.cpp @@ -286,7 +286,7 @@ void EditorTest::SetIndexTest() { TestCafe cafe({1.0, 1.0}, "London Cafe", "en"); TestStreet street({{0.0, 0.0}, {1.0, 1.0}, {2.0, 2.0}}, "Test street", "en"); - cafe.SetStreetName(street.GetName()); + cafe.SetStreetName(street.GetName("en")); builder.Add(street); builder.Add(cafe); builder.Add(TestCafe({3.0, 3.0}, "London Cafe", "en")); diff --git a/generator/generator_tests/descriptions_section_builder_tests.cpp b/generator/generator_tests/descriptions_section_builder_tests.cpp index be3e7f5ab4..1188395df6 100644 --- a/generator/generator_tests/descriptions_section_builder_tests.cpp +++ b/generator/generator_tests/descriptions_section_builder_tests.cpp @@ -48,7 +48,7 @@ public: } // TestFeature overrides: - std::string ToString() const override { return m_name; } + std::string ToDebugString() const override { return DebugPrint(m_name); } private: std::vector m_types; diff --git a/generator/generator_tests_support/test_feature.cpp b/generator/generator_tests_support/test_feature.cpp index 731b3fb81d..7a6fbe1e1e 100644 --- a/generator/generator_tests_support/test_feature.cpp +++ b/generator/generator_tests_support/test_feature.cpp @@ -38,28 +38,39 @@ uint64_t GenUniqueId() } // namespace // TestFeature ------------------------------------------------------------------------------------- -TestFeature::TestFeature() - : m_id(GenUniqueId()), m_center(0, 0), m_type(Type::Unknown), m_name(""), m_lang("") +TestFeature::TestFeature() : m_id(GenUniqueId()), m_center(0, 0), m_type(Type::Unknown) { Init(); } + +TestFeature::TestFeature(string const & name, string const & lang) + : m_id(GenUniqueId()), m_center(0, 0), m_type(Type::Unknown) { + m_name.AddString(lang, name); + + // Names used for search depend on locale. Fill default name cause we need to run tests with + // different locales. If you do not need default name to be filled use + // TestFeature::TestFeature(StringUtf8Multilang const & name). + m_name.AddString("default", name); Init(); } -TestFeature::TestFeature(string const & name, string const & lang) - : m_id(GenUniqueId()), m_center(0, 0), m_type(Type::Unknown), m_name(name), m_lang(lang) +TestFeature::TestFeature(StringUtf8Multilang const & name) + : m_id(GenUniqueId()), m_center(0, 0), m_type(Type::Unknown), m_name(name) { - Init(); } TestFeature::TestFeature(m2::PointD const & center, string const & name, string const & lang) - : m_id(GenUniqueId()), m_center(center), m_type(Type::Point), m_name(name), m_lang(lang) + : m_id(GenUniqueId()), m_center(center), m_type(Type::Point) { + m_name.AddString(lang, name); + m_name.AddString("default", name); Init(); } TestFeature::TestFeature(vector const & boundary, string const & name, string const & lang) - : m_id(GenUniqueId()), m_boundary(boundary), m_type(Type::Area), m_name(name), m_lang(lang) + : m_id(GenUniqueId()), m_boundary(boundary), m_type(Type::Area) { + m_name.AddString(lang, name); + m_name.AddString("default", name); ASSERT(!m_boundary.empty(), ()); Init(); } @@ -111,12 +122,13 @@ void TestFeature::Serialize(FeatureBuilder1 & fb) const case Type::Unknown: break; } - if (!m_name.empty()) - { - CHECK(fb.AddName(m_lang, m_name), ("Can't set feature name:", m_name, "(", m_lang, ")")); - if (m_lang != "default") - CHECK(fb.AddName("default", m_name), ("Can't set feature name:", m_name, "( default )")); - } + m_name.ForEach([&](int8_t langCode, string const & name) { + if (!name.empty()) + { + auto const lang = StringUtf8Multilang::GetLangByCode(langCode); + CHECK(fb.AddName(lang, name), ("Can't set feature name:", name, "(", lang, ")")); + } + }); if (!m_postcode.empty()) fb.AddPostcode(m_postcode); } @@ -132,15 +144,12 @@ void TestCountry::Serialize(FeatureBuilder1 & fb) const TestFeature::Serialize(fb); auto const & classificator = classif(); fb.AddType(classificator.GetTypeByPath({"place", "country"})); - - // Localities should have default name too. - fb.AddName("default", m_name); } -string TestCountry::ToString() const +string TestCountry::ToDebugString() const { ostringstream os; - os << "TestCountry [" << m_name << ", " << m_lang << ", " << DebugPrint(m_center) << "]"; + os << "TestCountry [" << DebugPrint(m_name) << ", " << DebugPrint(m_center) << "]"; return os.str(); } @@ -165,10 +174,10 @@ void TestCity::Serialize(FeatureBuilder1 & fb) const fb.SetRank(m_rank); } -string TestCity::ToString() const +string TestCity::ToDebugString() const { ostringstream os; - os << "TestCity [" << m_name << ", " << m_lang << ", " << DebugPrint(m_center) << "]"; + os << "TestCity [" << DebugPrint(m_name) << ", " << DebugPrint(m_center) << "]"; return os.str(); } @@ -188,10 +197,10 @@ void TestVillage::Serialize(FeatureBuilder1 & fb) const fb.SetRank(m_rank); } -string TestVillage::ToString() const +string TestVillage::ToDebugString() const { ostringstream os; - os << "TestVillage [" << m_name << ", " << m_lang << ", " << DebugPrint(m_center) << "]"; + os << "TestVillage [" << DebugPrint(m_name) << ", " << DebugPrint(m_center) << "]"; return os.str(); } @@ -201,6 +210,11 @@ TestStreet::TestStreet(vector const & points, string const & name, s { } +TestStreet::TestStreet(vector const & points, StringUtf8Multilang const & name) + : TestFeature(name), m_points(points) +{ +} + void TestStreet::Serialize(FeatureBuilder1 & fb) const { TestFeature::Serialize(fb); @@ -213,10 +227,10 @@ void TestStreet::Serialize(FeatureBuilder1 & fb) const fb.SetLinear(false /* reverseGeometry */); } -string TestStreet::ToString() const +string TestStreet::ToDebugString() const { ostringstream os; - os << "TestStreet [" << m_name << ", " << m_lang << ", " << ::DebugPrint(m_points) << "]"; + os << "TestStreet [" << DebugPrint(m_name) << ", " << ::DebugPrint(m_points) << "]"; return os.str(); } @@ -241,10 +255,10 @@ void TestSquare::Serialize(FeatureBuilder1 & fb) const fb.SetArea(); } -string TestSquare::ToString() const +string TestSquare::ToDebugString() const { ostringstream os; - os << "TestSquare [" << m_name << ", " << m_lang << ", " << m_rect << "]"; + os << "TestSquare [" << DebugPrint(m_name) << ", " << m_rect << "]"; return os.str(); } @@ -287,10 +301,10 @@ void TestPOI::Serialize(FeatureBuilder1 & fb) const fb.AddStreet(m_streetName); } -string TestPOI::ToString() const +string TestPOI::ToDebugString() const { ostringstream os; - os << "TestPOI [" << m_name << ", " << m_lang << ", " << DebugPrint(m_center); + os << "TestPOI [" << DebugPrint(m_name) << ", " << DebugPrint(m_center); if (!m_houseNumber.empty()) os << ", " << m_houseNumber; if (!m_streetName.empty()) @@ -317,10 +331,10 @@ void TestMultilingualPOI::Serialize(FeatureBuilder1 & fb) const } } -string TestMultilingualPOI::ToString() const +string TestMultilingualPOI::ToDebugString() const { ostringstream os; - os << "TestPOI [(" << m_name << ", " << m_lang << "), "; + os << "TestPOI [" << DebugPrint(m_name) << ", "; for (auto const & kv : m_multilingualNames) os << "( " << kv.second << ", " << kv.first << "), "; os << DebugPrint(m_center); @@ -340,21 +354,17 @@ TestBuilding::TestBuilding(m2::PointD const & center, string const & name, } TestBuilding::TestBuilding(m2::PointD const & center, string const & name, - string const & houseNumber, TestStreet const & street, - string const & lang) - : TestFeature(center, name, lang) - , m_houseNumber(houseNumber) - , m_streetName(street.GetName()) + string const & houseNumber, string const & street, string const & lang) + : TestFeature(center, name, lang), m_houseNumber(houseNumber), m_streetName(street) { } TestBuilding::TestBuilding(vector const & boundary, string const & name, - string const & houseNumber, TestStreet const & street, - string const & lang) + string const & houseNumber, string const & street, string const & lang) : TestFeature(boundary, name, lang) , m_boundary(boundary) , m_houseNumber(houseNumber) - , m_streetName(street.GetName()) + , m_streetName(street) { } @@ -372,10 +382,10 @@ void TestBuilding::Serialize(FeatureBuilder1 & fb) const fb.AddType(classificator.GetTypeByPath(type)); } -string TestBuilding::ToString() const +string TestBuilding::ToDebugString() const { ostringstream os; - os << "TestBuilding [" << m_name << ", " << m_houseNumber << ", " << m_lang << ", " + os << "TestBuilding [" << DebugPrint(m_name) << ", " << m_houseNumber << ", " << DebugPrint(m_center) << "]"; return os.str(); } @@ -397,10 +407,11 @@ void TestPark::Serialize(FeatureBuilder1 & fb) const fb.AddType(classificator.GetTypeByPath({"leisure", "park"})); } -string TestPark::ToString() const +string TestPark::ToDebugString() const { ostringstream os; - os << "TestPark [" << m_name << ", " << m_lang << "]"; + os << "TestPark [" << DebugPrint(m_name) << ", " + << "]"; return os.str(); } @@ -422,14 +433,14 @@ void TestRoad::Serialize(FeatureBuilder1 & fb) const fb.SetLinear(false /* reverseGeometry */); } -string TestRoad::ToString() const +string TestRoad::ToDebugString() const { ostringstream os; - os << "TestRoad [" << m_name << ", " << m_lang << "]"; + os << "TestRoad [" << DebugPrint(m_name) << "]"; return os.str(); } // Functions --------------------------------------------------------------------------------------- -string DebugPrint(TestFeature const & feature) { return feature.ToString(); } +string DebugPrint(TestFeature const & feature) { return feature.ToDebugString(); } } // namespace tests_support } // namespace generator diff --git a/generator/generator_tests_support/test_feature.hpp b/generator/generator_tests_support/test_feature.hpp index 196e24c4e5..85e1163966 100644 --- a/generator/generator_tests_support/test_feature.hpp +++ b/generator/generator_tests_support/test_feature.hpp @@ -4,6 +4,8 @@ #include "indexer/feature_meta.hpp" #include "indexer/mwm_set.hpp" +#include "coding/string_utf8_multilang.hpp" + #include "geometry/point2d.hpp" #include "geometry/rect2d.hpp" @@ -31,13 +33,21 @@ public: virtual ~TestFeature() = default; bool Matches(FeatureType & feature) const; - inline void SetPostcode(std::string const & postcode) { m_postcode = postcode; } - inline uint64_t GetId() const { return m_id; } - inline std::string const & GetName() const { return m_name; } - inline feature::Metadata & GetMetadata() { return m_metadata; } + void SetPostcode(std::string const & postcode) { m_postcode = postcode; } + uint64_t GetId() const { return m_id; } + StringUtf8Multilang const & GetNames() const { return m_name; } + std::string GetName(std::string const & lang) const + { + std::string res; + if (m_name.GetString(lang, res)) + return res; + return {}; + } + + feature::Metadata & GetMetadata() { return m_metadata; } virtual void Serialize(FeatureBuilder1 & fb) const; - virtual std::string ToString() const = 0; + virtual std::string ToDebugString() const = 0; protected: enum class Type @@ -49,6 +59,7 @@ protected: TestFeature(); TestFeature(std::string const & name, std::string const & lang); + TestFeature(StringUtf8Multilang const & name); TestFeature(m2::PointD const & center, std::string const & name, std::string const & lang); TestFeature(std::vector const & boundary, std::string const & name, std::string const & lang); @@ -57,8 +68,7 @@ protected: m2::PointD const m_center; std::vector const m_boundary; Type const m_type; - std::string const m_name; - std::string const m_lang; + StringUtf8Multilang m_name; std::string m_postcode; feature::Metadata m_metadata; @@ -73,7 +83,7 @@ public: // TestFeature overrides: void Serialize(FeatureBuilder1 & fb) const override; - std::string ToString() const override; + std::string ToDebugString() const override; }; class TestCity : public TestFeature @@ -86,7 +96,7 @@ public: // TestFeature overrides: void Serialize(FeatureBuilder1 & fb) const override; - std::string ToString() const override; + std::string ToDebugString() const override; private: uint8_t const m_rank; @@ -99,7 +109,7 @@ public: // TestFeature overrides: void Serialize(FeatureBuilder1 & fb) const override; - std::string ToString() const override; + std::string ToDebugString() const override; private: uint8_t const m_rank; @@ -109,10 +119,11 @@ class TestStreet : public TestFeature { public: TestStreet(std::vector const & points, std::string const & name, std::string const & lang); + TestStreet(std::vector const & points, StringUtf8Multilang const & name); // TestFeature overrides: void Serialize(FeatureBuilder1 & fb) const override; - std::string ToString() const override; + std::string ToDebugString() const override; private: std::vector m_points; @@ -125,7 +136,7 @@ public: // TestFeature overrides: void Serialize(FeatureBuilder1 & fb) const override; - std::string ToString() const override; + std::string ToDebugString() const override; private: m2::RectD m_rect; @@ -143,11 +154,11 @@ public: // TestFeature overrides: void Serialize(FeatureBuilder1 & fb) const override; - std::string ToString() const override; + std::string ToDebugString() const override; - inline void SetHouseNumber(std::string const & houseNumber) { m_houseNumber = houseNumber; } - inline void SetStreetName(std::string const & name) { m_streetName = name; } - inline void SetTypes(std::vector> const & types) { m_types = types; } + void SetHouseNumber(std::string const & houseNumber) { m_houseNumber = houseNumber; } + void SetStreetName(std::string const & name) { m_streetName = name; } + void SetTypes(std::vector> const & types) { m_types = types; } protected: std::string m_houseNumber; @@ -162,7 +173,7 @@ public: std::map const & multilingualNames); // TestFeature overrides: void Serialize(FeatureBuilder1 & fb) const override; - std::string ToString() const override; + std::string ToDebugString() const override; private: std::map m_multilingualNames; @@ -174,13 +185,14 @@ public: TestBuilding(m2::PointD const & center, std::string const & name, std::string const & houseNumber, std::string const & lang); TestBuilding(m2::PointD const & center, std::string const & name, std::string const & houseNumber, - TestStreet const & street, std::string const & lang); - TestBuilding(std::vector const & boundary, std::string const & name, std::string const & houseNumber, - TestStreet const & street, std::string const & lang); + std::string const & street, std::string const & lang); + TestBuilding(std::vector const & boundary, std::string const & name, + std::string const & houseNumber, std::string const & street, + std::string const & lang); // TestFeature overrides: void Serialize(FeatureBuilder1 & fb) const override; - std::string ToString() const override; + std::string ToDebugString() const override; void AddType(std::vector const & path) { m_types.push_back(path); } @@ -199,7 +211,7 @@ public: // TestFeature overrides: void Serialize(FeatureBuilder1 & fb) const override; - std::string ToString() const override; + std::string ToDebugString() const override; private: std::vector m_boundary; @@ -212,7 +224,7 @@ public: // TestFeature overrides: void Serialize(FeatureBuilder1 & fb) const override; - std::string ToString() const override; + std::string ToDebugString() const override; private: std::vector m_points; diff --git a/search/search_integration_tests/processor_test.cpp b/search/search_integration_tests/processor_test.cpp index a7010f8088..69d6f3f793 100644 --- a/search/search_integration_tests/processor_test.cpp +++ b/search/search_integration_tests/processor_test.cpp @@ -187,14 +187,14 @@ UNIT_CLASS_TEST(ProcessorTest, Smoke) TestStreet firstAprilStreet(vector{m2::PointD(14.998, 15), m2::PointD(15.002, 15)}, "1st April street", "en"); - TestBuilding feynmanHouse(m2::PointD(10, 10), "Feynman house", "1 unit 1", feynmanStreet, "en"); - TestBuilding bohrHouse(m2::PointD(10, 10), "Bohr house", "1 unit 1", bohrStreet1, "en"); + TestBuilding feynmanHouse(m2::PointD(10, 10), "Feynman house", "1 unit 1", feynmanStreet.GetName("en"), "en"); + TestBuilding bohrHouse(m2::PointD(10, 10), "Bohr house", "1 unit 1", bohrStreet1.GetName("en"), "en"); TestBuilding hilbertHouse( vector{ {10.0005, 10.0005}, {10.0006, 10.0005}, {10.0006, 10.0006}, {10.0005, 10.0006}}, - "Hilbert house", "1 unit 2", bohrStreet1, "en"); + "Hilbert house", "1 unit 2", bohrStreet1.GetName("en"), "en"); TestBuilding descartesHouse(m2::PointD(10, 10), "Descartes house", "2", "en"); - TestBuilding bornHouse(m2::PointD(14.999, 15), "Born house", "8", firstAprilStreet, "en"); + TestBuilding bornHouse(m2::PointD(14.999, 15), "Born house", "8", firstAprilStreet.GetName("en"), "en"); TestPOI busStop(m2::PointD(0, 0), "Bus stop", "en"); TestPOI tramStop(m2::PointD(0.0001, 0.0001), "Tram stop", "en"); @@ -202,7 +202,7 @@ UNIT_CLASS_TEST(ProcessorTest, Smoke) TestPOI quantumTeleport2(m2::PointD(10, 10), "Quantum teleport 2", "en"); quantumTeleport2.SetHouseNumber("3"); - quantumTeleport2.SetStreetName(feynmanStreet.GetName()); + quantumTeleport2.SetStreetName(feynmanStreet.GetName("en")); TestPOI quantumCafe(m2::PointD(-0.0002, -0.0002), "Quantum cafe", "en"); TestPOI lantern1(m2::PointD(10.0005, 10.0005), "lantern 1", "en"); @@ -211,7 +211,7 @@ UNIT_CLASS_TEST(ProcessorTest, Smoke) TestStreet stradaDrive(vector{m2::PointD(-10.001, -10.001), m2::PointD(-10, -10), m2::PointD(-9.999, -9.999)}, "Strada drive", "en"); - TestBuilding terranceHouse(m2::PointD(-10, -10), "", "155", stradaDrive, "en"); + TestBuilding terranceHouse(m2::PointD(-10, -10), "", "155", stradaDrive.GetName("en"), "en"); BuildWorld([&](TestMwmBuilder & builder) { @@ -638,10 +638,10 @@ UNIT_CLASS_TEST(ProcessorTest, TestPostcodes) "Первомайская", "ru"); street.SetPostcode("141701"); - TestBuilding building28(m2::PointD(0.0, 0.00001), "", "28а", street, "ru"); + TestBuilding building28(m2::PointD(0.0, 0.00001), "", "28а", street.GetName("ru"), "ru"); building28.SetPostcode("141701"); - TestBuilding building29(m2::PointD(0.0, -0.00001), "", "29", street, "ru"); + TestBuilding building29(m2::PointD(0.0, -0.00001), "", "29", street.GetName("ru"), "ru"); building29.SetPostcode("141701"); TestPOI building30(m2::PointD(0.00002, 0.00002), "", "en"); @@ -649,7 +649,7 @@ UNIT_CLASS_TEST(ProcessorTest, TestPostcodes) building30.SetPostcode("141701"); building30.SetTypes({{"building", "address"}}); - TestBuilding building31(m2::PointD(0.00001, 0.00001), "", "31", street, "ru"); + TestBuilding building31(m2::PointD(0.00001, 0.00001), "", "31", street.GetName("ru"), "ru"); building31.SetPostcode("141702"); TestBuilding building1(m2::PointD(10, 10), "", "1", "en"); @@ -1115,7 +1115,7 @@ UNIT_CLASS_TEST(ProcessorTest, StopWords) builder.Add(city); }); - auto id = BuildCountry(country.GetName(), [&](TestMwmBuilder & builder) { + auto id = BuildCountry(country.GetName("en"), [&](TestMwmBuilder & builder) { builder.Add(street); builder.Add(bakery); }); @@ -1151,7 +1151,7 @@ UNIT_CLASS_TEST(ProcessorTest, Numerals) TestPOI school(m2::PointD(0, 0), "СШ №61", "ru"); school.SetTypes({{"amenity", "school"}}); - auto id = BuildCountry(country.GetName(), [&](TestMwmBuilder & builder) { builder.Add(school); }); + auto id = BuildCountry(country.GetName("ru"), [&](TestMwmBuilder & builder) { builder.Add(school); }); SetViewport(m2::RectD(m2::PointD(-1.0, -1.0), m2::PointD(1.0, 1.0))); { @@ -1307,8 +1307,8 @@ UNIT_CLASS_TEST(ProcessorTest, RelaxedRetrieval) TestStreet street(vector{m2::PointD(-1.0, 0.0), m2::PointD(1.0, 0.0)}, "Queer Street", "en"); - TestBuilding building0(m2::PointD(-1.0, 0.0), "" /* name */, "0", street, "en"); - TestBuilding building1(m2::PointD(1.0, 0.0), "", "1", street, "en"); + TestBuilding building0(m2::PointD(-1.0, 0.0), "" /* name */, "0", street.GetName("en"), "en"); + TestBuilding building1(m2::PointD(1.0, 0.0), "", "1", street.GetName("en"), "en"); TestBuilding building2(m2::PointD(2.0, 0.0), "named building", "" /* house number */, "en"); TestBuilding building3(m2::PointD(3.0, 0.0), "named building", "", "en"); @@ -1397,7 +1397,7 @@ UNIT_CLASS_TEST(ProcessorTest, PathsThroughLayers) "Computing street", "en"); TestBuilding statisticalLearningBuilding(m2::PointD(8.0, 8.0), "Statistical Learning, Inc.", "0", - computingStreet, "en"); + computingStreet.GetName("en"), "en"); TestPOI reinforcementCafe(m2::PointD(8.0, 8.0), "Trattoria Reinforcemento", "en"); reinforcementCafe.SetTypes({{"amenity", "cafe"}}); @@ -1665,7 +1665,7 @@ UNIT_CLASS_TEST(ProcessorTest, SquareAsStreetTest) TestPOI nonameHouse(m2::PointD(1.0, 1.0), "", "en"); nonameHouse.SetHouseNumber("3"); - nonameHouse.SetStreetName(square.GetName()); + nonameHouse.SetStreetName(square.GetName("en")); auto countryId = BuildCountry(countryName, [&](TestMwmBuilder & builder) { diff --git a/search/search_integration_tests/ranker_test.cpp b/search/search_integration_tests/ranker_test.cpp index 82cd89ebfc..20ecaa05b0 100644 --- a/search/search_integration_tests/ranker_test.cpp +++ b/search/search_integration_tests/ranker_test.cpp @@ -25,12 +25,12 @@ UNIT_CLASS_TEST(RankerTest, ErrorsInStreets) TestStreet mazurova( vector{m2::PointD(-0.001, -0.001), m2::PointD(0, 0), m2::PointD(0.001, 0.001)}, "Мазурова", "ru"); - TestBuilding mazurova14(m2::PointD(-0.001, -0.001), "", "14", mazurova, "ru"); + TestBuilding mazurova14(m2::PointD(-0.001, -0.001), "", "14", mazurova.GetName("ru"), "ru"); TestStreet masherova( vector{m2::PointD(-0.001, 0.001), m2::PointD(0, 0), m2::PointD(0.001, -0.001)}, "Машерова", "ru"); - TestBuilding masherova14(m2::PointD(0.001, 0.001), "", "14", masherova, "ru"); + TestBuilding masherova14(m2::PointD(0.001, 0.001), "", "14", masherova.GetName("ru"), "ru"); auto id = BuildCountry("Belarus", [&](TestMwmBuilder & builder) { builder.Add(mazurova); diff --git a/search/search_integration_tests/smoke_test.cpp b/search/search_integration_tests/smoke_test.cpp index cd0478f007..19d69e8875 100644 --- a/search/search_integration_tests/smoke_test.cpp +++ b/search/search_integration_tests/smoke_test.cpp @@ -40,8 +40,13 @@ public: fb.GetMetadata().Set(feature::Metadata::FMD_TEST_ID, strings::to_string(m_id)); fb.SetCenter(m_center); - if (!m_name.empty()) - CHECK(fb.AddName(m_lang, m_name), ("Can't set feature name:", m_name, "(", m_lang, ")")); + m_name.ForEach([&](int8_t langCode, string const & name) { + if (!name.empty()) + { + auto const lang = StringUtf8Multilang::GetLangByCode(langCode); + CHECK(fb.AddName(lang, name), ("Can't set feature name:", name, "(", lang, ")")); + } + }); auto const & classificator = classif(); fb.AddType(classificator.GetTypeByPath({"place", "country"})); @@ -284,7 +289,7 @@ UNIT_CLASS_TEST(SmokeTest, PoiWithAddress) TestStreet mainStreet({m2::PointD(0.0, 0.0), m2::PointD(1.0, 1.0), m2::PointD(2.0, 2.0)}, "Main Street", "en"); TestCafe cafe(m2::PointD(1.0, 1.0), "Starbucks", "en"); - cafe.SetStreetName(mainStreet.GetName()); + cafe.SetStreetName(mainStreet.GetName("en")); cafe.SetHouseNumber("27"); auto id = BuildMwm(kCountryName, feature::DataHeader::country, [&](TestMwmBuilder & builder) {