Add more tests for exclude validation

This commit is contained in:
Patrick Niklaus
2017-08-18 21:42:05 +00:00
committed by Patrick Niklaus
parent 0c838fb60c
commit 27324d0270
7 changed files with 55 additions and 4 deletions
+6
View File
@@ -80,6 +80,12 @@ void SetClassNames(const std::vector<std::string> &class_names,
// this makes sure we can correctly validate unkown class names later
for (const auto &name : class_names)
{
if (!isValidClassName(name))
{
throw util::exception("Invalid class name " + name +
" only [a-Z0-9] allowed.");
}
auto iter = classes_map.find(name);
if (iter == classes_map.end())
{
+6
View File
@@ -202,6 +202,12 @@ void ExtractorCallbacks::ProcessWay(const osmium::Way &input_way, const Extracti
ClassData mask = 0;
for (const auto &name_and_flag : classes)
{
if (!isValidClassName(name_and_flag.first))
{
throw util::exception("Invalid class name " + name_and_flag.first +
" only [a-Z0-9] allowed.");
}
if (name_and_flag.second)
{
mask |= classStringToMask(name_and_flag.first);