summaryrefslogtreecommitdiffstats
path: root/tests/auto/qimagereader
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond@trolltech.com>2010-02-05 15:06:33 (GMT)
committerTrond Kjernåsen <trond@trolltech.com>2010-02-05 15:08:53 (GMT)
commit381f5ae82cccec3774b68674b4c0e782e9f49f6f (patch)
tree1e0da963652baff781eb81964d6c089c517b1161 /tests/auto/qimagereader
parentf8fa846bdcd961105674aba3666240b6ed166b04 (diff)
downloadQt-381f5ae82cccec3774b68674b4c0e782e9f49f6f.zip
Qt-381f5ae82cccec3774b68674b4c0e782e9f49f6f.tar.gz
Qt-381f5ae82cccec3774b68674b4c0e782e9f49f6f.tar.bz2
Fixed QGifHandler::loopCount().
Task-number: QTBUG-7037 Reviewed-by: Kim
Diffstat (limited to 'tests/auto/qimagereader')
-rw-r--r--tests/auto/qimagereader/images/qt-gif-anim.gifbin0 -> 1661 bytes
-rw-r--r--tests/auto/qimagereader/images/qt-gif-noanim.gifbin0 -> 1642 bytes
-rw-r--r--tests/auto/qimagereader/qimagereader.qrc4
-rw-r--r--tests/auto/qimagereader/tst_qimagereader.cpp14
4 files changed, 17 insertions, 1 deletions
diff --git a/tests/auto/qimagereader/images/qt-gif-anim.gif b/tests/auto/qimagereader/images/qt-gif-anim.gif
new file mode 100644
index 0000000..8bca4a8
--- /dev/null
+++ b/tests/auto/qimagereader/images/qt-gif-anim.gif
Binary files differ
diff --git a/tests/auto/qimagereader/images/qt-gif-noanim.gif b/tests/auto/qimagereader/images/qt-gif-noanim.gif
new file mode 100644
index 0000000..b6a8540
--- /dev/null
+++ b/tests/auto/qimagereader/images/qt-gif-noanim.gif
Binary files differ
diff --git a/tests/auto/qimagereader/qimagereader.qrc b/tests/auto/qimagereader/qimagereader.qrc
index 58f2f74..bc48244 100644
--- a/tests/auto/qimagereader/qimagereader.qrc
+++ b/tests/auto/qimagereader/qimagereader.qrc
@@ -1,5 +1,5 @@
<RCC>
- <qresource prefix="/" >
+ <qresource prefix="/">
<file>images/16bpp.bmp</file>
<file>images/4bpp-rle.bmp</file>
<file>images/YCbCr_cmyk.jpg</file>
@@ -59,5 +59,7 @@
<file>images/qt8.gif</file>
<file>images/endless-anim.gif</file>
<file>images/four-frames.gif</file>
+ <file>images/qt-gif-anim.gif</file>
+ <file>images/qt-gif-noanim.gif</file>
</qresource>
</RCC>
diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp
index 3e40527..121a8fa 100644
--- a/tests/auto/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/qimagereader/tst_qimagereader.cpp
@@ -142,6 +142,7 @@ private slots:
void gifHandlerBugs();
void animatedGif();
void gifImageCount();
+ void gifLoopCount();
#endif
void readCorruptImage_data();
@@ -884,6 +885,19 @@ void tst_QImageReader::gifImageCount()
QVERIFY(io.size() == QSize(128,64));
}
}
+
+void tst_QImageReader::gifLoopCount()
+{
+ {
+ QImageReader io(":images/qt-gif-anim.gif");
+ QCOMPARE(io.loopCount(), -1); // infinite loop
+ }
+ {
+ QImageReader io(":images/qt-gif-noanim.gif");
+ QCOMPARE(io.loopCount(), 0); // no loop
+ }
+}
+
#endif
class Server : public QObject