summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSarah Smith <sarah.j.smith@nokia.com>2011-11-14 03:51:50 (GMT)
committerSarah Smith <sarah.j.smith@nokia.com>2011-11-14 04:11:06 (GMT)
commitb8cc85402bf0992657ed527996532d6020ac9acb (patch)
tree2f7706469c0df1bc0384ff3bba5ff2afe8390d70 /tests
parent951a997893407b0a26f21fe0acec4701fa3d4279 (diff)
downloadQt-b8cc85402bf0992657ed527996532d6020ac9acb.zip
Qt-b8cc85402bf0992657ed527996532d6020ac9acb.tar.gz
Qt-b8cc85402bf0992657ed527996532d6020ac9acb.tar.bz2
Move tga support from Qt3d to Qt.
Rev-By: Samuel Rodal Fix-for: QTBUG-21955 Part of fix for https://bugreports.qt.nokia.com/browse/QTBUG-21955 Having tga plugin inside a Qt add-on causes packaging problems. There have been many queries over the years for tga support even tho it is a niche image format. It is particularly useful for OpenGL work as a texture format since it is a blittable bitmap, but it is very innefficient compared to png or jpg. For this reason only read support is added, and this is documented. Also add some unit tests. The unit tests are in the qimagereader suite, and this is the right place for them as the other formats are tested there. Noticed that there was an annoying bug with tiff files and chased it down, in the hope of getting a clean test case PASS. Looks as tho there is a bit of work for someone to fix the other FAILs, but the ones for tga are all passing.
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qimagereader/tst_qimagereader.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp
index 5bf9d19..2b867c3 100644
--- a/tests/auto/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/qimagereader/tst_qimagereader.cpp
@@ -590,17 +590,17 @@ void tst_QImageReader::imageFormat()
#ifndef QTEST_HAVE_JPEG
return;
#endif // !QTEST_HAVE_JPEG
- }
+ }
if (QByteArray("gif") == format) {
#ifndef QTEST_HAVE_GIF
return;
#endif // !QTEST_HAVE_GIF
- }
+ }
if (QByteArray("mng") == format) {
#ifndef QTEST_HAVE_MNG
return;
#endif // !QTEST_HAVE_MNG
- }
+ }
if (QByteArray("svg") == format || QByteArray("svgz") == format) {
#ifndef QTEST_HAVE_SVG
return;
@@ -1736,8 +1736,8 @@ void tst_QImageReader::tiffGrayscale()
#if defined QTEST_HAVE_TGA
void tst_QImageReader::tgaTestImages()
{
- QImage tgaTest(prefix + "test-flag.tga");
-
+ QImage tgaTest(prefix + "test-flag.tga");
+
// Test image is 400x400 of a "flag" with a blue circle in the middle
// and a green square top left, and red rectangle on the bottom so
// so we test for pixels in those areas to ensure the image is not
@@ -1745,8 +1745,8 @@ void tst_QImageReader::tgaTestImages()
QVERIFY(!tgaTest.isNull());
QCOMPARE(tgaTest.size().width(), 400);
QCOMPARE(tgaTest.size().height(), 400);
- QRgb pixel = tgaTest.pixel(200,200);
- QCOMPARE(qRgb(0, 0, 255), pixel);
+ QRgb pixel = tgaTest.pixel(200,200);
+ QCOMPARE(qRgb(0, 0, 255), pixel);
pixel = tgaTest.pixel(0, 0);
QCOMPARE(qRgb(0, 255, 0), pixel);
pixel = tgaTest.pixel(0, 399);