diff --git a/libs/editor/editor_tests/feature_type_to_osm_test.cpp b/libs/editor/editor_tests/feature_type_to_osm_test.cpp index 68d20541b..bbc39ef20 100644 --- a/libs/editor/editor_tests/feature_type_to_osm_test.cpp +++ b/libs/editor/editor_tests/feature_type_to_osm_test.cpp @@ -7,10 +7,30 @@ using namespace editor; +UNIT_TEST(loadFromStream) +{ + std::string data = + "building;[building];;addr:housenumber;name;1;\n" + "amenity|restaurant;61;\n" + "tourism|information|office;[tourism=information][information=office];;name;int_name;313;\n"; + + classificator::Load(); + + TypeToOSMTranslator translator(false); + std::stringstream s(data); + translator.LoadFromStream(s); + + uint32_t type = classif().GetTypeByReadableObjectName("amenity-restaurant"); + std::vector result = translator.OsmTagsFromType(type); + TEST_EQUAL(result.size(), 1, ()); + TEST_EQUAL(result[0].key, "amenity", ()); + TEST_EQUAL(result[0].value, "restaurant", ()); +} + UNIT_TEST(loadConfigFile) { - // LoadConfigFile() is executed in the constructor - TypeToOSMTranslator typeToOsm; + TypeToOSMTranslator translator(false); + translator.LoadConfigFile(); } UNIT_TEST(OsmTagsFromType)