summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-02-18 08:25:50 (GMT)
committerSamuel Rødal <samuel.rodal@nokia.com>2011-02-18 08:34:50 (GMT)
commitdb9925a187a9ad395ba2cabf23487b9a0e09c67c (patch)
tree068e19d6a0657c7e303c7fd854663b8ba19e6ca4 /tests
parent23f9cec65a76e6aa0675ca426f9e4f6717790dbb (diff)
downloadQt-db9925a187a9ad395ba2cabf23487b9a0e09c67c.zip
Qt-db9925a187a9ad395ba2cabf23487b9a0e09c67c.tar.gz
Qt-db9925a187a9ad395ba2cabf23487b9a0e09c67c.tar.bz2
Added test case for corrupt pixel count in XPM image.
Fixed by merge request 1080. Task-number: QTBUG-17254
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qimagereader/images/corrupt-pixel-count.xpm11
-rw-r--r--tests/auto/qimagereader/tst_qimagereader.cpp3
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/qimagereader/images/corrupt-pixel-count.xpm b/tests/auto/qimagereader/images/corrupt-pixel-count.xpm
new file mode 100644
index 0000000..3a736ff
--- /dev/null
+++ b/tests/auto/qimagereader/images/corrupt-pixel-count.xpm
@@ -0,0 +1,11 @@
+/* XPM */
+static const char *marble_xpm[] = {
+/* width height num_colors chars_per_pixel */
+"2 2 2 -2",
+/* colors */
+"a c #adadad",
+"b c #dedede",
+/* pixels */
+"ab",
+"ba"
+};
diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp
index 69e8ead..5321864 100644
--- a/tests/auto/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/qimagereader/tst_qimagereader.cpp
@@ -1399,6 +1399,9 @@ void tst_QImageReader::readFromResources_data()
QTest::newRow("corrupt-pixels.xpm") << QString("corrupt-pixels.xpm")
<< QByteArray("xpm") << QSize(0, 0)
<< QString("QImage: XPM pixels missing on image line 3");
+ QTest::newRow("corrupt-pixel-count.xpm") << QString("corrupt-pixel-count.xpm")
+ << QByteArray("xpm") << QSize(0, 0)
+ << QString("");
QTest::newRow("marble.xpm") << QString("marble.xpm")
<< QByteArray("xpm") << QSize(240, 240)
<< QString("");