Enable all unit tests (#5248)

* Add missing profile name to library extract test.

* Support both tzid and TZID properties on timezone geometry.  Improve validation of timezone polygons.

* Missing tzid property wasn't a geojson validation issue, shouldn't have been tested there.

* Use filesystem glob to loop over all test executables so we don't miss any in the future.

Co-authored-by: Michael Bell <michael@mjjbell.com>
This commit is contained in:
Daniel Patterson
2021-10-22 14:10:25 -07:00
committed by GitHub
parent b120c971a0
commit d5cd702242
7 changed files with 41 additions and 30 deletions
+8
View File
@@ -76,6 +76,14 @@ inline void validateFeature(const rapidjson::Value &feature)
const auto coord_array = feature["geometry"].GetObject()["coordinates"].GetArray();
if (coord_array.Empty())
throw osrm::util::exception("Feature geometry coordinates member is empty.");
if (feature["geometry"]["type"] == "polygon" || feature["geometry"]["type"] == "Polygon")
{
if (!coord_array[0].IsArray() || !coord_array[0][0].IsArray())
{
throw osrm::util::exception("Polygon geometry missing outer ring");
}
}
}
} // namespace util
} // namespace osrm