diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2010-08-19 12:46:10 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2010-08-19 12:46:10 (GMT) |
commit | da005580969b2501a246027f47f75ed3ee52670e (patch) | |
tree | 2d937165e65e2ed7367c12c76ef32ca76f9aae44 /tests | |
parent | f30adf43b9331dbf0bb3768fb7694af5bce66c4a (diff) | |
download | Qt-da005580969b2501a246027f47f75ed3ee52670e.zip Qt-da005580969b2501a246027f47f75ed3ee52670e.tar.gz Qt-da005580969b2501a246027f47f75ed3ee52670e.tar.bz2 |
Fixes a regression preventing loading images without extensions
Task-number: QTBUG-12560
Reviewed-by: gabi
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qpixmap/tst_qpixmap.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp index f22edf6..e461b64 100644 --- a/tests/auto/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/qpixmap/tst_qpixmap.cpp @@ -1673,31 +1673,39 @@ void tst_QPixmap::preserveDepth() void tst_QPixmap::loadAsBitmapOrPixmap() { QImage tmp(10, 10, QImage::Format_RGB32); - tmp.save("tmp.png"); + tmp.save("temp_image.png"); bool ok; // Check that we can load the pixmap as a pixmap and that it then turns into a pixmap - QPixmap pixmap("tmp.png"); + QPixmap pixmap("temp_image.png"); QVERIFY(!pixmap.isNull()); QVERIFY(pixmap.depth() > 1); QVERIFY(!pixmap.isQBitmap()); pixmap = QPixmap(); - ok = pixmap.load("tmp.png"); + ok = pixmap.load("temp_image.png"); + QVERIFY(ok); + QVERIFY(!pixmap.isNull()); + QVERIFY(pixmap.depth() > 1); + QVERIFY(!pixmap.isQBitmap()); + + //now we can try to load it without an extension + pixmap = QPixmap(); + ok = pixmap.load("temp_image"); QVERIFY(ok); QVERIFY(!pixmap.isNull()); QVERIFY(pixmap.depth() > 1); QVERIFY(!pixmap.isQBitmap()); // The do the same check for bitmaps.. - QBitmap bitmap("tmp.png"); + QBitmap bitmap("temp_image.png"); QVERIFY(!bitmap.isNull()); QVERIFY(bitmap.depth() == 1); QVERIFY(bitmap.isQBitmap()); bitmap = QBitmap(); - ok = bitmap.load("tmp.png"); + ok = bitmap.load("temp_image.png"); QVERIFY(ok); QVERIFY(!bitmap.isNull()); QVERIFY(bitmap.depth() == 1); |