summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/qopengl/tst_qopengl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/gui/qopengl/tst_qopengl.cpp')
-rw-r--r--tests/auto/gui/qopengl/tst_qopengl.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/gui/qopengl/tst_qopengl.cpp b/tests/auto/gui/qopengl/tst_qopengl.cpp
index 6d83defdeb..a5100a57bf 100644
--- a/tests/auto/gui/qopengl/tst_qopengl.cpp
+++ b/tests/auto/gui/qopengl/tst_qopengl.cpp
@@ -102,6 +102,7 @@ private slots:
void textureblitterPartOriginTopLeftSourceRectTransform();
void textureblitterFullTargetRectTransform();
void textureblitterPartTargetRectTransform();
+ void defaultSurfaceFormat();
#ifdef USE_GLX
void glxContextWrap();
@@ -1110,6 +1111,23 @@ void tst_QOpenGL::textureblitterPartTargetRectTransform()
QCOMPARE(targetBottomRight, expectedBottomRight);
}
+void tst_QOpenGL::defaultSurfaceFormat()
+{
+ QSurfaceFormat fmt;
+ QVERIFY(QSurfaceFormat::defaultFormat() == fmt);
+
+ fmt.setDepthBufferSize(16);
+ QSurfaceFormat::setDefaultFormat(fmt);
+ QVERIFY(QSurfaceFormat::defaultFormat() == fmt);
+ QCOMPARE(QSurfaceFormat::defaultFormat().depthBufferSize(), 16);
+
+ QScopedPointer<QWindow> window(new QWindow);
+ QVERIFY(window->requestedFormat() == fmt);
+
+ QScopedPointer<QOpenGLContext> context(new QOpenGLContext);
+ QVERIFY(context->format() == fmt);
+}
+
#ifdef USE_GLX
void tst_QOpenGL::glxContextWrap()
{