diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-04-25 18:20:26 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-05-12 11:26:27 -0700 |
commit | c2a5894f2dbe9982830066ab9347b059e6e7d845 (patch) | |
tree | c09363c2025b80265de195969ee56cc64e567e70 /test/style/style_layer.test.cpp | |
parent | d3f23b83d42de8ef23ea1dbd8abfc6276009531f (diff) | |
download | qtlocation-mapboxgl-c2a5894f2dbe9982830066ab9347b059e6e7d845.tar.gz |
[core] Immutable Impls
Diffstat (limited to 'test/style/style_layer.test.cpp')
-rw-r--r-- | test/style/style_layer.test.cpp | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/test/style/style_layer.test.cpp b/test/style/style_layer.test.cpp index 657dc24a70..2a8379bf20 100644 --- a/test/style/style_layer.test.cpp +++ b/test/style/style_layer.test.cpp @@ -28,15 +28,6 @@ using namespace mbgl::style; namespace { -template <class T, class... Params> void testClone(Params... params) { - auto layer = std::make_unique<T>(std::forward<Params>(params)...); - auto clone = layer->baseImpl->clone(); - EXPECT_NE(layer.get(), clone.get()); - EXPECT_TRUE(reinterpret_cast<typename T::Impl*>(clone->baseImpl.get())); - layer->impl->id = "test"; - EXPECT_EQ("test", layer->baseImpl->clone()->getID()); -} - const auto color = Color { 1, 0, 0, 1 }; const auto opacity = 1.0f; const auto radius = 1.0f; @@ -61,16 +52,6 @@ const auto duration = 1.0f; } // namespace -TEST(Layer, Clone) { - testClone<BackgroundLayer>("background"); - testClone<CircleLayer>("circle", "source"); - testClone<CustomLayer>("custom", [](void*){}, [](void*, const CustomLayerRenderParameters&){}, [](void*){}, nullptr), - testClone<FillLayer>("fill", "source"); - testClone<LineLayer>("line", "source"); - testClone<RasterLayer>("raster", "source"); - testClone<SymbolLayer>("symbol", "source"); -} - TEST(Layer, BackgroundProperties) { auto layer = std::make_unique<BackgroundLayer>("background"); EXPECT_TRUE(layer->is<BackgroundLayer>()); @@ -222,7 +203,7 @@ TEST(Layer, RasterProperties) { TEST(Layer, Observer) { auto layer = std::make_unique<LineLayer>("line", "source"); StubLayerObserver observer; - layer->baseImpl->setObserver(&observer); + layer->setObserver(&observer); // Notifies observer on filter change. bool filterChanged = false; |