summaryrefslogtreecommitdiff
path: root/test/api
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2017-02-27 18:33:16 +0100
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-03-23 14:50:11 -0700
commit8e5214144ec4f3a4fb40b7a7e4d8f09fd10dbb78 (patch)
treecf79b67b4af670438cbc79a524be82e88da83904 /test/api
parentd7227e13a7a87cf50a4c8c1f0615fc565f5a2679 (diff)
downloadqtlocation-mapboxgl-8e5214144ec4f3a4fb40b7a7e4d8f09fd10dbb78.tar.gz
[core] Ensure that a BackendScope exists when doing GL calls
Diffstat (limited to 'test/api')
-rw-r--r--test/api/annotations.test.cpp2
-rw-r--r--test/api/api_misuse.test.cpp3
-rw-r--r--test/api/custom_layer.test.cpp2
-rw-r--r--test/api/query.test.cpp2
-rw-r--r--test/api/render_missing.test.cpp2
-rw-r--r--test/api/repeated_render.test.cpp2
6 files changed, 13 insertions, 0 deletions
diff --git a/test/api/annotations.test.cpp b/test/api/annotations.test.cpp
index 87d64d53de..4bcaa03897 100644
--- a/test/api/annotations.test.cpp
+++ b/test/api/annotations.test.cpp
@@ -5,6 +5,7 @@
#include <mbgl/annotation/annotation.hpp>
#include <mbgl/sprite/sprite_image.hpp>
#include <mbgl/map/map.hpp>
+#include <mbgl/map/backend_scope.hpp>
#include <mbgl/gl/headless_backend.hpp>
#include <mbgl/gl/offscreen_view.hpp>
#include <mbgl/util/io.hpp>
@@ -24,6 +25,7 @@ class AnnotationTest {
public:
util::RunLoop loop;
HeadlessBackend backend { test::sharedDisplay() };
+ BackendScope scope { backend };
OffscreenView view { backend.getContext() };
StubFileSource fileSource;
ThreadPool threadPool { 4 };
diff --git a/test/api/api_misuse.test.cpp b/test/api/api_misuse.test.cpp
index 1a61872f79..af703fddfb 100644
--- a/test/api/api_misuse.test.cpp
+++ b/test/api/api_misuse.test.cpp
@@ -3,6 +3,7 @@
#include <mbgl/test/fixture_log_observer.hpp>
#include <mbgl/map/map.hpp>
+#include <mbgl/map/backend_scope.hpp>
#include <mbgl/gl/headless_backend.hpp>
#include <mbgl/gl/offscreen_view.hpp>
#include <mbgl/storage/online_file_source.hpp>
@@ -22,6 +23,7 @@ TEST(API, RenderWithoutCallback) {
util::RunLoop loop;
HeadlessBackend backend { test::sharedDisplay() };
+ BackendScope scope { backend };
OffscreenView view { backend.getContext(), { 128, 512 } };
StubFileSource fileSource;
ThreadPool threadPool(4);
@@ -47,6 +49,7 @@ TEST(API, RenderWithoutStyle) {
util::RunLoop loop;
HeadlessBackend backend { test::sharedDisplay() };
+ BackendScope scope { backend };
OffscreenView view { backend.getContext(), { 128, 512 } };
StubFileSource fileSource;
ThreadPool threadPool(4);
diff --git a/test/api/custom_layer.test.cpp b/test/api/custom_layer.test.cpp
index dd56197463..658c5333c3 100644
--- a/test/api/custom_layer.test.cpp
+++ b/test/api/custom_layer.test.cpp
@@ -2,6 +2,7 @@
#include <mbgl/gl/gl.hpp>
#include <mbgl/map/map.hpp>
+#include <mbgl/map/backend_scope.hpp>
#include <mbgl/gl/headless_backend.hpp>
#include <mbgl/gl/offscreen_view.hpp>
#include <mbgl/util/default_thread_pool.hpp>
@@ -86,6 +87,7 @@ TEST(CustomLayer, Basic) {
util::RunLoop loop;
HeadlessBackend backend { test::sharedDisplay() };
+ BackendScope scope { backend };
OffscreenView view { backend.getContext() };
#ifdef MBGL_ASSET_ZIP
diff --git a/test/api/query.test.cpp b/test/api/query.test.cpp
index 45e6b19268..532cc14d28 100644
--- a/test/api/query.test.cpp
+++ b/test/api/query.test.cpp
@@ -1,4 +1,5 @@
#include <mbgl/map/map.hpp>
+#include <mbgl/map/backend_scope.hpp>
#include <mbgl/gl/headless_backend.hpp>
#include <mbgl/gl/offscreen_view.hpp>
#include <mbgl/util/default_thread_pool.hpp>
@@ -29,6 +30,7 @@ public:
util::RunLoop loop;
HeadlessBackend backend { test::sharedDisplay() };
+ BackendScope scope { backend };
OffscreenView view { backend.getContext() };
StubFileSource fileSource;
ThreadPool threadPool { 4 };
diff --git a/test/api/render_missing.test.cpp b/test/api/render_missing.test.cpp
index c1bf7e5702..8637462cbe 100644
--- a/test/api/render_missing.test.cpp
+++ b/test/api/render_missing.test.cpp
@@ -2,6 +2,7 @@
#include <mbgl/test/fixture_log_observer.hpp>
#include <mbgl/map/map.hpp>
+#include <mbgl/map/backend_scope.hpp>
#include <mbgl/gl/headless_backend.hpp>
#include <mbgl/gl/offscreen_view.hpp>
#include <mbgl/util/default_thread_pool.hpp>
@@ -26,6 +27,7 @@ TEST(API, TEST_REQUIRES_SERVER(RenderMissingTile)) {
const auto style = util::read_file("test/fixtures/api/water_missing_tiles.json");
HeadlessBackend backend { test::sharedDisplay() };
+ BackendScope scope { backend };
OffscreenView view { backend.getContext(), { 256, 512 } };
#ifdef MBGL_ASSET_ZIP
// Regenerate with `cd test/fixtures/api/ && zip -r assets.zip assets/`
diff --git a/test/api/repeated_render.test.cpp b/test/api/repeated_render.test.cpp
index 800813075f..6648a7752e 100644
--- a/test/api/repeated_render.test.cpp
+++ b/test/api/repeated_render.test.cpp
@@ -2,6 +2,7 @@
#include <mbgl/test/fixture_log_observer.hpp>
#include <mbgl/map/map.hpp>
+#include <mbgl/map/backend_scope.hpp>
#include <mbgl/gl/headless_backend.hpp>
#include <mbgl/gl/offscreen_view.hpp>
#include <mbgl/util/default_thread_pool.hpp>
@@ -22,6 +23,7 @@ TEST(API, RepeatedRender) {
const auto style = util::read_file("test/fixtures/api/water.json");
HeadlessBackend backend { test::sharedDisplay() };
+ BackendScope scope { backend };
OffscreenView view { backend.getContext(), { 256, 512 } };
#ifdef MBGL_ASSET_ZIP
// Regenerate with `cd test/fixtures/api/ && zip -r assets.zip assets/`