summaryrefslogtreecommitdiff
path: root/test
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
parentd7227e13a7a87cf50a4c8c1f0615fc565f5a2679 (diff)
downloadqtlocation-mapboxgl-8e5214144ec4f3a4fb40b7a7e4d8f09fd10dbb78.tar.gz
[core] Ensure that a BackendScope exists when doing GL calls
Diffstat (limited to 'test')
-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
-rw-r--r--test/gl/object.test.cpp2
-rw-r--r--test/map/map.test.cpp4
-rw-r--r--test/util/memory.test.cpp2
9 files changed, 19 insertions, 2 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/`
diff --git a/test/gl/object.test.cpp b/test/gl/object.test.cpp
index 85ae457081..5d2bf6735e 100644
--- a/test/gl/object.test.cpp
+++ b/test/gl/object.test.cpp
@@ -62,8 +62,8 @@ TEST(GLObject, Value) {
TEST(GLObject, Store) {
HeadlessBackend backend { test::sharedDisplay() };
- OffscreenView view(backend.getContext());
BackendScope scope { backend };
+ OffscreenView view(backend.getContext());
gl::Context context;
EXPECT_TRUE(context.empty());
diff --git a/test/map/map.test.cpp b/test/map/map.test.cpp
index 2d995fc599..c5017aeb04 100644
--- a/test/map/map.test.cpp
+++ b/test/map/map.test.cpp
@@ -47,6 +47,7 @@ public:
struct MapTest {
util::RunLoop runLoop;
BackendTest backend;
+ BackendScope scope { backend };
OffscreenView view { backend.getContext() };
StubFileSource fileSource;
ThreadPool threadPool { 4 };
@@ -552,6 +553,7 @@ public:
TEST(Map, TEST_DISABLED_ON_CI(ContinuousRendering)) {
util::RunLoop runLoop;
MockBackend backend { test::sharedDisplay() };
+ BackendScope scope { backend };
OffscreenView view { backend.getContext() };
ThreadPool threadPool { 4 };
@@ -585,7 +587,7 @@ TEST(Map, TEST_DISABLED_ON_CI(ContinuousRendering)) {
});
}
- BackendScope scope(backend);
+ BackendScope scope2(backend);
map.render(view);
}};
diff --git a/test/util/memory.test.cpp b/test/util/memory.test.cpp
index 79a3c43dbd..065d024bef 100644
--- a/test/util/memory.test.cpp
+++ b/test/util/memory.test.cpp
@@ -3,6 +3,7 @@
#include <mbgl/test/util.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>
@@ -35,6 +36,7 @@ public:
util::RunLoop runLoop;
HeadlessBackend backend { test::sharedDisplay() };
+ BackendScope scope { backend };
OffscreenView view{ backend.getContext(), { 512, 512 } };
StubFileSource fileSource;
ThreadPool threadPool { 4 };