summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgl/tst_qgl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qgl/tst_qgl.cpp')
-rw-r--r--tests/auto/qgl/tst_qgl.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp
index 7f9ee04..d99ab50 100644
--- a/tests/auto/qgl/tst_qgl.cpp
+++ b/tests/auto/qgl/tst_qgl.cpp
@@ -97,6 +97,7 @@ private slots:
void qglContextDefaultBindTexture();
void textureCleanup();
void threadImages();
+ void nullRectCrash();
};
tst_QGL::tst_QGL()
@@ -2367,6 +2368,28 @@ void tst_QGL::threadImages()
delete widget;
}
+void tst_QGL::nullRectCrash()
+{
+ if (!QGLFramebufferObject::hasOpenGLFramebufferObjects())
+ QSKIP("QGLFramebufferObject not supported on this platform", SkipSingle);
+
+ QGLWidget glw;
+ glw.makeCurrent();
+
+ QGLFramebufferObjectFormat fboFormat;
+ fboFormat.setAttachment(QGLFramebufferObject::CombinedDepthStencil);
+
+ QGLFramebufferObject *fbo = new QGLFramebufferObject(128, 128, fboFormat);
+
+ QPainter fboPainter(fbo);
+
+ fboPainter.setPen(QPen(QColor(255, 127, 127, 127), 2));
+ fboPainter.setBrush(QColor(127, 255, 127, 127));
+ fboPainter.drawRect(QRectF());
+
+ fboPainter.end();
+}
+
class tst_QGLDummy : public QObject
{
Q_OBJECT