use explicit type for std::array
This commit is contained in:
parent
9292899240
commit
21276ab2a0
1 changed files with 11 additions and 8 deletions
|
@ -36,6 +36,8 @@
|
|||
#include <algorithm>
|
||||
#include <cctype>
|
||||
#include <locale>
|
||||
#include <string_view>
|
||||
#include <array>
|
||||
|
||||
/*
|
||||
|
||||
|
@ -151,18 +153,19 @@ TEST_CASE("geojson")
|
|||
REQUIRE(json == json_out);
|
||||
}
|
||||
|
||||
constexpr auto invalid_empty_geometries =
|
||||
std::array{"{ \"type\": \"Point\", \"coordinates\": [] }",
|
||||
"{ \"type\": \"LineString\", \"coordinates\": [[]] }",
|
||||
"{ \"type\": \"Polygon\", \"coordinates\": [[[]]] }",
|
||||
"{ \"type\": \"MultiPoint\", \"coordinates\": [[]] }",
|
||||
"{ \"type\": \"MultiLineString\", \"coordinates\": [[[]]] }",
|
||||
"{ \"type\": \"MultiPolygon\", \"coordinates\": [[[[]]]] }"};
|
||||
constexpr std::array<std::string_view, 6> invalid_empty_geometries{
|
||||
"{ \"type\": \"Point\", \"coordinates\": [] }",
|
||||
"{ \"type\": \"LineString\", \"coordinates\": [[]] }",
|
||||
"{ \"type\": \"Polygon\", \"coordinates\": [[[]]] }",
|
||||
"{ \"type\": \"MultiPoint\", \"coordinates\": [[]] }",
|
||||
"{ \"type\": \"MultiLineString\", \"coordinates\": [[[]]] }",
|
||||
"{ \"type\": \"MultiPolygon\", \"coordinates\": [[[[]]]] }",
|
||||
};
|
||||
|
||||
for (auto&& json : invalid_empty_geometries)
|
||||
{
|
||||
mapnik::geometry::geometry<double> geom;
|
||||
CHECK(!mapnik::json::from_geojson(json, geom));
|
||||
CHECK(!mapnik::json::from_geojson(std::string{json}, geom));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue