/
githubmirror
/
omim
Обзор
Документация
Войти
/
githubmirror
/
omim
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
generator/generator_tests/osm_element_helpers_tests.cpp
33 строки
1 KB
Mikhail Gorbushin
[generator] Improve city boundaries with relations boundary=administrative
15 ноя 2019, 12:50
15 ноя 2019, 12:50
922bd20
Код
Авторство
О чём код?
#include "testing/testing.hpp" #include "generator/osm_element_helpers.hpp" #include "geometry/point2d.hpp" namespace { using namespace generator::osm_element; OsmElement CreateOsmElement(std::string const & populationStr) { OsmElement element; element.m_tags.emplace_back("population", populationStr); return element; } UNIT_TEST(ParsePopulation) { TEST_EQUAL(GetPopulation(CreateOsmElement("123")), 123, ()); TEST_EQUAL(GetPopulation(CreateOsmElement("123 123")), 123123, ()); TEST_EQUAL(GetPopulation(CreateOsmElement("12,300")), 12300, ()); TEST_EQUAL(GetPopulation(CreateOsmElement("000")), 0, ()); TEST_EQUAL(GetPopulation(CreateOsmElement("123.321")), 123321, ()); TEST_EQUAL(GetPopulation(CreateOsmElement("123 000 000 (Moscow Info)")), 123000000, ()); TEST_EQUAL(GetPopulation(CreateOsmElement("123 000 000 (123)")), 123000000, ()); TEST_EQUAL(GetPopulation(CreateOsmElement("")), 0, ()); TEST_EQUAL(GetPopulation(CreateOsmElement(" ")), 0, ()); TEST_EQUAL(GetPopulation(CreateOsmElement("asd")), 0, ()); TEST_EQUAL(GetPopulation(CreateOsmElement("sfa843r")), 0, ()); TEST_EQUAL(GetPopulation(OsmElement()), 0, ()); } } // namespace