diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-01-26 09:25:15 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-01-29 11:10:49 +0000 |
commit | c1c7a952bc11d3bd9edcd3739c57df15b60a9e79 (patch) | |
tree | ecd1ad0087f973e0eba66e5392db48d00e478036 /tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp | |
parent | cf6e97119df5bf17b4a952b257d05d43b7d6ca26 (diff) |
Verify context creation in Quick tests.
Verify initialization steps and initialize pointers to avoid
crashes.
Change-Id: I2d3a53c6719727aed56e673d0d8cf5a02ae0f0f6
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp')
-rw-r--r-- | tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp b/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp index eb720e5109..d46258889f 100644 --- a/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp +++ b/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp @@ -62,6 +62,7 @@ public: } private slots: + void initTestCase() Q_DECL_OVERRIDE; void layerEnabled(); void layerSmooth(); void layerMipmap(); @@ -92,14 +93,20 @@ private: }; tst_QQuickItemLayer::tst_QQuickItemLayer() - : m_mesaVersion(0) + : m_isMesaSoftwareRasterizer(false) + , m_mesaVersion(0) { +} + +void tst_QQuickItemLayer::initTestCase() +{ + QQmlDataTest::initTestCase(); QWindow window; QOpenGLContext context; window.setSurfaceType(QWindow::OpenGLSurface); window.create(); - context.create(); - context.makeCurrent(&window); + QVERIFY(context.create()); + QVERIFY(context.makeCurrent(&window)); const char *vendor = (const char *)context.functions()->glGetString(GL_VENDOR); const char *renderer = (const char *)context.functions()->glGetString(GL_RENDERER); m_isMesaSoftwareRasterizer = strcmp(vendor, "Mesa Project") == 0 |