summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-11-30 10:17:47 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-12-01 09:00:06 -0800
commit7d16824fda7086fbeb0a1deae3fc0abdf0c4832d (patch)
tree11c35642db033c685e78c8b45d28af68a5f3d30b /test
parent54c557d982c92caefd53a68e2f72bba822101c2c (diff)
downloadqtlocation-mapboxgl-7d16824fda7086fbeb0a1deae3fc0abdf0c4832d.tar.gz
[core] Functions must have at least one stop
This is already enforced by the style validator in mapbox-gl-style-spec. Enforce it here too.
Diffstat (limited to 'test')
-rw-r--r--test/fixtures/style_parser/stop-zoom-value.info.json1
-rw-r--r--test/style/functions.test.cpp6
2 files changed, 1 insertions, 6 deletions
diff --git a/test/fixtures/style_parser/stop-zoom-value.info.json b/test/fixtures/style_parser/stop-zoom-value.info.json
index 386dce9d29..39d7c68495 100644
--- a/test/fixtures/style_parser/stop-zoom-value.info.json
+++ b/test/fixtures/style_parser/stop-zoom-value.info.json
@@ -1,6 +1,7 @@
{
"default": {
"log": [
+ [1, "WARNING", "ParseStyle", "function must have at least one stop"],
[1, "WARNING", "ParseStyle", "function stop must have two elements"]
]
}
diff --git a/test/style/functions.test.cpp b/test/style/functions.test.cpp
index 8ca2f951e7..c50787814b 100644
--- a/test/style/functions.test.cpp
+++ b/test/style/functions.test.cpp
@@ -50,12 +50,6 @@ TEST(Function, Stops) {
EXPECT_EQ(3.0, evaluate(slope_2, 15));
EXPECT_EQ(3.0, evaluate(slope_2, 22));
- // Test no values.
- Function<float> slope_3({}, 1.75);
- EXPECT_EQ(1, evaluate(slope_3, 2));
- EXPECT_EQ(1, evaluate(slope_3, 6));
- EXPECT_EQ(1, evaluate(slope_3, 12));
-
// Explicit constant slope in fringe regions.
Function<float> slope_4({ { 0, 2 }, { 8, 10 } }, 1);