summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-04-25 13:15:44 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-06-02 14:51:39 -0700
commita43940afb2208c61b487bfd8729bbde1bd674794 (patch)
tree53d192ea899be1d88f99aeef3d1b3255f9cb5104 /test
parent27baa34d44f0006c05ba7c417bf11e184b0bd22b (diff)
downloadqtlocation-mapboxgl-a43940afb2208c61b487bfd8729bbde1bd674794.tar.gz
[core] Runtime style layer API
Diffstat (limited to 'test')
-rw-r--r--test/style/functions.cpp1
-rw-r--r--test/style/source.cpp5
-rw-r--r--test/style/style_layer.cpp24
3 files changed, 11 insertions, 19 deletions
diff --git a/test/style/functions.cpp b/test/style/functions.cpp
index 2389459dbc..586941ecf0 100644
--- a/test/style/functions.cpp
+++ b/test/style/functions.cpp
@@ -1,7 +1,6 @@
#include <iostream>
#include <mbgl/test/util.hpp>
-#include <mbgl/style/function.hpp>
#include <mbgl/style/function_evaluator.hpp>
#include <mbgl/style/style_calculation_parameters.hpp>
diff --git a/test/style/source.cpp b/test/style/source.cpp
index 5023a9efea..b9eb1bc434 100644
--- a/test/style/source.cpp
+++ b/test/style/source.cpp
@@ -274,9 +274,8 @@ TEST(Source, VectorTileCorrupt) {
};
// Need to have at least one layer that uses the source.
- auto layer = std::make_unique<LineLayer>();
- layer->source = "source";
- layer->sourceLayer = "water";
+ auto layer = std::make_unique<LineLayer>("id");
+ layer->setSource("source", "water");
test.style.addLayer(std::move(layer));
auto info = std::make_unique<SourceInfo>();
diff --git a/test/style/style_layer.cpp b/test/style/style_layer.cpp
index 3b1d3be337..3274fe3377 100644
--- a/test/style/style_layer.cpp
+++ b/test/style/style_layer.cpp
@@ -1,24 +1,18 @@
#include <mbgl/test/util.hpp>
-
-#include <mbgl/style/style_layer.hpp>
#include <mbgl/layer/background_layer.hpp>
+#include <mbgl/layer/background_layer_impl.hpp>
using namespace mbgl;
-TEST(StyleLayer, Create) {
- std::unique_ptr<StyleLayer> layer = std::make_unique<BackgroundLayer>();
- EXPECT_TRUE(reinterpret_cast<BackgroundLayer*>(layer.get()));
-}
-
-TEST(StyleLayer, Clone) {
- std::unique_ptr<StyleLayer> layer = std::make_unique<BackgroundLayer>();
- std::unique_ptr<StyleLayer> clone = layer->clone();
+TEST(Layer, Clone) {
+ std::unique_ptr<Layer> layer = std::make_unique<BackgroundLayer>("id");
+ std::unique_ptr<Layer> clone = layer->baseImpl->clone();
EXPECT_NE(layer.get(), clone.get());
- EXPECT_TRUE(reinterpret_cast<BackgroundLayer*>(layer.get()));
+ EXPECT_TRUE(reinterpret_cast<BackgroundLayer::Impl*>(clone->baseImpl.get()));
}
-TEST(StyleLayer, CloneCopiesBaseProperties) {
- std::unique_ptr<BackgroundLayer> layer = std::make_unique<BackgroundLayer>();
- layer->id = "test";
- EXPECT_EQ("test", layer->clone()->id);
+TEST(Layer, CloneCopiesBaseProperties) {
+ std::unique_ptr<BackgroundLayer> layer = std::make_unique<BackgroundLayer>("id");
+ layer->impl->id = "test";
+ EXPECT_EQ("test", layer->baseImpl->clone()->getID());
}