summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/gl/context.test.cpp2
-rw-r--r--test/map/map.test.cpp25
-rw-r--r--test/renderer/backend_scope.test.cpp3
-rw-r--r--test/text/local_glyph_rasterizer.test.cpp2
4 files changed, 20 insertions, 12 deletions
diff --git a/test/gl/context.test.cpp b/test/gl/context.test.cpp
index 179ce5de53..920e42bf09 100644
--- a/test/gl/context.test.cpp
+++ b/test/gl/context.test.cpp
@@ -87,7 +87,7 @@ TEST(GLContextMode, Shared) {
ThreadPool threadPool(4);
float pixelRatio { 1 };
- HeadlessFrontend frontend { pixelRatio, fileSource, threadPool, {}, GLContextMode::Shared };
+ HeadlessFrontend frontend { pixelRatio, fileSource, threadPool, {}, GLContextMode::SharedState };
Map map(frontend, MapObserver::nullObserver(), frontend.getSize(), pixelRatio, fileSource, threadPool, MapMode::Static);
map.getStyle().loadJSON(util::read_file("test/fixtures/api/water.json"));
diff --git a/test/map/map.test.cpp b/test/map/map.test.cpp
index 9b34ea89b0..f2bc563a5b 100644
--- a/test/map/map.test.cpp
+++ b/test/map/map.test.cpp
@@ -72,18 +72,23 @@ public:
HeadlessFrontend frontend;
Map map;
- MapTest(float pixelRatio = 1, MapMode mode = MapMode::Static)
- : frontend(pixelRatio, fileSource, threadPool)
- , map(frontend, observer, frontend.getSize(), pixelRatio, fileSource, threadPool, mode) {
+ MapTest(float pixelRatio = 1,
+ MapMode mapMode = MapMode::Static,
+ GLContextMode contextMode = GLContextMode::Automatic)
+ : frontend(pixelRatio, fileSource, threadPool, {}, contextMode),
+ map(frontend, observer, frontend.getSize(), pixelRatio, fileSource, threadPool, mapMode) {
}
template <typename T = FileSource>
- MapTest(const std::string& cachePath, const std::string& assetRoot,
- float pixelRatio = 1, MapMode mode = MapMode::Static,
+ MapTest(const std::string& cachePath,
+ const std::string& assetRoot,
+ float pixelRatio = 1,
+ MapMode mapMode = MapMode::Static,
+ GLContextMode contextMode = GLContextMode::Automatic,
typename std::enable_if<std::is_same<T, DefaultFileSource>::value>::type* = 0)
- : fileSource { cachePath, assetRoot }
- , frontend(pixelRatio, fileSource, threadPool)
- , map(frontend, observer, frontend.getSize(), pixelRatio, fileSource, threadPool, mode) {
+ : fileSource{ cachePath, assetRoot },
+ frontend(pixelRatio, fileSource, threadPool, {}, contextMode),
+ map(frontend, observer, frontend.getSize(), pixelRatio, fileSource, threadPool, mapMode) {
}
};
@@ -447,10 +452,10 @@ TEST(Map, AddLayer) {
}
TEST(Map, WithoutVAOExtension) {
- MapTest<DefaultFileSource> test { ":memory:", "test/fixtures/api/assets" };
+ MapTest<DefaultFileSource> test{ ":memory:", "test/fixtures/api/assets", 1, MapMode::Static,
+ GLContextMode::DisableVAOExtension };
BackendScope scope { *test.frontend.getBackend() };
- test.frontend.getBackend()->getContext().disableVAOExtension = true;
test.map.getStyle().loadJSON(util::read_file("test/fixtures/api/water.json"));
diff --git a/test/renderer/backend_scope.test.cpp b/test/renderer/backend_scope.test.cpp
index 05b82695b2..7bb925d1a9 100644
--- a/test/renderer/backend_scope.test.cpp
+++ b/test/renderer/backend_scope.test.cpp
@@ -9,6 +9,9 @@ using namespace mbgl;
class StubRendererBackend: public RendererBackend {
public:
+ StubRendererBackend() : RendererBackend(GLContextMode::Automatic) {
+ }
+
void bind() override {
}
diff --git a/test/text/local_glyph_rasterizer.test.cpp b/test/text/local_glyph_rasterizer.test.cpp
index 84c685d66f..85aa255220 100644
--- a/test/text/local_glyph_rasterizer.test.cpp
+++ b/test/text/local_glyph_rasterizer.test.cpp
@@ -32,7 +32,7 @@ namespace {
class LocalGlyphRasterizerTest {
public:
LocalGlyphRasterizerTest(const optional<std::string> fontFamily)
- : frontend(pixelRatio, fileSource, threadPool, optional<std::string>(), GLContextMode::Unique, fontFamily)
+ : frontend(pixelRatio, fileSource, threadPool, optional<std::string>(), GLContextMode::Automatic, fontFamily)
{
}