diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-06-22 12:31:49 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-06-24 09:39:15 -0700 |
commit | c4e4cc5081965d03132eea754c27ece3c95961cb (patch) | |
tree | 3aa4f722ead3273b1faaed5f30449bb8654cf23d /test/style | |
parent | 089c4e413fbe80711ebd874520d3b8fdcb997112 (diff) | |
download | qtlocation-mapboxgl-c4e4cc5081965d03132eea754c27ece3c95961cb.tar.gz |
[core] Adjust layer source properties to better reflect reality
* Layer source ID is immutable; must be provided to the constructor
* Layer source layer is mutable
* Layers with GeoJSON sources do not have a source layer
While here, make Layer::copy impl-private.
Diffstat (limited to 'test/style')
-rw-r--r-- | test/style/source.cpp | 4 | ||||
-rw-r--r-- | test/style/style_layer.cpp | 18 |
2 files changed, 11 insertions, 11 deletions
diff --git a/test/style/source.cpp b/test/style/source.cpp index d31474712e..59b2524e17 100644 --- a/test/style/source.cpp +++ b/test/style/source.cpp @@ -276,8 +276,8 @@ TEST(Source, VectorTileCorrupt) { }; // Need to have at least one layer that uses the source. - auto layer = std::make_unique<LineLayer>("id"); - layer->setSource("source", "water"); + auto layer = std::make_unique<LineLayer>("id", "source"); + layer->setSourceLayer("water"); test.style.addLayer(std::move(layer)); Tileset tileset; diff --git a/test/style/style_layer.cpp b/test/style/style_layer.cpp index 3274131966..9c6a6e924a 100644 --- a/test/style/style_layer.cpp +++ b/test/style/style_layer.cpp @@ -55,12 +55,12 @@ const auto duration = PropertyValue<float> { 1.0f }; TEST(Layer, Clone) { testClone<BackgroundLayer>("background"); - testClone<CircleLayer>("circle"); + testClone<CircleLayer>("circle", "source"); testClone<CustomLayer>("custom", [](void*){}, [](void*, const CustomLayerRenderParameters&){}, [](void*){}, nullptr), - testClone<FillLayer>("fill"); - testClone<LineLayer>("line"); - testClone<RasterLayer>("raster"); - testClone<SymbolLayer>("symbol"); + testClone<FillLayer>("fill", "source"); + testClone<LineLayer>("line", "source"); + testClone<RasterLayer>("raster", "source"); + testClone<SymbolLayer>("symbol", "source"); } TEST(Layer, BackgroundProperties) { @@ -80,7 +80,7 @@ TEST(Layer, BackgroundProperties) { } TEST(Layer, CircleProperties) { - auto layer = std::make_unique<CircleLayer>("circle"); + auto layer = std::make_unique<CircleLayer>("circle", "source"); EXPECT_TRUE(layer->is<CircleLayer>()); // Paint properties @@ -105,7 +105,7 @@ TEST(Layer, CircleProperties) { } TEST(Layer, FillProperties) { - auto layer = std::make_unique<FillLayer>("fill"); + auto layer = std::make_unique<FillLayer>("fill", "source"); EXPECT_TRUE(layer->is<FillLayer>()); // Paint properties @@ -133,7 +133,7 @@ TEST(Layer, FillProperties) { } TEST(Layer, LineProperties) { - auto layer = std::make_unique<LineLayer>("line"); + auto layer = std::make_unique<LineLayer>("line", "source"); EXPECT_TRUE(layer->is<LineLayer>()); // Layout properties @@ -184,7 +184,7 @@ TEST(Layer, LineProperties) { } TEST(Layer, RasterProperties) { - auto layer = std::make_unique<RasterLayer>("raster"); + auto layer = std::make_unique<RasterLayer>("raster", "source"); EXPECT_TRUE(layer->is<RasterLayer>()); // Paint properties |