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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user