diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-09-28 19:12:58 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-09-28 19:12:58 (GMT) |
commit | d3838fdda64a09fe6fc5c9054f460ce43fdc6f95 (patch) | |
tree | 70662556aa8fb1ba06673cb8c2aff71fb9a0b4c2 /tests | |
parent | 8b533a7564c634e6e7228c5e02832d55513777b5 (diff) | |
parent | 6368ca1c36488d1297c768a5fae52f65bb5b91be (diff) | |
download | Qt-d3838fdda64a09fe6fc5c9054f460ce43fdc6f95.zip Qt-d3838fdda64a09fe6fc5c9054f460ce43fdc6f95.tar.gz Qt-d3838fdda64a09fe6fc5c9054f460ce43fdc6f95.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2:
Fixed potential crash when loading corrupt GIFs.
Work around an ATI driver problem with mutli-sampled pbuffers.
tst_qstatemachine.cpp: fix compilation with Sun Studio
Fixed regression in clipping.qps autotest on 64-bit.
Fixed crash when using Qt::WA_DeleteOnClose on a QPrintDialog on Mac.
Fixed performance regression in curve stroking.
Don't disable texture_from_pixmap on GLX/X11 by default.
Avoid creating copy of an image in memory when storing as png
Doc update for the support of MSVC 2010 64-bit
fix documentation of drawText(int, int, int, int, ...
Optimization of pixel conversion when storing jpeg
Don't pretend to support single buffered EGL surfaces.
Named anonymous struct in the OpenGL paint engine.
Fixes gray_raster incorrectly reporting out of memory error.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qimagereader/tst_qimagereader.cpp | 43 | ||||
-rw-r--r-- | tests/auto/qstatemachine/tst_qstatemachine.cpp | 2 |
2 files changed, 44 insertions, 1 deletions
diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp index 3bee5d9..4b4bdd6 100644 --- a/tests/auto/qimagereader/tst_qimagereader.cpp +++ b/tests/auto/qimagereader/tst_qimagereader.cpp @@ -178,6 +178,8 @@ private slots: void testIgnoresFormatAndExtension_data(); void testIgnoresFormatAndExtension(); + void saveFormat_data(); + void saveFormat(); }; static const QLatin1String prefix(SRCDIR "/images/"); @@ -1905,5 +1907,46 @@ void tst_QImageReader::testIgnoresFormatAndExtension() } } + +void tst_QImageReader::saveFormat_data() +{ + QTest::addColumn<QImage::Format>("format"); + + QTest::newRow("Format_Mono") << QImage::Format_Mono; + QTest::newRow("Format_MonoLSB") << QImage::Format_MonoLSB; + QTest::newRow("Format_Indexed8") << QImage::Format_Indexed8; + QTest::newRow("Format_RGB32") << QImage::Format_RGB32; + QTest::newRow("Format_ARGB32") << QImage::Format_ARGB32; + QTest::newRow("Format_ARGB32_Premultiplied") << QImage::Format_ARGB32_Premultiplied; + QTest::newRow("Format_RGB16") << QImage::Format_RGB16; + QTest::newRow("Format_ARGB8565_Premultiplied") << QImage::Format_ARGB8565_Premultiplied; + QTest::newRow("Format_RGB666") << QImage::Format_RGB666; + QTest::newRow("Format_ARGB6666_Premultiplied") << QImage::Format_ARGB6666_Premultiplied; + QTest::newRow("Format_RGB555") << QImage::Format_RGB555; + QTest::newRow("Format_ARGB8555_Premultiplied") << QImage::Format_ARGB8555_Premultiplied; + QTest::newRow("Format_RGB888") << QImage::Format_RGB888; + QTest::newRow("Format_RGB444") << QImage::Format_RGB444; + QTest::newRow("Format_ARGB4444_Premultiplied") << QImage::Format_ARGB4444_Premultiplied; +} + +void tst_QImageReader::saveFormat() +{ + QFETCH(QImage::Format, format); + + QImage orig(":/images/kollada.png"); + + QImage converted = orig.convertToFormat(format); + QBuffer buf; + buf.open(QIODevice::WriteOnly); + QVERIFY(converted.save(&buf, "png")); + buf.close(); + QImage stored = QImage::fromData(buf.buffer(), "png"); + + stored = stored.convertToFormat(QImage::Format_ARGB32); + converted = converted.convertToFormat(QImage::Format_ARGB32); + QCOMPARE(stored, converted); +} + + QTEST_MAIN(tst_QImageReader) #include "tst_qimagereader.moc" diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp index 2bf76e7..f6aee88 100644 --- a/tests/auto/qstatemachine/tst_qstatemachine.cpp +++ b/tests/auto/qstatemachine/tst_qstatemachine.cpp @@ -1112,7 +1112,7 @@ void tst_QStateMachine::machineWithParent() QObject object; QStateMachine *machine = new QStateMachine(&object); QCOMPARE(machine->parent(), &object); - QCOMPARE(machine->parentState(), (QObject*)0); + QCOMPARE(machine->parentState(), static_cast<QState*>(0)); } void tst_QStateMachine::addAndRemoveState() |