summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2019-10-21 14:48:50 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2019-10-25 11:44:13 +0200
commitef9c498215f0eeb73d1ffdcd0d58464c56ea56ac (patch)
treebb108c84089c3db0850dea978992665d9054881b
parent59ca056a79eb48fa345d0c5b133ca1e6d28997af (diff)
Tidy up data-stream test
While I was looking into a bug related to problems building the test without GUI, I noticed a lot of spurious #include lines so tidied up a bit. Split some long lines, while I was about it. Change-Id: Id87eb6f612c6b174f8240dfe9c00e0929244fb6c Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
-rw-r--r--tests/auto/corelib/serialization/qdatastream_core_pixmap/tst_qdatastream_core_pixmap.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/tests/auto/corelib/serialization/qdatastream_core_pixmap/tst_qdatastream_core_pixmap.cpp b/tests/auto/corelib/serialization/qdatastream_core_pixmap/tst_qdatastream_core_pixmap.cpp
index c931016a61..cf5ead1220 100644
--- a/tests/auto/corelib/serialization/qdatastream_core_pixmap/tst_qdatastream_core_pixmap.cpp
+++ b/tests/auto/corelib/serialization/qdatastream_core_pixmap/tst_qdatastream_core_pixmap.cpp
@@ -27,13 +27,8 @@
****************************************************************************/
#include <QtTest/QtTest>
-#include <QtGui/QBitmap>
-#include <QtGui/QPalette>
#include <QtGui/QPixmap>
-#include <QtGui/QPicture>
-#include <QtGui/QTextLength>
-#include <QtGui/QPainter>
-#include <QtGui/QPen>
+#include <QtGui/QImage>
class tst_QDataStream : public QObject
{
@@ -41,16 +36,20 @@ Q_OBJECT
private slots:
void stream_with_pixmap();
-
};
void tst_QDataStream::stream_with_pixmap()
{
// This is a QVariantMap with a 3x3 red QPixmap and two strings inside
- const QByteArray ba = QByteArray::fromBase64("AAAAAwAAAAIAegAAAAoAAAAACgB0AGgAZQByAGUAAAACAHAAAABBAAAAAAGJUE5HDQoaCgAAAA1JSERSAAAAAwAAAAMIAgAAANlKIugAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAQSURBVAiZY/zPAAVMDJgsAB1bAQXZn5ieAAAAAElFTkSuQmCCAAAAAgBhAAAACgAAAAAKAGgAZQBsAGwAbw==");
+ const QByteArray ba = QByteArray::fromBase64(
+ "AAAAAwAAAAIAegAAAAoAAAAACgB0AGgAZQByAGUAAAACAHAAAABBAAAAAAGJUE5H"
+ "DQoaCgAAAA1JSERSAAAAAwAAAAMIAgAAANlKIugAAAAJcEhZcwAADsQAAA7EAZUr"
+ "DhsAAAAQSURBVAiZY/zPAAVMDJgsAB1bAQXZn5ieAAAAAElFTkSuQmCCAAAAAgBh"
+ "AAAACgAAAAAKAGgAZQBsAGwAbw==");
QImage dummy; // Needed to make sure qtGui is loaded
- QTest::ignoreMessage(QtWarningMsg, "QPixmap::fromImageInPlace: QPixmap cannot be created without a QGuiApplication");
+ QTest::ignoreMessage(QtWarningMsg, "QPixmap::fromImageInPlace: "
+ "QPixmap cannot be created without a QGuiApplication");
QVariantMap map;
QDataStream d(ba);
@@ -58,11 +57,11 @@ void tst_QDataStream::stream_with_pixmap()
d >> map;
QCOMPARE(map["a"].toString(), QString("hello"));
- QCOMPARE(map["p"].value<QPixmap>(), QPixmap()); // the pixmap is null because this is not a QGuiApplication
+ // The pixmap is null because this is not a QGuiApplication:
+ QCOMPARE(map["p"].value<QPixmap>(), QPixmap());
QCOMPARE(map["z"].toString(), QString("there"));
}
QTEST_GUILESS_MAIN(tst_QDataStream)
#include "tst_qdatastream_core_pixmap.moc"
-