diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2017-04-20 12:28:35 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2017-04-24 10:42:47 +0200 |
commit | 59055cf403cab60496fcc8e7cbf06874fa55bb8b (patch) | |
tree | 7e74c6ba3fa9c2cc1930811302e8b93b48ab1687 /test/style | |
parent | 197f0ca6b418a27412bfcc7e891ab80949fd8833 (diff) | |
download | qtlocation-mapboxgl-59055cf403cab60496fcc8e7cbf06874fa55bb8b.tar.gz |
[core] Move Sprite parsing to thread pool
Diffstat (limited to 'test/style')
-rw-r--r-- | test/style/source.test.cpp | 2 | ||||
-rw-r--r-- | test/style/style.test.cpp | 13 | ||||
-rw-r--r-- | test/style/style_layer.test.cpp | 4 |
3 files changed, 13 insertions, 6 deletions
diff --git a/test/style/source.test.cpp b/test/style/source.test.cpp index f637f1ccde..24ddba8aaf 100644 --- a/test/style/source.test.cpp +++ b/test/style/source.test.cpp @@ -38,7 +38,7 @@ public: TransformState transformState; ThreadPool threadPool { 1 }; AnnotationManager annotationManager { 1.0 }; - style::Style style { fileSource, 1.0 }; + style::Style style { threadPool, fileSource, 1.0 }; style::UpdateParameters updateParameters { 1.0, diff --git a/test/style/style.test.cpp b/test/style/style.test.cpp index b49058420e..f87e31cce2 100644 --- a/test/style/style.test.cpp +++ b/test/style/style.test.cpp @@ -7,6 +7,7 @@ #include <mbgl/style/layer.hpp> #include <mbgl/util/io.hpp> #include <mbgl/util/run_loop.hpp> +#include <mbgl/util/default_thread_pool.hpp> #include <memory> @@ -16,8 +17,9 @@ using namespace mbgl::style; TEST(Style, UnusedSource) { util::RunLoop loop; + ThreadPool threadPool{ 1 }; StubFileSource fileSource; - Style style { fileSource, 1.0 }; + Style style { threadPool, fileSource, 1.0 }; auto now = Clock::now(); @@ -53,8 +55,9 @@ TEST(Style, UnusedSource) { TEST(Style, UnusedSourceActiveViaClassUpdate) { util::RunLoop loop; + ThreadPool threadPool{ 1 }; StubFileSource fileSource; - Style style { fileSource, 1.0 }; + Style style { threadPool, fileSource, 1.0 }; style.setJSON(util::read_file("test/fixtures/resources/style-unused-sources.json")); EXPECT_TRUE(style.addClass("visible")); @@ -86,8 +89,9 @@ TEST(Style, UnusedSourceActiveViaClassUpdate) { TEST(Style, Properties) { util::RunLoop loop; + ThreadPool threadPool{ 1 }; StubFileSource fileSource; - Style style { fileSource, 1.0 }; + Style style { threadPool, fileSource, 1.0 }; style.setJSON(R"STYLE({"name": "Test"})STYLE"); ASSERT_EQ("Test", style.getName()); @@ -120,8 +124,9 @@ TEST(Style, Properties) { TEST(Style, DuplicateSource) { util::RunLoop loop; + ThreadPool threadPool{ 1 }; StubFileSource fileSource; - Style style { fileSource, 1.0 }; + Style style { threadPool, fileSource, 1.0 }; style.setJSON(util::read_file("test/fixtures/resources/style-unused-sources.json")); diff --git a/test/style/style_layer.test.cpp b/test/style/style_layer.test.cpp index 10b88c53d4..657dc24a70 100644 --- a/test/style/style_layer.test.cpp +++ b/test/style/style_layer.test.cpp @@ -18,6 +18,7 @@ #include <mbgl/style/layers/symbol_layer_impl.hpp> #include <mbgl/util/color.hpp> #include <mbgl/util/run_loop.hpp> +#include <mbgl/util/default_thread_pool.hpp> #include <mbgl/util/io.hpp> #include <memory> @@ -279,8 +280,9 @@ TEST(Layer, DuplicateLayer) { util::RunLoop loop; // Setup style + ThreadPool threadPool{ 1 }; StubFileSource fileSource; - Style style { fileSource, 1.0 }; + Style style { threadPool, fileSource, 1.0 }; style.setJSON(util::read_file("test/fixtures/resources/style-unused-sources.json")); // Add initial layer |