diff options
Diffstat (limited to 'tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp')
-rw-r--r-- | tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp b/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp index 58dee6f6ca..8ffd1bb9b4 100644 --- a/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp +++ b/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp @@ -62,7 +62,7 @@ void tst_QOpenGLWindow::create() w.resize(640, 480); w.show(); - QTest::qWaitForWindowExposed(&w); + QVERIFY(QTest::qWaitForWindowExposed(&w)); QVERIFY(w.isValid()); } @@ -74,17 +74,17 @@ public: initCount = resizeCount = paintCount = 0; } - void initializeGL() Q_DECL_OVERRIDE { + void initializeGL() override { ++initCount; } - void resizeGL(int w, int h) Q_DECL_OVERRIDE { + void resizeGL(int w, int h) override { ++resizeCount; QCOMPARE(w, size().width()); QCOMPARE(h, size().height()); } - void paintGL() Q_DECL_OVERRIDE { + void paintGL() override { ++paintCount; QOpenGLContext *ctx = QOpenGLContext::currentContext(); @@ -111,7 +111,7 @@ void tst_QOpenGLWindow::basic() w.reset(); w.resize(640, 480); w.show(); - QTest::qWaitForWindowExposed(&w); + QVERIFY(QTest::qWaitForWindowExposed(&w)); // Check that the virtuals are invoked. QCOMPARE(w.initCount, 1); @@ -144,7 +144,7 @@ void tst_QOpenGLWindow::basic() class PainterWindow : public QOpenGLWindow { public: - void paintGL() Q_DECL_OVERRIDE { + void paintGL() override { QOpenGLContext *ctx = QOpenGLContext::currentContext(); QVERIFY(ctx); QCOMPARE(ctx, context()); @@ -170,7 +170,7 @@ void tst_QOpenGLWindow::painter() PainterWindow w; w.resize(400, 400); w.show(); - QTest::qWaitForWindowExposed(&w); + QVERIFY(QTest::qWaitForWindowExposed(&w)); QCOMPARE(w.img.size(), w.size() * w.devicePixelRatio()); QVERIFY(w.img.pixel(QPoint(5, 5) * w.devicePixelRatio()) == qRgb(0, 0, 255)); @@ -183,7 +183,7 @@ public: PartialPainterWindow(QOpenGLWindow::UpdateBehavior u) : QOpenGLWindow(u), x(0) { } - void paintGL() Q_DECL_OVERRIDE { + void paintGL() override { ++paintCount; QPainter p(this); @@ -212,7 +212,7 @@ void tst_QOpenGLWindow::partial() PartialPainterWindow w(u); w.resize(800, 400); w.show(); - QTest::qWaitForWindowExposed(&w); + QVERIFY(QTest::qWaitForWindowExposed(&w)); // Add a couple of small blue rects. for (int i = 0; i < 10; ++i) { @@ -244,7 +244,7 @@ public: Error } m_state; - void paintUnderGL() Q_DECL_OVERRIDE { + void paintUnderGL() override { if (m_state == None || m_state == PaintOver) m_state = PaintUnder; else @@ -252,10 +252,10 @@ public: GLuint fbo = 0xFFFF; QOpenGLContext::currentContext()->functions()->glGetIntegerv(GL_FRAMEBUFFER_BINDING, (GLint *) &fbo); - QCOMPARE(fbo, GLuint(0)); + QCOMPARE(fbo, QOpenGLContext::currentContext()->defaultFramebufferObject()); } - void paintGL() Q_DECL_OVERRIDE { + void paintGL() override { if (m_state == PaintUnder) m_state = Paint; else @@ -264,11 +264,11 @@ public: // Using PartialUpdateBlend so paintGL() targets a user fbo, not the default. GLuint fbo = 0xFFFF; QOpenGLContext::currentContext()->functions()->glGetIntegerv(GL_FRAMEBUFFER_BINDING, (GLint *) &fbo); - QVERIFY(fbo != 0); + QVERIFY(fbo != QOpenGLContext::currentContext()->defaultFramebufferObject()); QCOMPARE(fbo, defaultFramebufferObject()); } - void paintOverGL() Q_DECL_OVERRIDE { + void paintOverGL() override { if (m_state == Paint) m_state = PaintOver; else @@ -276,7 +276,7 @@ public: GLuint fbo = 0xFFFF; QOpenGLContext::currentContext()->functions()->glGetIntegerv(GL_FRAMEBUFFER_BINDING, (GLint *) &fbo); - QCOMPARE(fbo, GLuint(0)); + QCOMPARE(fbo, QOpenGLContext::currentContext()->defaultFramebufferObject()); } }; @@ -285,7 +285,7 @@ void tst_QOpenGLWindow::underOver() PaintUnderOverWindow w; w.resize(400, 400); w.show(); - QTest::qWaitForWindowExposed(&w); + QVERIFY(QTest::qWaitForWindowExposed(&w)); // under -> paint -> over -> under -> paint -> ... is the only acceptable sequence QCOMPARE(w.m_state, PaintUnderOverWindow::PaintOver); |