Fix failing unit tests.
authorSarah Smith <sarah.j.smith@nokia.com>
Thu, 17 Nov 2011 05:06:17 +0000 (15:06 +1000)
committerQt by Nokia <qt-info@nokia.com>
Tue, 13 Dec 2011 08:33:49 +0000 (09:33 +0100)
commit0786716ce57a06b7984b3a6934c64e35115c507e
tree107e819d0021bb52e894e0a8bf842cf01c27c6a5
parent1a5f5d0056288a4ebde4deadfe58ff9c59a15751
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>
tests/auto/gui/image/qimagereader/tst_qimagereader.cpp