summaryrefslogtreecommitdiffstats
path: root/tests/auto/qpixmap
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-01-21 18:38:53 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-01-21 18:38:53 (GMT)
commit8e65adce9ced8f3b1d42b938e4d65e1af4768c33 (patch)
tree042094137a842b98a41474ce99192b67a822820c /tests/auto/qpixmap
parent613be7cd75663ab8227de80d75d8f01e92c5c7d2 (diff)
parent2ae6b44e4242c60bd882661e104bb53fa6670556 (diff)
downloadQt-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.cpp38
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"