diff --git a/test/unit/datasource/geojson.cpp b/test/unit/datasource/geojson.cpp index efbdd063b..1edeb4b55 100644 --- a/test/unit/datasource/geojson.cpp +++ b/test/unit/datasource/geojson.cpp @@ -23,6 +23,7 @@ #include "catch.hpp" #include "ds_test_util.hpp" +#include #include #include #include @@ -657,6 +658,7 @@ TEST_CASE("geojson") { SECTION("GeoJSON properties are properly expressed") { + mapnik::transcoder tr("utf8"); mapnik::parameters params; params["type"] = "geojson"; @@ -693,21 +695,21 @@ TEST_CASE("geojson") { auto fs = all_features(ds); REQUIRE(bool(fs)); std::initializer_list attrs = { - attr{"name", mapnik::value_unicode_string(u8"Test")}, - attr{"NOM_FR", mapnik::value_unicode_string(u8"Québec")}, - attr{"boolean", mapnik::value_bool(u8"true")}, - attr{"description", mapnik::value_unicode_string(u8"Test: \u005C")}, + attr{"name", tr.transcode("Test")}, + attr{"NOM_FR", tr.transcode("Québec")}, + attr{"boolean", mapnik::value_bool("true")}, + attr{"description", tr.transcode("Test: \u005C")}, attr{"double", mapnik::value_double(1.1)}, attr{"int", mapnik::value_integer(1)}, - attr{"object", mapnik::value_unicode_string(u8"{name:\"waka\",spaces:\"value with spaces\",int:1,double:1.1,boolean:false" - u8",NOM_FR:\"Québec\",array:[\"string\",\"value with spaces\",3,1.1,null,true" - u8",\"Québec\"],another_object:{name:\"nested object\"}}")}, - attr{"spaces", mapnik::value_unicode_string(u8"this has spaces")}, - attr{"array", mapnik::value_unicode_string(u8"[\"string\",\"value with spaces\",3,1.1,null,true," - u8"\"Québec\",{name:\"object within an array\"}," - u8"[\"array\",\"within\",\"an\",\"array\"]]")}, - attr{"empty_array", mapnik::value_unicode_string(u8"[]")}, - attr{"empty_object", mapnik::value_unicode_string(u8"{}")}, + attr{"object", tr.transcode("{name:\"waka\",spaces:\"value with spaces\",int:1,double:1.1,boolean:false" + ",NOM_FR:\"Québec\",array:[\"string\",\"value with spaces\",3,1.1,null,true" + ",\"Québec\"],another_object:{name:\"nested object\"}}")}, + attr{"spaces", tr.transcode("this has spaces")}, + attr{"array", tr.transcode("[\"string\",\"value with spaces\",3,1.1,null,true," + "\"Québec\",{name:\"object within an array\"}," + "[\"array\",\"within\",\"an\",\"array\"]]")}, + attr{"empty_array", tr.transcode("[]")}, + attr{"empty_object", tr.transcode("{}")}, }; auto feature = fs->next(); REQUIRE(bool(feature)); diff --git a/test/unit/datasource/topojson.cpp b/test/unit/datasource/topojson.cpp index c0ada73aa..6b1a2e1b1 100644 --- a/test/unit/datasource/topojson.cpp +++ b/test/unit/datasource/topojson.cpp @@ -51,7 +51,7 @@ bool parse_topology(std::string const& filename, mapnik::topojson::topology & to } -TEST_CASE("topology") +TEST_CASE("topojson") { SECTION("geometry parsing") { @@ -91,21 +91,21 @@ TEST_CASE("topology") CHECK(feature); CHECK(feature->envelope() == bbox); std::initializer_list attrs = { - attr{"name", mapnik::value_unicode_string(u8"Test")}, - attr{"NOM_FR", mapnik::value_unicode_string(u8"Québec")}, + attr{"name", tr.transcode("Test")}, + attr{"NOM_FR", tr.transcode("Québec")}, attr{"boolean", mapnik::value_bool("true")}, - attr{"description", mapnik::value_unicode_string(u8"Test: \u005C")}, + attr{"description", tr.transcode("Test: \u005C")}, attr{"double", mapnik::value_double(1.1)}, attr{"int", mapnik::value_integer(1)}, - attr{"object", mapnik::value_unicode_string(u8"{name:\"waka\",spaces:\"value with spaces\",int:1,double:1.1,boolean:false" - u8",NOM_FR:\"Québec\",array:[\"string\",\"value with spaces\",3,1.1,null,true" - u8",\"Québec\"],another_object:{name:\"nested object\"}}")}, - attr{"spaces", mapnik::value_unicode_string(u8"this has spaces")}, - attr{"array", mapnik::value_unicode_string(u8"[\"string\",\"value with spaces\",3,1.1,null,true," - u8"\"Québec\",{name:\"object within an array\"}," - u8"[\"array\",\"within\",\"an\",\"array\"]]")}, - attr{"empty_array", mapnik::value_unicode_string(u8"[]")}, - attr{"empty_object", mapnik::value_unicode_string(u8"{}")}, + attr{"object", tr.transcode("{name:\"waka\",spaces:\"value with spaces\",int:1,double:1.1,boolean:false" + ",NOM_FR:\"Québec\",array:[\"string\",\"value with spaces\",3,1.1,null,true" + ",\"Québec\"],another_object:{name:\"nested object\"}}")}, + attr{"spaces", tr.transcode("this has spaces")}, + attr{"array", tr.transcode("[\"string\",\"value with spaces\",3,1.1,null,true," + "\"Québec\",{name:\"object within an array\"}," + "[\"array\",\"within\",\"an\",\"array\"]]")}, + attr{"empty_array", tr.transcode("[]")}, + attr{"empty_object", tr.transcode("{}")}, }; REQUIRE_ATTRIBUTES(feature, attrs); }