summaryrefslogtreecommitdiffstats
path: root/tests/auto/qimagereader/tst_qimagereader.cpp
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-06-10 22:40:02 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-06-10 22:40:02 (GMT)
commitd911206aed44fa3839132d2bf62b2ba21bd93a72 (patch)
tree025e7c3498fe770ea557dd2fdc9d905bb9f0d5bb /tests/auto/qimagereader/tst_qimagereader.cpp
parentdf4763878d756fe1f5bcfe6b7dd8cf91cdd091e1 (diff)
parent9ba808cf3fa6118822b7fc9ed9f8f2d0ce2218c3 (diff)
downloadQt-d911206aed44fa3839132d2bf62b2ba21bd93a72.zip
Qt-d911206aed44fa3839132d2bf62b2ba21bd93a72.tar.gz
Qt-d911206aed44fa3839132d2bf62b2ba21bd93a72.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'tests/auto/qimagereader/tst_qimagereader.cpp')
-rw-r--r--tests/auto/qimagereader/tst_qimagereader.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp
index f5313eb..0b32f0a 100644
--- a/tests/auto/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/qimagereader/tst_qimagereader.cpp
@@ -156,6 +156,9 @@ private slots:
void pixelCompareWithBaseline_data();
void pixelCompareWithBaseline();
+
+ void task255627_setNullScaledSize_data();
+ void task255627_setNullScaledSize();
};
static const QLatin1String prefix(SRCDIR "/images/");
@@ -333,6 +336,29 @@ void tst_QImageReader::setScaledSize()
QCOMPARE(image.size(), newSize);
}
+void tst_QImageReader::task255627_setNullScaledSize_data()
+{
+ setScaledSize_data();
+}
+
+void tst_QImageReader::task255627_setNullScaledSize()
+{
+ QFETCH(QString, fileName);
+ QFETCH(QByteArray, format);
+
+ if (!format.isEmpty() && !QImageReader::supportedImageFormats().contains(format))
+ QSKIP("Qt does not support reading the \"" + format + "\" format", SkipSingle);
+
+ QImageReader reader(prefix + fileName);
+
+ // set a null size
+ reader.setScaledSize(QSize(0, 0));
+ reader.setQuality(0);
+ QImage image = reader.read();
+ QVERIFY(image.isNull());
+ QCOMPARE(image.size(), QSize(0, 0));
+}
+
void tst_QImageReader::setClipRect_data()
{
QTest::addColumn<QString>("fileName");