diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2009-10-11 02:12:47 (GMT) |
---|---|---|
committer | Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com> | 2009-12-23 12:27:47 (GMT) |
commit | 6d9d6bf4b66127f7f24d22efa2fe6c24d05b3724 (patch) | |
tree | 08db6394ec68b3717a30a33ccc19f3f33fad70f0 /tests/auto | |
parent | b7d95c36f432f65d54343bf51e39e0b8b1d2d656 (diff) | |
download | Qt-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/auto')
-rw-r--r-- | tests/auto/qimagereader/images/endless-anim.gif | bin | 0 -> 819 bytes | |||
-rw-r--r-- | tests/auto/qimagereader/tst_qimagereader.cpp | 7 |
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 Binary files differnew file mode 100644 index 0000000..00df8da --- /dev/null +++ b/tests/auto/qimagereader/images/endless-anim.gif 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() |