diff options
author | Samuel Rødal <sroedal@trolltech.com> | 2010-02-04 09:08:43 (GMT) |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2010-02-04 09:08:43 (GMT) |
commit | 47b7af3bfd78c6d4efd3ce93be275a60430679d2 (patch) | |
tree | e7d7ff32ae72008b74df37e13caf568b33ac19b5 /tests/auto/qimagereader | |
parent | 8e98033a67263f6a2d9155f228dc28e2faee4f5e (diff) | |
parent | 39523f9f78a7c93643924711b1ed8006ebfcf5ce (diff) | |
download | Qt-47b7af3bfd78c6d4efd3ce93be275a60430679d2.zip Qt-47b7af3bfd78c6d4efd3ce93be275a60430679d2.tar.gz Qt-47b7af3bfd78c6d4efd3ce93be275a60430679d2.tar.bz2 |
Merge remote branch 'staging/4.6' into 4.6
Manual resolve of conflict in changes-4.6.2 in staging-2.
Conflicts:
dist/changes-4.6.2
Diffstat (limited to 'tests/auto/qimagereader')
-rw-r--r-- | tests/auto/qimagereader/tst_qimagereader.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp index e7cfe68..debc090 100644 --- a/tests/auto/qimagereader/tst_qimagereader.cpp +++ b/tests/auto/qimagereader/tst_qimagereader.cpp @@ -765,6 +765,8 @@ void tst_QImageReader::gifImageCount() QVERIFY(io.canRead()); QImage greenFrame = io.read(); + QVERIFY(io.imageCount() == 4); + QVERIFY(io.canRead()); QImage blueFrame = io.read(); @@ -876,6 +878,10 @@ void tst_QImageReader::gifImageCount() QCOMPARE(blueFrame.size(), QSize(64,64)); QVERIFY(emptyFrame.isNull()); } + { + QImageReader io(":images/trolltech.gif"); + QVERIFY(io.imageCount() == 34); + } } #endif @@ -1641,10 +1647,16 @@ void tst_QImageReader::pixelCompareWithBaseline() { QFETCH(QString, fileName); + static int enteredCount = 0; // Used for better error diagnostics if something fails. We + static int loadFailCount = 0; // don't know if the reason load() fails is that the plugin + // does not exist or because of a bug in the plugin. But if at + // least one file succeeded we know that the plugin was built. + // The other failures are then real failures. QImage icoImg; const QString inputFileName(QString::fromAscii("images/%1").arg(fileName)); QFileInfo fi(inputFileName); + ++enteredCount; // might fail if the plugin does not exist, which is ok. if (icoImg.load(inputFileName)) { icoImg = icoImg.convertToFormat(QImage::Format_ARGB32_Premultiplied); @@ -1658,6 +1670,13 @@ void tst_QImageReader::pixelCompareWithBaseline() QCOMPARE(int(baseImg.format()), int(icoImg.format())); QCOMPARE(baseImg, icoImg); #endif + } else { + ++loadFailCount; + if (enteredCount != loadFailCount) { + QFAIL("Plugin is built, but some did not load properly"); + } else { + qWarning("loading failed, check if ico plugin is built"); + } } } |