summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/qopengl/tst_qopengl.cpp
diff options
context:
space:
mode:
authorAndrew Knight <andrew.knight@digia.com>2013-09-30 15:07:24 +0300
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-30 14:18:38 +0200
commitaa5f78cb33404e585a1e511a58a0ca43aa46f421 (patch)
tree4bd0837b0089dbecbef4644a156ec9d2499e4e5c /tests/auto/gui/qopengl/tst_qopengl.cpp
parentf08cc1dabe9aba1fbb1ddfa9d9a3f38afac65372 (diff)
OpenGL autotests: verify create()/makeCurrent()
If create() or makeCurrent() calls fail, the test should fail fast. Change-Id: I025c541f94c8eee492cf0e1545bfbb8027eff2a7 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'tests/auto/gui/qopengl/tst_qopengl.cpp')
-rw-r--r--tests/auto/gui/qopengl/tst_qopengl.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/tests/auto/gui/qopengl/tst_qopengl.cpp b/tests/auto/gui/qopengl/tst_qopengl.cpp
index 97f3ec128d..4defbe181f 100644
--- a/tests/auto/gui/qopengl/tst_qopengl.cpp
+++ b/tests/auto/gui/qopengl/tst_qopengl.cpp
@@ -171,8 +171,8 @@ void tst_QOpenGL::sharedResourceCleanup()
QScopedPointer<QSurface> surface(createSurface(surfaceClass));
QOpenGLContext *ctx = new QOpenGLContext;
- ctx->create();
- ctx->makeCurrent(surface.data());
+ QVERIFY(ctx->create());
+ QVERIFY(ctx->makeCurrent(surface.data()));
SharedResourceTracker tracker;
SharedResource *resource = new SharedResource(&tracker);
@@ -188,7 +188,7 @@ void tst_QOpenGL::sharedResourceCleanup()
QOpenGLContext *ctx2 = new QOpenGLContext;
ctx2->setShareContext(ctx);
- ctx2->create();
+ QVERIFY(ctx2->create());
delete ctx;
@@ -238,7 +238,7 @@ void tst_QOpenGL::multiGroupSharedResourceCleanup()
for (int i = 0; i < 10; ++i) {
QOpenGLContext *gl = new QOpenGLContext();
- gl->create();
+ QVERIFY(gl->create());
gl->makeCurrent(surface.data());
{
// Cause QOpenGLMultiGroupSharedResource instantiation.
@@ -262,8 +262,8 @@ void tst_QOpenGL::multiGroupSharedResourceCleanupCustom()
QScopedPointer<QSurface> surface(createSurface(surfaceClass));
QOpenGLContext *ctx = new QOpenGLContext();
- ctx->create();
- ctx->makeCurrent(surface.data());
+ QVERIFY(ctx->create());
+ QVERIFY(ctx->makeCurrent(surface.data()));
QOpenGLMultiGroupSharedResource multiGroupSharedResource;
SharedResource *resource = multiGroupSharedResource.value<SharedResource>(ctx);
@@ -401,7 +401,7 @@ void tst_QOpenGL::fboSimpleRendering()
QScopedPointer<QSurface> surface(createSurface(surfaceClass));
QOpenGLContext ctx;
- ctx.create();
+ QVERIFY(ctx.create());
ctx.makeCurrent(surface.data());
@@ -449,7 +449,7 @@ void tst_QOpenGL::fboRendering()
QScopedPointer<QSurface> surface(createSurface(surfaceClass));
QOpenGLContext ctx;
- ctx.create();
+ QVERIFY(ctx.create());
ctx.makeCurrent(surface.data());
@@ -493,7 +493,7 @@ void tst_QOpenGL::fboHandleNulledAfterContextDestroyed()
{
QOpenGLContext ctx;
- ctx.create();
+ QVERIFY(ctx.create());
ctx.makeCurrent(&window);
@@ -523,7 +523,7 @@ void tst_QOpenGL::openGLPaintDevice()
QScopedPointer<QSurface> surface(createSurface(surfaceClass));
QOpenGLContext ctx;
- ctx.create();
+ QVERIFY(ctx.create());
QSurfaceFormat format = ctx.format();
if (format.majorVersion() < 2)
@@ -576,8 +576,8 @@ void tst_QOpenGL::aboutToBeDestroyed()
QOpenGLContext *context = new QOpenGLContext;
QSignalSpy spy(context, SIGNAL(aboutToBeDestroyed()));
- context->create();
- context->makeCurrent(&window);
+ QVERIFY(context->create());
+ QVERIFY(context->makeCurrent(&window));
QCOMPARE(spy.size(), 0);
@@ -598,8 +598,8 @@ void tst_QOpenGL::QTBUG15621_triangulatingStrokerDivZero()
window.create();
QOpenGLContext ctx;
- ctx.create();
- ctx.makeCurrent(&window);
+ QVERIFY(ctx.create());
+ QVERIFY(ctx.makeCurrent(&window));
if (!QOpenGLFramebufferObject::hasOpenGLFramebufferObjects())
QSKIP("QOpenGLFramebufferObject not supported on this platform");