Add more tests for exclude validation
This commit is contained in:
committed by
Patrick Niklaus
parent
0c838fb60c
commit
27324d0270
@@ -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())
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user