From ef9c498215f0eeb73d1ffdcd0d58464c56ea56ac Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 21 Oct 2019 14:48:50 +0200 Subject: 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 --- .../tst_qdatastream_core_pixmap.cpp | 21 ++++++++++----------- 1 file 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 -#include -#include #include -#include -#include -#include -#include +#include 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()); // 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()); QCOMPARE(map["z"].toString(), QString("there")); } QTEST_GUILESS_MAIN(tst_QDataStream) #include "tst_qdatastream_core_pixmap.moc" - -- cgit v1.2.3