summaryrefslogtreecommitdiff
path: root/test/gl
diff options
context:
space:
mode:
authorMolly Lloyd <molly@mapbox.com>2018-06-14 14:35:39 -0700
committerMolly Lloyd <mollymerp@users.noreply.github.com>2018-08-31 13:08:47 -0700
commit4a5dc37245d23805d13865f5ef9c5f26e539a9ca (patch)
treede77bfeff6f7afbe02210c9189bf72da59293083 /test/gl
parentec62e321531b1a836074056e86de8e20018280fb (diff)
downloadqtlocation-mapboxgl-4a5dc37245d23805d13865f5ef9c5f26e539a9ca.tar.gz
[core] Implement CrossFadedDataDrivenProperty to add support for feature expressions in `*-pattern` properties
Diffstat (limited to 'test/gl')
-rw-r--r--test/gl/bucket.test.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/test/gl/bucket.test.cpp b/test/gl/bucket.test.cpp
index 9b28b2e01a..04e6447ad8 100644
--- a/test/gl/bucket.test.cpp
+++ b/test/gl/bucket.test.cpp
@@ -52,7 +52,7 @@ TEST(Buckets, CircleBucket) {
ASSERT_FALSE(bucket.needsUpload());
GeometryCollection point { { { 0, 0 } } };
- bucket.addFeature(StubGeometryTileFeature { {}, FeatureType::Point, point, properties }, point);
+ bucket.addFeature(StubGeometryTileFeature { {}, FeatureType::Point, point, properties }, point, {}, PatternLayerMap());
ASSERT_TRUE(bucket.hasData());
ASSERT_TRUE(bucket.needsUpload());
@@ -64,14 +64,15 @@ TEST(Buckets, CircleBucket) {
TEST(Buckets, FillBucket) {
HeadlessBackend backend({ 512, 256 });
BackendScope scope { backend };
+ style::Properties<>::PossiblyEvaluated layout;
gl::Context context;
- FillBucket bucket { { {0, 0, 0}, MapMode::Static, 1.0 }, {} };
+ FillBucket bucket { layout, {}, 5.0f, 1};
ASSERT_FALSE(bucket.hasData());
ASSERT_FALSE(bucket.needsUpload());
GeometryCollection polygon { { { 0, 0 }, { 0, 1 }, { 1, 1 } } };
- bucket.addFeature(StubGeometryTileFeature { {}, FeatureType::Polygon, polygon, properties }, polygon);
+ bucket.addFeature(StubGeometryTileFeature { {}, FeatureType::Polygon, polygon, properties }, polygon, {}, PatternLayerMap());
ASSERT_TRUE(bucket.hasData());
ASSERT_TRUE(bucket.needsUpload());
@@ -82,19 +83,20 @@ TEST(Buckets, FillBucket) {
TEST(Buckets, LineBucket) {
HeadlessBackend backend({ 512, 256 });
BackendScope scope { backend };
+ style::LineLayoutProperties::PossiblyEvaluated layout;
gl::Context context;
- LineBucket bucket { { {0, 0, 0}, MapMode::Static, 1.0 }, {}, {} };
+ LineBucket bucket { layout, {}, 10.0f, 1 };
ASSERT_FALSE(bucket.hasData());
ASSERT_FALSE(bucket.needsUpload());
// Ignore invalid feature type.
GeometryCollection point { { { 0, 0 } } };
- bucket.addFeature(StubGeometryTileFeature { {}, FeatureType::Point, point, properties }, point);
+ bucket.addFeature(StubGeometryTileFeature { {}, FeatureType::Point, point, properties }, point, {}, PatternLayerMap());
ASSERT_FALSE(bucket.hasData());
GeometryCollection line { { { 0, 0 }, { 1, 1 } } };
- bucket.addFeature(StubGeometryTileFeature { {}, FeatureType::LineString, line, properties }, line);
+ bucket.addFeature(StubGeometryTileFeature { {}, FeatureType::LineString, line, properties }, line, {}, PatternLayerMap());
ASSERT_TRUE(bucket.hasData());
ASSERT_TRUE(bucket.needsUpload());
@@ -123,7 +125,7 @@ TEST(Buckets, SymbolBucket) {
// SymbolBucket::addFeature() is a no-op.
GeometryCollection point { { { 0, 0 } } };
- bucket.addFeature(StubGeometryTileFeature { {}, FeatureType::Point, point, properties }, point);
+ bucket.addFeature(StubGeometryTileFeature { {}, FeatureType::Point, point, properties }, point, {}, PatternLayerMap());
ASSERT_FALSE(bucket.hasData());
ASSERT_FALSE(bucket.needsUpload());