summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2009-10-11 02:12:47 (GMT)
committerAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-12-23 12:27:47 (GMT)
commit6d9d6bf4b66127f7f24d22efa2fe6c24d05b3724 (patch)
tree08db6394ec68b3717a30a33ccc19f3f33fad70f0 /tests
parentb7d95c36f432f65d54343bf51e39e0b8b1d2d656 (diff)
downloadQt-6d9d6bf4b66127f7f24d22efa2fe6c24d05b3724.zip
Qt-6d9d6bf4b66127f7f24d22efa2fe6c24d05b3724.tar.gz
Qt-6d9d6bf4b66127f7f24d22efa2fe6c24d05b3724.tar.bz2
images: Document QImageReader::loopCount behaviour for infinite loops
The gif and mng reader will return -1 as QImageReader::loopCount() for infinite images. Document that this -1 is clashing with the error handling of this method. The documentation was mixing the default and error cases. In some cases "Otherwise -1" and "Otherwise 0" was used. Change this to mention the default coming from QImageIOHandler in the "Otherwise" clause and document the error case with -1. Add a test case to check that loopCount() returns -1 for infinite animations. Reviewed-by: Andreas
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qimagereader/images/endless-anim.gifbin0 -> 819 bytes
-rw-r--r--tests/auto/qimagereader/tst_qimagereader.cpp7
2 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/qimagereader/images/endless-anim.gif b/tests/auto/qimagereader/images/endless-anim.gif
new file mode 100644
index 0000000..00df8da
--- /dev/null
+++ b/tests/auto/qimagereader/images/endless-anim.gif
Binary files differ
diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp
index 3f9d005..8cfaac5 100644
--- a/tests/auto/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/qimagereader/tst_qimagereader.cpp
@@ -726,6 +726,13 @@ void tst_QImageReader::gifHandlerBugs()
QVERIFY(!im1.isNull()); QVERIFY(!im2.isNull());
QCOMPARE(im1.convertToFormat(QImage::Format_ARGB32), im2.convertToFormat(QImage::Format_ARGB32));
}
+
+ // Check the undocumented feature.
+ {
+ QImageReader io(prefix + "endless-anim.gif");
+ QVERIFY(io.canRead());
+ QCOMPARE(io.loopCount(), -1);
+ }
}
void tst_QImageReader::animatedGif()