summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorYoung Hahn <young@mapbox.com>2016-07-06 17:29:34 -0400
committerGitHub <noreply@github.com>2016-07-06 17:29:34 -0400
commit71a3b1d0db170cfc1786be88c3e7b286c50dece9 (patch)
tree1d51cc28946dc990f8f613795417cb76ea8c00df /test
parent903d609b40b6d0f4873f7bb46d96f4a06d7b17d6 (diff)
downloadqtlocation-mapboxgl-71a3b1d0db170cfc1786be88c3e7b286c50dece9.tar.gz
[core] geometry@0.8.0 / geojsonvt@6.0.0 (#5514)
* [core] geometry.hpp 0.8.0 * geojsonvt @ 6.0.0 * Update platform deps, build scripts * Perf optimizations/cleanup * Rebase in geometry@080 * D.R.Y. etc * Ensure fill annotation geometries have closed rings. * Optimizations * Update to geojsonvt @ 6.1.0 for clean handoff between geojson parsing and geojsonvt * Apply close multi/poly geoms for line annotations as well
Diffstat (limited to 'test')
-rw-r--r--test/fixtures/style_parser/geojson-data-inline.style.json2
-rw-r--r--test/style/filter.cpp7
2 files changed, 3 insertions, 6 deletions
diff --git a/test/fixtures/style_parser/geojson-data-inline.style.json b/test/fixtures/style_parser/geojson-data-inline.style.json
index fc4fe97c78..a5d19eea60 100644
--- a/test/fixtures/style_parser/geojson-data-inline.style.json
+++ b/test/fixtures/style_parser/geojson-data-inline.style.json
@@ -3,7 +3,7 @@
"sources": {
"mapbox": {
"type": "geojson",
- "data": { "type": "Feature", "geometry": { "type": "Point", "coordinates": [100.0, 0.0] } }
+ "data": { "type": "Feature", "geometry": { "type": "Point", "coordinates": [100.0, 0.0] }, "properties": {} }
}
}
}
diff --git a/test/style/filter.cpp b/test/style/filter.cpp
index 2d26a8eb61..53504d84ae 100644
--- a/test/style/filter.cpp
+++ b/test/style/filter.cpp
@@ -8,20 +8,16 @@
#include <rapidjson/document.h>
-#include <map>
-
using namespace mbgl;
using namespace mbgl::style;
-typedef std::multimap<std::string, mbgl::Value> Properties;
-
Filter parse(const char * expression) {
rapidjson::GenericDocument<rapidjson::UTF8<>, rapidjson::CrtAllocator> doc;
doc.Parse<0>(expression);
return *conversion::convert<Filter>(doc);
}
-bool evaluate(const Filter& filter, const Properties& properties, FeatureType type = FeatureType::Unknown) {
+bool evaluate(const Filter& filter, const PropertyMap& properties, FeatureType type = FeatureType::Unknown) {
return filter(type, [&] (const std::string& key) -> optional<Value> {
auto it = properties.find(key);
if (it == properties.end())
@@ -47,6 +43,7 @@ TEST(Filter, EqualsNumber) {
ASSERT_FALSE(evaluate(f, {{ "foo", std::string("0") }}));
ASSERT_FALSE(evaluate(f, {{ "foo", false }}));
ASSERT_FALSE(evaluate(f, {{ "foo", true }}));
+ ASSERT_FALSE(evaluate(f, {{ "foo", nullptr }}));
ASSERT_FALSE(evaluate(f, {{}}));
}