diff options
author | Young Hahn <young@mapbox.com> | 2016-06-15 11:38:22 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-15 11:38:22 -0400 |
commit | 24b66bc8cdd40a52e08d198c063daa3e1f6be92a (patch) | |
tree | 6d98a5e1216a83f7d6d4c78422c8306d4a4cb157 /test | |
parent | fe64238b4cd5a7da403a4f29a62b14234ecba569 (diff) | |
download | qtlocation-mapboxgl-24b66bc8cdd40a52e08d198c063daa3e1f6be92a.tar.gz |
Color class (#5361)
* Color class
* Switch to list initialization
Diffstat (limited to 'test')
-rw-r--r-- | test/api/annotations.cpp | 9 | ||||
-rw-r--r-- | test/map/map.cpp | 5 | ||||
-rw-r--r-- | test/style/style_layer.cpp | 3 |
3 files changed, 10 insertions, 7 deletions
diff --git a/test/api/annotations.cpp b/test/api/annotations.cpp index fefc1c79b1..abe3862f4e 100644 --- a/test/api/annotations.cpp +++ b/test/api/annotations.cpp @@ -8,6 +8,7 @@ #include <mbgl/platform/default/headless_view.hpp> #include <mbgl/util/io.hpp> #include <mbgl/util/run_loop.hpp> +#include <mbgl/util/color.hpp> using namespace mbgl; @@ -48,7 +49,7 @@ TEST(Annotations, LineAnnotation) { LineString<double> line = {{ { 0, 0 }, { 45, 45 }, { 30, 0 } }}; LineAnnotation annotation { line }; - annotation.color = {{ 255, 0, 0, 1 }}; + annotation.color = { 255, 0, 0, 1 }; annotation.width = 5; test.map.setStyleJSON(util::read_file("test/fixtures/api/empty.json")); @@ -61,7 +62,7 @@ TEST(Annotations, FillAnnotation) { Polygon<double> polygon = {{ {{ { 0, 0 }, { 0, 45 }, { 45, 45 }, { 45, 0 } }} }}; FillAnnotation annotation { polygon }; - annotation.color = {{ 255, 0, 0, 1 }}; + annotation.color = { 255, 0, 0, 1 }; test.map.setStyleJSON(util::read_file("test/fixtures/api/empty.json")); test.map.addAnnotation(annotation); @@ -99,7 +100,7 @@ TEST(Annotations, NonImmediateAdd) { Polygon<double> polygon = {{ {{ { 0, 0 }, { 0, 45 }, { 45, 45 }, { 45, 0 } }} }}; FillAnnotation annotation { polygon }; - annotation.color = {{ 255, 0, 0, 1 }}; + annotation.color = { 255, 0, 0, 1 }; test.map.addAnnotation(annotation); test.checkRendering("non_immediate_add"); @@ -153,7 +154,7 @@ TEST(Annotations, RemoveShape) { LineString<double> line = {{ { 0, 0 }, { 45, 45 } }}; LineAnnotation annotation { line }; - annotation.color = {{ 255, 0, 0, 1 }}; + annotation.color = { 255, 0, 0, 1 }; annotation.width = 5; test.map.setStyleJSON(util::read_file("test/fixtures/api/empty.json")); diff --git a/test/map/map.cpp b/test/map/map.cpp index 57adee567d..b304712e1f 100644 --- a/test/map/map.cpp +++ b/test/map/map.cpp @@ -9,6 +9,7 @@ #include <mbgl/util/io.hpp> #include <mbgl/util/run_loop.hpp> #include <mbgl/style/layers/background_layer.hpp> +#include <mbgl/util/color.hpp> using namespace mbgl; using namespace mbgl::style; @@ -67,7 +68,7 @@ TEST(Map, AddLayer) { map.setStyleJSON(util::read_file("test/fixtures/api/empty.json")); auto layer = std::make_unique<BackgroundLayer>("background"); - layer->setBackgroundColor({{{ 1, 0, 0, 1 }}}); + layer->setBackgroundColor({{ 1, 0, 0, 1 }}); map.addLayer(std::move(layer)); test::checkImage("test/fixtures/map/add_layer", test::render(map)); @@ -80,7 +81,7 @@ TEST(Map, RemoveLayer) { map.setStyleJSON(util::read_file("test/fixtures/api/empty.json")); auto layer = std::make_unique<BackgroundLayer>("background"); - layer->setBackgroundColor({{{ 1, 0, 0, 1 }}}); + layer->setBackgroundColor({{ 1, 0, 0, 1 }}); map.addLayer(std::move(layer)); map.removeLayer("background"); diff --git a/test/style/style_layer.cpp b/test/style/style_layer.cpp index 8af7a07d30..3274131966 100644 --- a/test/style/style_layer.cpp +++ b/test/style/style_layer.cpp @@ -13,6 +13,7 @@ #include <mbgl/style/layers/raster_layer_impl.hpp> #include <mbgl/style/layers/symbol_layer.hpp> #include <mbgl/style/layers/symbol_layer_impl.hpp> +#include <mbgl/util/color.hpp> using namespace mbgl; using namespace mbgl::style; @@ -28,7 +29,7 @@ template <class T, class... Params> void testClone(Params... params) { EXPECT_EQ("test", layer->baseImpl->clone()->getID()); } -const auto color = PropertyValue<Color> {{{ 1, 0, 0, 1 }}}; +const auto color = PropertyValue<Color> {{ 1, 0, 0, 1 }}; const auto opacity = PropertyValue<float> { 1.0f }; const auto radius = PropertyValue<float> { 1.0f }; const auto blur = PropertyValue<float> { 1.0f }; |