summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-09-07 09:50:03 +0200
committerPaul Olav Tvete <paul.tvete@nokia.com>2011-09-08 10:48:48 +0200
commit68974d8e647febb80a47d9cf6ce9452f3ce4fa21 (patch)
tree3eda1f082edf9286461af012c6fc7202844b6bf3 /tests
parent65f492442528c057471c46e141c8b70da9b021ec (diff)
Added equivalent to tst_QGL::destroyFBOAfterContext() in tst_QOpenGL.
The more the merrier. Change-Id: I401ed97600a890c38cb4d5dbe0578d6bcf68e909 Reviewed-on: http://codereview.qt-project.org/4322 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qopengl/tst_qopengl.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/qopengl/tst_qopengl.cpp b/tests/auto/qopengl/tst_qopengl.cpp
index 173d1e4568..353391c543 100644
--- a/tests/auto/qopengl/tst_qopengl.cpp
+++ b/tests/auto/qopengl/tst_qopengl.cpp
@@ -53,6 +53,7 @@ private slots:
void sharedResourceCleanup();
void fboSimpleRendering();
void fboRendering();
+ void fboHandleNulledAfterContextDestroyed();
};
struct SharedResourceTracker
@@ -358,5 +359,31 @@ void tst_QOpenGL::fboRendering()
qt_opengl_check_test_pattern(fb);
}
+void tst_QOpenGL::fboHandleNulledAfterContextDestroyed()
+{
+ QWindow window;
+ window.setGeometry(0, 0, 10, 10);
+ window.create();
+
+ QOpenGLFramebufferObject *fbo = 0;
+
+ {
+ QOpenGLContext ctx;
+ ctx.create();
+
+ ctx.makeCurrent(&window);
+
+ if (!QOpenGLFramebufferObject::hasOpenGLFramebufferObjects()) {
+ QSKIP("QOpenGLFramebufferObject not supported on this platform", SkipSingle);
+ }
+
+ fbo = new QOpenGLFramebufferObject(128, 128);
+
+ QVERIFY(fbo->handle() != 0);
+ }
+
+ QCOMPARE(fbo->handle(), 0U);
+}
+
QTEST_MAIN(tst_QOpenGL)
#include "tst_qopengl.moc"