summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJuha Turunen <turunen@iki.fi>2015-12-08 00:51:54 -0800
committerJuha Turunen <juha.turunen@theqtcompany.com>2015-12-11 17:58:21 +0000
commit672f7dfdcd00d124cd0f973e04e3e2d6445d5483 (patch)
tree9d548532b7ee7a51f199cab03486873c11c41d84 /tests
parent6e14d63db023fdad223d9dc35b0e1ba31aac997d (diff)
Fix a crash when calling QOpenGLTexture::setData with a null QImage.
Change-Id: Idf8ae00cff6929114b38dcb003c259c83a11dbaa Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/gui/qopengl/tst_qopengl.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/auto/gui/qopengl/tst_qopengl.cpp b/tests/auto/gui/qopengl/tst_qopengl.cpp
index 8c6c28b492..3e66bcbf70 100644
--- a/tests/auto/gui/qopengl/tst_qopengl.cpp
+++ b/tests/auto/gui/qopengl/tst_qopengl.cpp
@@ -39,6 +39,7 @@
#include <QtGui/QOpenGLVertexArrayObject>
#include <QtGui/QOpenGLBuffer>
#include <QtGui/QOpenGLPaintDevice>
+#include <QtGui/QOpenGLTexture>
#include <QtGui/QPainter>
#include <QtGui/QScreen>
#include <QtGui/QWindow>
@@ -97,8 +98,8 @@ private slots:
void textureblitterFullTargetRectTransform();
void textureblitterPartTargetRectTransform();
void defaultSurfaceFormat();
-
void imageFormatPainting();
+ void nullTextureInitializtion();
#ifdef USE_GLX
void glxContextWrap();
@@ -1367,6 +1368,18 @@ void tst_QOpenGL::bufferMapRange()
ctx->doneCurrent();
}
+void tst_QOpenGL::nullTextureInitializtion()
+{
+ QScopedPointer<QSurface> surface(createSurface(QSurface::Window));
+ QOpenGLContext ctx;
+ ctx.create();
+ ctx.makeCurrent(surface.data());
+
+ QImage i;
+ QOpenGLTexture t(i);
+ QVERIFY(!t.isCreated());
+}
+
QTEST_MAIN(tst_QOpenGL)
#include "tst_qopengl.moc"