summaryrefslogtreecommitdiffstats
path: root/tests/auto/qpixmap
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-08-31 17:34:10 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-08-31 17:34:10 (GMT)
commit0d411622521a89c04a416e2aaf3da44b6015b183 (patch)
tree51e61cea6b56b40d359a8914f59bf3297a5e0d3e /tests/auto/qpixmap
parent3b65bb32fda7e34373b64f416ea92a3fa6eb266c (diff)
parent20cc50a21eb5841b3a3e8546877e805f5a4df528 (diff)
downloadQt-0d411622521a89c04a416e2aaf3da44b6015b183.zip
Qt-0d411622521a89c04a416e2aaf3da44b6015b183.tar.gz
Qt-0d411622521a89c04a416e2aaf3da44b6015b183.tar.bz2
Merge branch '4.5' into 4.6
Diffstat (limited to 'tests/auto/qpixmap')
-rw-r--r--tests/auto/qpixmap/tst_qpixmap.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp
index 02ab1cc..7752a4f 100644
--- a/tests/auto/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/qpixmap/tst_qpixmap.cpp
@@ -95,6 +95,9 @@ private slots:
void fromImage_data();
void fromImage();
+ void fromUninitializedImage_data();
+ void fromUninitializedImage();
+
void convertFromImage_data();
void convertFromImage();
@@ -318,6 +321,32 @@ void tst_QPixmap::fromImage()
QCOMPARE(result, image);
}
+
+void tst_QPixmap::fromUninitializedImage_data()
+{
+ QTest::addColumn<QImage::Format>("format");
+
+ QTest::newRow("Format_Mono") << QImage::Format_Mono;
+ QTest::newRow("Format_MonoLSB") << QImage::Format_MonoLSB;
+ QTest::newRow("Format_Indexed8") << QImage::Format_Indexed8;
+ QTest::newRow("Format_RGB32") << QImage::Format_RGB32;
+ QTest::newRow("Format_ARGB32") << QImage::Format_ARGB32;
+ QTest::newRow("Format_ARGB32_Premultiplied") << QImage::Format_ARGB32_Premultiplied;
+ QTest::newRow("Format_RGB16") << QImage::Format_RGB16;
+}
+
+void tst_QPixmap::fromUninitializedImage()
+{
+ QFETCH(QImage::Format, format);
+
+ QImage image(100, 100, format);
+ QPixmap pix = QPixmap::fromImage(image);
+
+ // it simply shouldn't crash...
+ QVERIFY(true);
+
+}
+
void tst_QPixmap::convertFromImage_data()
{
QTest::addColumn<QImage>("img1");