diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-10-28 09:03:39 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-10-28 09:03:39 (GMT) |
commit | 5f444e7a1dd7f22b5546f5225e12355ec5cc4d57 (patch) | |
tree | e90e3d59dfccc347691c7a62aa69fa01b1a94743 /tests/auto/qpixmap/tst_qpixmap.cpp | |
parent | a8b5aefc48d619c1fc0ff1e97c8e3a42baccb7c0 (diff) | |
parent | 1583d643285641bf71e6a107331d788acca9850c (diff) | |
download | Qt-5f444e7a1dd7f22b5546f5225e12355ec5cc4d57.zip Qt-5f444e7a1dd7f22b5546f5225e12355ec5cc4d57.tar.gz Qt-5f444e7a1dd7f22b5546f5225e12355ec5cc4d57.tar.bz2 |
Merge remote branch 'origin/4.6' into core-4.6
Diffstat (limited to 'tests/auto/qpixmap/tst_qpixmap.cpp')
-rw-r--r-- | tests/auto/qpixmap/tst_qpixmap.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp index 9f5aee2..53b6230 100644 --- a/tests/auto/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/qpixmap/tst_qpixmap.cpp @@ -166,6 +166,7 @@ private slots: void fromImage_crash(); void fromData(); + void loadFromDataNullValues(); void preserveDepth(); }; @@ -1436,6 +1437,26 @@ void tst_QPixmap::fromData() QCOMPARE(img.pixel(0, 1), QRgb(0xff000000)); } +void tst_QPixmap::loadFromDataNullValues() +{ + { + QPixmap pixmap; + pixmap.loadFromData(QByteArray()); + QVERIFY(pixmap.isNull()); + } + { + QPixmap pixmap; + pixmap.loadFromData(0, 123); + QVERIFY(pixmap.isNull()); + } + { + QPixmap pixmap; + const uchar bla[] = "bla"; + pixmap.loadFromData(bla, 0); + QVERIFY(pixmap.isNull()); + } +} + void tst_QPixmap::task_246446() { // This crashed without the bugfix in 246446 |