aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2017-05-06 22:32:57 +0200
committerMitch Curtis <mitch.curtis@qt.io>2017-05-15 07:19:19 +0000
commite6acf80136db9f667d0d4664f6c68065355d6811 (patch)
tree1d39105ae37b3299058529b493108cf402e5033f /tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
parentdefa2512a9128449e30d3b2c2fc42eaab201418b (diff)
QQuickWindow::createTextureFromImage(): return nullptr for null images
Change-Id: Idf3315be104e058315d82893443e1c27d1d79f2e Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'tests/auto/quick/qquickwindow/tst_qquickwindow.cpp')
-rw-r--r--tests/auto/quick/qquickwindow/tst_qquickwindow.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
index 1d6547c5be..639027d668 100644
--- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
+++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
@@ -375,6 +375,8 @@ private slots:
void testDragEventPropertyPropagation();
+ void createTextureFromImage();
+
private:
QTouchDevice *touchDevice;
QTouchDevice *touchDeviceWithVelocity;
@@ -2831,6 +2833,15 @@ void tst_qquickwindow::testDragEventPropertyPropagation()
}
}
+void tst_qquickwindow::createTextureFromImage()
+{
+ // An invalid image should return a null pointer.
+ QQuickWindow window;
+ window.show();
+ QTest::qWaitForWindowExposed(&window);
+ QVERIFY(!window.createTextureFromImage(QImage()));
+}
+
QTEST_MAIN(tst_qquickwindow)
#include "tst_qquickwindow.moc"