diff --git a/test/unit/datasource/geojson.cpp b/test/unit/datasource/geojson.cpp index 66827efb1..105e1993e 100644 --- a/test/unit/datasource/geojson.cpp +++ b/test/unit/datasource/geojson.cpp @@ -36,6 +36,8 @@ #include #include #include +#include +#include /* @@ -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 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 geom; - CHECK(!mapnik::json::from_geojson(json, geom)); + CHECK(!mapnik::json::from_geojson(std::string{json}, geom)); } }