From 21276ab2a0202e077ec827b0f4b6720a1fb9a7fc Mon Sep 17 00:00:00 2001 From: Mathis Logemann Date: Sat, 18 May 2024 10:47:51 +0200 Subject: [PATCH] use explicit type for std::array --- test/unit/datasource/geojson.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) 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)); } }