diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2010-01-21 18:38:53 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2010-01-21 18:38:53 (GMT) |
commit | 8e65adce9ced8f3b1d42b938e4d65e1af4768c33 (patch) | |
tree | 042094137a842b98a41474ce99192b67a822820c /tests/auto/qpixmap | |
parent | 613be7cd75663ab8227de80d75d8f01e92c5c7d2 (diff) | |
parent | 2ae6b44e4242c60bd882661e104bb53fa6670556 (diff) | |
download | Qt-8e65adce9ced8f3b1d42b938e4d65e1af4768c33.zip Qt-8e65adce9ced8f3b1d42b938e4d65e1af4768c33.tar.gz Qt-8e65adce9ced8f3b1d42b938e4d65e1af4768c33.tar.bz2 |
Merge branch '4.6'
Conflicts:
tools/assistant/lib/qhelpsearchquerywidget.cpp
Diffstat (limited to 'tests/auto/qpixmap')
-rw-r--r-- | tests/auto/qpixmap/tst_qpixmap.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp index a1f20ca..d6bf900 100644 --- a/tests/auto/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/qpixmap/tst_qpixmap.cpp @@ -172,6 +172,8 @@ private slots: void preserveDepth(); void splash_crash(); + + void loadAsBitmapOrPixmap(); }; static bool lenientCompare(const QPixmap &actual, const QPixmap &expected) @@ -1529,5 +1531,41 @@ void tst_QPixmap::preserveDepth() QCOMPARE(depth, source.depth()); } +void tst_QPixmap::loadAsBitmapOrPixmap() +{ + QImage tmp(10, 10, QImage::Format_RGB32); + tmp.save("tmp.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"); + QVERIFY(!pixmap.isNull()); + QVERIFY(pixmap.depth() > 1); + QVERIFY(!pixmap.isQBitmap()); + + pixmap = QPixmap(); + ok = pixmap.load("tmp.png"); + QVERIFY(ok); + QVERIFY(!pixmap.isNull()); + QVERIFY(pixmap.depth() > 1); + QVERIFY(!pixmap.isQBitmap()); + + // The do the same check for bitmaps.. + QBitmap bitmap("tmp.png"); + QVERIFY(!bitmap.isNull()); + QVERIFY(bitmap.depth() == 1); + QVERIFY(bitmap.isQBitmap()); + + bitmap = QBitmap(); + ok = bitmap.load("tmp.png"); + QVERIFY(ok); + QVERIFY(!bitmap.isNull()); + QVERIFY(bitmap.depth() == 1); + QVERIFY(bitmap.isQBitmap()); +} + + + QTEST_MAIN(tst_QPixmap) #include "tst_qpixmap.moc" |