summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/image
diff options
context:
space:
mode:
authorSarah Smith <sarah.j.smith@nokia.com>2011-11-17 15:06:17 +1000
committerQt by Nokia <qt-info@nokia.com>2011-12-13 09:33:49 +0100
commit0786716ce57a06b7984b3a6934c64e35115c507e (patch)
tree107e819d0021bb52e894e0a8bf842cf01c27c6a5 /tests/auto/gui/image
parent1a5f5d0056288a4ebde4deadfe58ff9c59a15751 (diff)
Fix failing unit tests.
The test that was failing was the readFromDevice one - where the extension is not known. Looks as though image detection is required in a positive way, that is it is not enough to say I think I can read this file, and then fail if the format is "corrupt", you must be certain that the file was intended to be that format. In the case of TGA the original format has no magic byte header, and no consistent way to check if it really is a TGA file. With 2.0 the footer was added at the end, so that can be checked for confirming the file is TGA. However rejecting files which do not have this means that old TGA files will not be read. On a quick survey TGA files that have been used in applications so far all seem to be 2.0 TrueVision, so for now, lets just reject earlier files and see how it goes. Also add reading the tga test file to the readFromDevice test. (cherry picked from commit 665bc3951709f0d726cb82501a5bca684f3347a5) Change-Id: I665bc3951709f0d726cb82501a5bca684f3347a5 Reviewed-by: Sarah Jane Smith <sarah.j.smith@nokia.com>
Diffstat (limited to 'tests/auto/gui/image')
-rw-r--r--tests/auto/gui/image/qimagereader/tst_qimagereader.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
index d0bbc57632..4fa1bedcdc 100644
--- a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
@@ -1041,6 +1041,9 @@ void tst_QImageReader::readFromDevice_data()
QTest::newRow("svg") << QString("rect.svg") << QByteArray("svg");
QTest::newRow("svgz") << QString("rect.svgz") << QByteArray("svgz");
+#if defined QTEST_HAVE_TGA
+ QTest::newRow("tga") << QString("test-flag.tga") << QByteArray("tga");
+#endif
}
void tst_QImageReader::readFromDevice()