summaryrefslogtreecommitdiff
path: root/test/gl/object.test.cpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-10-28 18:17:33 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-11-08 08:09:29 -0800
commit66bdbc3b969083b9d647abdf72784be64a125949 (patch)
tree9f2f1c6eb3d0569926420459c2c9afda50c66fd0 /test/gl/object.test.cpp
parent36210fe4e9c68a52dedc90548d90e77cf39a2228 (diff)
downloadqtlocation-mapboxgl-66bdbc3b969083b9d647abdf72784be64a125949.tar.gz
[core] Introduce gl::Program template
Diffstat (limited to 'test/gl/object.test.cpp')
-rw-r--r--test/gl/object.test.cpp28
1 files changed, 8 insertions, 20 deletions
diff --git a/test/gl/object.test.cpp b/test/gl/object.test.cpp
index 45a69b4c71..fb143c55c8 100644
--- a/test/gl/object.test.cpp
+++ b/test/gl/object.test.cpp
@@ -7,6 +7,8 @@
#include <memory>
+using namespace mbgl;
+
namespace {
static bool getFlag = false;
@@ -27,7 +29,7 @@ TEST(GLObject, PreserveState) {
getFlag = false;
setFlag = false;
- auto object = std::make_unique<mbgl::gl::PreserveState<MockGLObject>>();
+ auto object = std::make_unique<gl::PreserveState<MockGLObject>>();
EXPECT_TRUE(getFlag);
EXPECT_FALSE(setFlag);
@@ -40,7 +42,7 @@ TEST(GLObject, PreserveState) {
TEST(GLObject, Value) {
setFlag = false;
- auto object = std::make_unique<mbgl::gl::State<MockGLObject>>();
+ auto object = std::make_unique<gl::State<MockGLObject>>();
EXPECT_EQ(object->getCurrentValue(), false);
EXPECT_TRUE(object->isDirty());
EXPECT_FALSE(setFlag);
@@ -58,27 +60,13 @@ TEST(GLObject, Value) {
}
TEST(GLObject, Store) {
- mbgl::HeadlessBackend backend;
- mbgl::OffscreenView view(backend.getContext());
-
- mbgl::gl::Context context;
- EXPECT_TRUE(context.empty());
+ HeadlessBackend backend;
+ OffscreenView view(backend.getContext());
- mbgl::gl::UniqueProgram program = context.createProgram();
- EXPECT_NE(program.get(), 0u);
- program.reset();
- EXPECT_FALSE(context.empty());
- context.performCleanup();
- EXPECT_TRUE(context.empty());
-
- mbgl::gl::UniqueShader shader = context.createVertexShader();
- EXPECT_NE(shader.get(), 0u);
- shader.reset();
- EXPECT_FALSE(context.empty());
- context.performCleanup();
+ gl::Context context;
EXPECT_TRUE(context.empty());
- mbgl::gl::UniqueTexture texture = context.createTexture();
+ gl::UniqueTexture texture = context.createTexture();
EXPECT_NE(texture.get(), 0u);
texture.reset();
EXPECT_FALSE(context.empty());