GeoJSON unit tests- ensure descriptors are ordered by name (ref #3494)
This commit is contained in:
parent
3788b2781e
commit
1a29b35717
2 changed files with 21 additions and 1 deletions
|
@ -1 +1 @@
|
|||
Subproject commit 14eabf8f407294e71636cddfce68297a4f4e0303
|
||||
Subproject commit fb1529e225b36f8a3077ad23f7005951a07c8a7e
|
|
@ -115,6 +115,26 @@ TEST_CASE("geojson") {
|
|||
}
|
||||
}
|
||||
|
||||
SECTION("GeoJSON attribute descriptors are alphabetically ordered")
|
||||
{
|
||||
for (auto cache_features : {true, false})
|
||||
{
|
||||
mapnik::parameters params;
|
||||
params["type"] = "geojson";
|
||||
params["file"] = "./test/data/json/properties.json";
|
||||
params["cache_features"] = cache_features;
|
||||
auto ds = mapnik::datasource_cache::instance().create(params);
|
||||
CHECK(ds != nullptr);
|
||||
std::vector<std::string> expected_names = {"a", "b", "c", "d", "e"};
|
||||
auto fields = ds->get_descriptor().get_descriptors();
|
||||
std::size_t index = 0;
|
||||
for (auto const& field : fields)
|
||||
{
|
||||
REQUIRE(field.get_name() == expected_names[index++]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SECTION("GeoJSON invalid Point")
|
||||
{
|
||||
for (auto cache_features : {true, false})
|
||||
|
|
Loading…
Reference in a new issue