summaryrefslogtreecommitdiffstats
path: root/tests/auto/qimagereader
diff options
context:
space:
mode:
authorJan-Arve Sæther <jan-arve.saether@nokia.com>2010-01-28 16:50:49 (GMT)
committerJan-Arve Sæther <jan-arve.saether@nokia.com>2010-01-28 16:50:49 (GMT)
commit1771526b2e13607f9e5e3cef15622f74349f4e48 (patch)
treea2b7019bd47d0b510df8d173e7679ab8613a7f3d /tests/auto/qimagereader
parentb383ff766764f4d0d9644ca06bfb049d62bdcf2f (diff)
downloadQt-1771526b2e13607f9e5e3cef15622f74349f4e48.zip
Qt-1771526b2e13607f9e5e3cef15622f74349f4e48.tar.gz
Qt-1771526b2e13607f9e5e3cef15622f74349f4e48.tar.bz2
Warn if the plugin seems to not exist instead of simply passing.
follow-up to 0585997b7dbe25ece9f60684171c16206d10d65f Task-number: related to QTBUG-7688 Reviewed-by: TRUSTME
Diffstat (limited to 'tests/auto/qimagereader')
-rw-r--r--tests/auto/qimagereader/tst_qimagereader.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp
index e7cfe68..b1a5d26 100644
--- a/tests/auto/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/qimagereader/tst_qimagereader.cpp
@@ -1641,10 +1641,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 +1664,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");
+ }
}
}