diff options
Diffstat (limited to 'tests/auto/gui')
87 files changed, 446 insertions, 237 deletions
diff --git a/tests/auto/gui/image/qicoimageformat/qicoimageformat.pro b/tests/auto/gui/image/qicoimageformat/qicoimageformat.pro index 7ed69ce1d1..485472c70c 100644 --- a/tests/auto/gui/image/qicoimageformat/qicoimageformat.pro +++ b/tests/auto/gui/image/qicoimageformat/qicoimageformat.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qicoimageformat SOURCES+= tst_qicoimageformat.cpp QT += testlib diff --git a/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp b/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp index bff762fd04..ffe3dcfb75 100644 --- a/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp +++ b/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp @@ -141,7 +141,7 @@ void tst_QIcoImageFormat::canRead() QFETCH(QString, fileName); QFETCH(int, isValid); - QImageReader reader(m_IconPath + "/" + fileName); + QImageReader reader(m_IconPath + QLatin1Char('/') + fileName); QCOMPARE(reader.canRead(), (isValid == 0 ? false : true)); } @@ -175,7 +175,7 @@ void tst_QIcoImageFormat::SequentialFile() QFETCH(QString, fileName); QFETCH(int, isValid); - QSequentialFile *file = new QSequentialFile(m_IconPath + "/" + fileName); + QSequentialFile *file = new QSequentialFile(m_IconPath + QLatin1Char('/') + fileName); QVERIFY(file); QVERIFY(file->open(QFile::ReadOnly)); QImageReader reader(file); @@ -212,7 +212,7 @@ void tst_QIcoImageFormat::imageCount() QFETCH(QString, fileName); QFETCH(int, count); - QImageReader reader(m_IconPath + "/" + fileName); + QImageReader reader(m_IconPath + QLatin1Char('/') + fileName); QCOMPARE(reader.imageCount(), count); } @@ -240,7 +240,7 @@ void tst_QIcoImageFormat::jumpToNextImage() QFETCH(QString, fileName); QFETCH(int, count); - QImageReader reader(m_IconPath + "/" + fileName); + QImageReader reader(m_IconPath + QLatin1Char('/') + fileName); bool bJumped = reader.jumpToImage(0); while (bJumped) { count--; @@ -263,7 +263,7 @@ void tst_QIcoImageFormat::loopCount() QFETCH(QString, fileName); QFETCH(int, count); - QImageReader reader(m_IconPath + "/" + fileName); + QImageReader reader(m_IconPath + QLatin1Char('/') + fileName); QCOMPARE(reader.loopCount(), count); } @@ -291,7 +291,7 @@ void tst_QIcoImageFormat::nextImageDelay() QFETCH(QString, fileName); QFETCH(int, count); - QImageReader reader(m_IconPath + "/" + fileName); + QImageReader reader(m_IconPath + QLatin1Char('/') + fileName); if (count == -1) { QCOMPARE(reader.nextImageDelay(), 0); } else { @@ -320,7 +320,7 @@ void tst_QIcoImageFormat::pngCompression() QFETCH(int, width); QFETCH(int, height); - QImageReader reader(m_IconPath + "/" + fileName); + QImageReader reader(m_IconPath + QLatin1Char('/') + fileName); QImage image; reader.jumpToImage(index); diff --git a/tests/auto/gui/image/qicon/icons/themeparent/icon-theme.cache b/tests/auto/gui/image/qicon/icons/themeparent/icon-theme.cache Binary files differnew file mode 100644 index 0000000000..a323875989 --- /dev/null +++ b/tests/auto/gui/image/qicon/icons/themeparent/icon-theme.cache diff --git a/tests/auto/gui/image/qicon/qicon.pro b/tests/auto/gui/image/qicon/qicon.pro index 6ff20ec8fa..f5570c2497 100644 --- a/tests/auto/gui/image/qicon/qicon.pro +++ b/tests/auto/gui/image/qicon/qicon.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qicon QT += testlib diff --git a/tests/auto/gui/image/qicon/tst_qicon.cpp b/tests/auto/gui/image/qicon/tst_qicon.cpp index 9ed3873682..afa72f6922 100644 --- a/tests/auto/gui/image/qicon/tst_qicon.cpp +++ b/tests/auto/gui/image/qicon/tst_qicon.cpp @@ -63,6 +63,7 @@ private slots: void streamAvailableSizes_data(); void streamAvailableSizes(); void fromTheme(); + void fromThemeCache(); #ifndef QT_NO_WIDGETS void task184901_badCache(); @@ -633,6 +634,69 @@ void tst_QIcon::fromTheme() QVERIFY(abIcon.isNull()); } +void tst_QIcon::fromThemeCache() +{ + QTemporaryDir dir; + QVERIFY(QDir().mkpath(dir.path() + QLatin1String("/testcache/16x16/actions"))); + QVERIFY(QFile(QStringLiteral(":/styles/commonstyle/images/standardbutton-open-16.png")) + .copy( dir.path() + QLatin1String("/testcache/16x16/actions/button-open.png"))); + + { + QFile index(dir.path() + QLatin1String("/testcache/index.theme")); + QVERIFY(index.open(QFile::WriteOnly)); + index.write("[Icon Theme]\nDirectories=16x16/actions\n[16x16/actions]\nSize=16\nContext=Actions\nType=Fixed\n"); + } + QIcon::setThemeSearchPaths(QStringList() << dir.path()); + QIcon::setThemeName("testcache"); + + // We just created a theme with that icon, it must exist + QVERIFY(!QIcon::fromTheme("button-open").isNull()); + + QString cacheName = dir.path() + QLatin1String("/testcache/icon-theme.cache"); + + // An invalid cache should not prevent lookup + { + QFile cacheFile(cacheName); + QVERIFY(cacheFile.open(QFile::WriteOnly)); + QDataStream(&cacheFile) << quint16(1) << quint16(0) << "invalid corrupted stuff in there\n"; + } + QIcon::setThemeSearchPaths(QStringList() << dir.path()); // reload themes + QVERIFY(!QIcon::fromTheme("button-open").isNull()); + + // An empty cache should prevent the lookup + { + QFile cacheFile(cacheName); + QVERIFY(cacheFile.open(QFile::WriteOnly)); + QDataStream ds(&cacheFile); + ds << quint16(1) << quint16(0); // 0: version + ds << quint32(12) << quint32(20); // 4: hash offset / dir list offset + ds << quint32(1) << quint32(0xffffffff); // 12: one empty bucket + ds << quint32(1) << quint32(28); // 20: list with one element + ds.writeRawData("16x16/actions", sizeof("16x16/actions")); // 28 + } + QIcon::setThemeSearchPaths(QStringList() << dir.path()); // reload themes + QVERIFY(QIcon::fromTheme("button-open").isNull()); // The icon was not in the cache, it should not be found + + // Adding an icon should be changing the modification date of one sub directory which should make the cache ignored + QTest::qWait(1000); // wait enough to have a different modification time in seconds + QVERIFY(QFile(QStringLiteral(":/styles/commonstyle/images/standardbutton-save-16.png")) + .copy(dir.path() + QLatin1String("/testcache/16x16/actions/button-save.png"))); + QVERIFY(QFileInfo(cacheName).lastModified() < QFileInfo(dir.path() + QLatin1String("/testcache/16x16/actions")).lastModified()); + QIcon::setThemeSearchPaths(QStringList() << dir.path()); // reload themes + QVERIFY(!QIcon::fromTheme("button-open").isNull()); + + // Try to run the actual gtk-update-icon-cache and make sure that icons are still found + QProcess process; + process.start(QStringLiteral("gtk-update-icon-cache"), + QStringList() << QStringLiteral("-f") << QStringLiteral("-t") << (dir.path() + QLatin1String("/testcache"))); + if (!process.waitForFinished()) + QSKIP("gtk-update-icon-cache not run"); + QVERIFY(QFileInfo(cacheName).lastModified() >= QFileInfo(dir.path() + QLatin1String("/testcache/16x16/actions")).lastModified()); + QIcon::setThemeSearchPaths(QStringList() << dir.path()); // reload themes + QVERIFY(!QIcon::fromTheme("button-open").isNull()); + QVERIFY(!QIcon::fromTheme("button-open-fallback").isNull()); + QVERIFY(QIcon::fromTheme("notexist-fallback").isNull()); +} void tst_QIcon::task223279_inconsistentAddFile() { diff --git a/tests/auto/gui/image/qicon/tst_qicon.qrc b/tests/auto/gui/image/qicon/tst_qicon.qrc index 1505ca925b..3c8fbba7c2 100644 --- a/tests/auto/gui/image/qicon/tst_qicon.qrc +++ b/tests/auto/gui/image/qicon/tst_qicon.qrc @@ -15,6 +15,7 @@ <file>./icons/themeparent/32x32/actions/address-book-new.png</file> <file>./icons/themeparent/32x32/actions/appointment-new.png</file> <file>./icons/themeparent/index.theme</file> +<file>./icons/themeparent/icon-theme.cache</file> <file>./icons/themeparent/scalable/actions/address-book-new.svg</file> <file>./icons/themeparent/scalable/actions/appointment-new.svg</file> <file>./styles/commonstyle/images/standardbutton-open-16.png</file> diff --git a/tests/auto/gui/image/qimage/qimage.pro b/tests/auto/gui/image/qimage/qimage.pro index 42280d3bd4..d32e84c0d7 100644 --- a/tests/auto/gui/image/qimage/qimage.pro +++ b/tests/auto/gui/image/qimage/qimage.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qimage SOURCES += tst_qimage.cpp diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp index 08f48abd20..e15e66b0a7 100644 --- a/tests/auto/gui/image/qimage/tst_qimage.cpp +++ b/tests/auto/gui/image/qimage/tst_qimage.cpp @@ -970,13 +970,17 @@ void tst_QImage::createAlphaMask_data() int alphas[] = { 0, 127, 255 }; for (unsigned a1 = 0; a1 < sizeof(alphas) / sizeof(int); ++a1) { + const QByteArray a1B = QByteArray::number(alphas[a1]); for (unsigned a2 = 0; a2 < sizeof(alphas) / sizeof(int); ++a2) { if (a1 == a2) continue; + const QByteArray a2B = QByteArray::number(alphas[a2]); for (int x=10; x<18; x+=3) { + const QByteArray xB = QByteArray::number(x); for (int y=100; y<108; y+=3) { - QTest::newRow(qPrintable(QString::fromLatin1("x=%1, y=%2, a1=%3, a2=%4").arg(x).arg(y).arg(alphas[a1]).arg(alphas[a2]))) - << x << y << alphas[a1] << alphas[a2]; + const QByteArray testName = "x=" + xB + ", y=" + QByteArray::number(y) + + ", a1=" + a1B + ", a2=" + a2B; + QTest::newRow(testName.constData()) << x << y << alphas[a1] << alphas[a2]; } } } @@ -1073,34 +1077,34 @@ void tst_QImage::rotate_data() degrees << 0 << 90 << 180 << 270; foreach (int d, degrees) { - QString title = QString("%1 %2").arg(d); - QTest::newRow(qPrintable(title.arg("Format_RGB32"))) + const QByteArray dB = QByteArray::number(d); + QTest::newRow((dB + " Format_RGB32").constData()) << QImage::Format_RGB32 << d; - QTest::newRow(qPrintable(title.arg("Format_ARGB32"))) + QTest::newRow((dB + " Format_ARGB32").constData()) << QImage::Format_ARGB32 << d; - QTest::newRow(qPrintable(title.arg("Format_ARGB32_Premultiplied"))) + QTest::newRow((dB + " Format_ARGB32_Premultiplied").constData()) << QImage::Format_ARGB32_Premultiplied << d; - QTest::newRow(qPrintable(title.arg("Format_RGB16"))) + QTest::newRow((dB + " Format_RGB16").constData()) << QImage::Format_RGB16 << d; - QTest::newRow(qPrintable(title.arg("Format_ARGB8565_Premultiplied"))) + QTest::newRow((dB + " Format_ARGB8565_Premultiplied").constData()) << QImage::Format_ARGB8565_Premultiplied << d; - QTest::newRow(qPrintable(title.arg("Format_RGB666"))) + QTest::newRow((dB + " Format_RGB666").constData()) << QImage::Format_RGB666 << d; - QTest::newRow(qPrintable(title.arg("Format_RGB555"))) + QTest::newRow((dB + " Format_RGB555").constData()) << QImage::Format_RGB555 << d; - QTest::newRow(qPrintable(title.arg("Format_ARGB8555_Premultiplied"))) + QTest::newRow((dB + " Format_ARGB8555_Premultiplied").constData()) << QImage::Format_ARGB8555_Premultiplied << d; - QTest::newRow(qPrintable(title.arg("Format_RGB888"))) + QTest::newRow((dB + " Format_RGB888").constData()) << QImage::Format_RGB888 << d; - QTest::newRow(qPrintable(title.arg("Format_Indexed8"))) + QTest::newRow((dB + " Format_Indexed8").constData()) << QImage::Format_Indexed8 << d; - QTest::newRow(qPrintable(title.arg("Format_RGBX8888"))) + QTest::newRow((dB + " Format_RGBX8888").constData()) << QImage::Format_RGBX8888 << d; - QTest::newRow(qPrintable(title.arg("Format_RGBA8888_Premultiplied"))) + QTest::newRow((dB + " Format_RGBA8888_Premultiplied").constData()) << QImage::Format_RGBA8888_Premultiplied << d; - QTest::newRow(qPrintable(title.arg("Format_Alpha8"))) + QTest::newRow((dB + " Format_Alpha8").constData()) << QImage::Format_Alpha8 << d; - QTest::newRow(qPrintable(title.arg("Format_Grayscale8"))) + QTest::newRow((dB + " Format_Grayscale8").constData()) << QImage::Format_Grayscale8 << d; } } @@ -1624,9 +1628,11 @@ void tst_QImage::smoothScale2_data() int sizes[] = { 2, 3, 4, 6, 7, 8, 10, 16, 20, 32, 40, 64, 100, 101, 128, 0 }; QImage::Format formats[] = { QImage::Format_RGB32, QImage::Format_ARGB32_Premultiplied, QImage::Format_Invalid }; for (int j = 0; formats[j] != QImage::Format_Invalid; ++j) { - QString formatstr = formats[j] == QImage::Format_RGB32 ? QStringLiteral("rgb32") : QStringLiteral("argb32pm"); + QByteArray formatstr = formats[j] == QImage::Format_RGB32 ? QByteArrayLiteral("rgb32") : QByteArrayLiteral("argb32pm"); for (int i = 0; sizes[i] != 0; ++i) { - QTest::newRow(QString("%1 %2x%2").arg(formatstr).arg(sizes[i]).toUtf8()) << (int)formats[j] << sizes[i]; + const QByteArray sizeB = QByteArray::number(sizes[i]); + QTest::newRow((formatstr + ' ' + sizeB + 'x' + sizeB).constData()) + << (int)formats[j] << sizes[i]; } } } @@ -2598,10 +2604,11 @@ void tst_QImage::genericRgbConversion_data() QTest::addColumn<QImage::Format>("dest_format"); for (int i = QImage::Format_RGB32; i < QImage::Format_Alpha8; ++i) { + const QString formatI = formatToString(QImage::Format(i)); for (int j = QImage::Format_RGB32; j < QImage::Format_Alpha8; ++j) { if (i == j) continue; - QString test = QString::fromLatin1("%1 -> %2").arg(formatToString(QImage::Format(i))).arg(formatToString(QImage::Format(j))); + const QString test = formatI + QLatin1String(" -> ") + formatToString(QImage::Format(j)); QTest::newRow(qPrintable(test)) << QImage::Format(i) << QImage::Format(j); } } diff --git a/tests/auto/gui/image/qimageiohandler/qimageiohandler.pro b/tests/auto/gui/image/qimageiohandler/qimageiohandler.pro index bbcf8d23c9..428ff62959 100644 --- a/tests/auto/gui/image/qimageiohandler/qimageiohandler.pro +++ b/tests/auto/gui/image/qimageiohandler/qimageiohandler.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qimageiohandler QT += testlib diff --git a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp index 16fe959b11..2eb9b4fc2d 100644 --- a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp +++ b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp @@ -158,7 +158,7 @@ private: // helper to skip an autotest when the given image format is not supported #define SKIP_IF_UNSUPPORTED(format) do { \ if (!QByteArray(format).isEmpty() && !QImageReader::supportedImageFormats().contains(format)) \ - QSKIP("\"" + QByteArray(format) + "\" images are not supported"); \ + QSKIP('"' + QByteArray(format) + "\" images are not supported"); \ } while (0) // Testing get/set functions @@ -785,7 +785,7 @@ void tst_QImageReader::animatedGif() QVERIFY(!image.isNull()); int i = 0; while(!image.isNull()){ - QString frameName = QString(":images/qt%1.gif").arg(++i); + QString frameName = QLatin1String(":images/qt") + QString::number(++i) + QLatin1String(".gif"); QCOMPARE(image, QImage(frameName)); image = io.read(); } @@ -1637,14 +1637,14 @@ void tst_QImageReader::pixelCompareWithBaseline() // least one file succeeded we know that the plugin was built. // The other failures are then real failures. QImage icoImg; - const QString inputFileName(QString::fromLatin1("images/%1").arg(fileName)); + const QString inputFileName(QLatin1String("images/") + fileName); QFileInfo fi(inputFileName); ++enteredCount; // might fail if the plugin does not exist, which is ok. if (icoImg.load(inputFileName)) { icoImg = icoImg.convertToFormat(QImage::Format_ARGB32_Premultiplied); - const QString baselineFileName(QString::fromLatin1("baseline/%1.png").arg(fi.baseName())); + const QString baselineFileName(QLatin1String("baseline/") + fi.baseName() + QLatin1String(".png")); #if 0 icoImg.save(baselineFileName); #else diff --git a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp index 06c775dded..6c22c47f0e 100644 --- a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp +++ b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp @@ -96,7 +96,7 @@ private: // helper to skip an autotest when the given image format is not supported #define SKIP_IF_UNSUPPORTED(format) do { \ if (!QByteArray(format).isEmpty() && !QImageReader::supportedImageFormats().contains(format)) \ - QSKIP("\"" + QByteArray(format) + "\" images are not supported"); \ + QSKIP('"' + QByteArray(format) + "\" images are not supported"); \ } while (0) static void initializePadding(QImage *image) @@ -271,8 +271,8 @@ void tst_QImageWriter::writeImage2_data() QImage image = image0.convertToFormat(imgFormat); initializePadding(&image); foreach (const QString format, formats) { - const QString fileName = QString("solidcolor_%1.%2").arg(imgFormat) - .arg(format); + const QString fileName = QLatin1String("solidcolor_") + + QString::number(imgFormat) + QLatin1Char('.') + format; QTest::newRow(fileName.toLatin1()) << fileName << format.toLatin1() << image; diff --git a/tests/auto/gui/image/qmovie/qmovie.pro b/tests/auto/gui/image/qmovie/qmovie.pro index 4e7030b1f7..a04ad73b80 100644 --- a/tests/auto/gui/image/qmovie/qmovie.pro +++ b/tests/auto/gui/image/qmovie/qmovie.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qmovie QT += testlib qtHaveModule(widgets): QT += widgets diff --git a/tests/auto/gui/image/qpicture/qpicture.pro b/tests/auto/gui/image/qpicture/qpicture.pro index a24b8ec481..0fc851ce11 100644 --- a/tests/auto/gui/image/qpicture/qpicture.pro +++ b/tests/auto/gui/image/qpicture/qpicture.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qpicture QT += testlib qtHaveModule(widgets): QT += widgets diff --git a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp index 67d7e57fd4..b4252031e6 100644 --- a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp @@ -445,7 +445,8 @@ void tst_QPixmap::scroll() else QVERIFY(pixmap.cacheKey() != oldKey); - QString fileName = QString(":/images/%1.png").arg(QTest::currentDataTag()); + const QString fileName = QLatin1String(":/images/") + QLatin1String(QTest::currentDataTag()) + + QLatin1String(".png"); QPixmap output(fileName); QCOMPARE(input.isNull(), output.isNull()); QVERIFY(lenientCompare(pixmap, output)); @@ -458,7 +459,7 @@ void tst_QPixmap::fill_data() QTest::addColumn<bool>("syscolor"); QTest::addColumn<bool>("bitmap"); for (int color = Qt::black; color < Qt::darkYellow; ++color) - QTest::newRow(QString("syscolor_%1").arg(color).toLatin1()) + QTest::newRow(("syscolor_" + QByteArray::number(color)).constData()) << uint(color) << true << false; #if defined (Q_OS_WINCE) @@ -1000,7 +1001,9 @@ void tst_QPixmap::toWinHICON() HBITMAP bitmap = qt_pixmapToWinHBITMAP(empty, Alpha); SelectObject(bitmap_dc, bitmap); - QImage imageFromFile(image + QString(QLatin1String("_%1x%2.png")).arg(width).arg(height)); + const QString fileName = image + QLatin1Char('_') + QString::number(width) + QLatin1Char('x') + + QString::number(height) + QLatin1String(".png"); + QImage imageFromFile(fileName); imageFromFile = imageFromFile.convertToFormat(QImage::Format_ARGB32_Premultiplied); HICON icon = qt_pixmapToWinHICON(QPixmap::fromImage(imageFromFile)); @@ -1036,7 +1039,9 @@ void tst_QPixmap::fromWinHICON() QImage imageFromHICON = qt_pixmapFromWinHICON(icon).toImage(); DestroyIcon(icon); - QImage imageFromFile(image + QString(QLatin1String("_%1x%2.png")).arg(width).arg(height)); + const QString fileName = image + QLatin1Char('_') + QString::number(width) + QLatin1Char('x') + + QString::number(height) + QLatin1String(".png"); + QImage imageFromFile(fileName); imageFromFile = imageFromFile.convertToFormat(QImage::Format_ARGB32_Premultiplied); // fuzzy comparison must be used, as the pixel values change slightly during conversion diff --git a/tests/auto/gui/image/qpixmapcache/qpixmapcache.pro b/tests/auto/gui/image/qpixmapcache/qpixmapcache.pro index a81712ba23..fe3b5a2db3 100644 --- a/tests/auto/gui/image/qpixmapcache/qpixmapcache.pro +++ b/tests/auto/gui/image/qpixmapcache/qpixmapcache.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qpixmapcache QT += gui-private testlib SOURCES += tst_qpixmapcache.cpp diff --git a/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp b/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp index a3cf66da18..d1f76e8742 100644 --- a/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp +++ b/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp @@ -147,7 +147,7 @@ void tst_QPixmapCache::setCacheLimit() QVERIFY(QPixmapCache::find(key, p1) == 0); QPixmapCache::setCacheLimit(1000); key = QPixmapCache::insert(*p1); - QCOMPARE(getPrivate(key)->isValid, true); + QVERIFY(key.isValid()); QCOMPARE(getPrivate(key)->key, 1); delete p1; @@ -189,7 +189,7 @@ void tst_QPixmapCache::setCacheLimit() key2 = QPixmapCache::insert(*p1); QCOMPARE(getPrivate(key2)->key, 1); //This old key is not valid anymore after the flush - QCOMPARE(getPrivate(key)->isValid, false); + QVERIFY(!key.isValid()); QVERIFY(QPixmapCache::find(key, &p2) == 0); delete p1; } @@ -233,7 +233,7 @@ void tst_QPixmapCache::find() //at that time the first key has been erase because no more place in the cache QVERIFY(QPixmapCache::find(key, &p1) == 0); - QCOMPARE(getPrivate(key)->isValid, false); + QVERIFY(!key.isValid()); } void tst_QPixmapCache::insert() @@ -313,7 +313,7 @@ void tst_QPixmapCache::replace() p2.fill(Qt::yellow); QPixmapCache::Key key = QPixmapCache::insert(p1); - QCOMPARE(getPrivate(key)->isValid, true); + QVERIFY(key.isValid()); QPixmap p3; QVERIFY(QPixmapCache::find(key, &p3) == 1); @@ -321,7 +321,7 @@ void tst_QPixmapCache::replace() QPixmapCache::replace(key, p2); QVERIFY(QPixmapCache::find(key, &p3) == 1); - QCOMPARE(getPrivate(key)->isValid, true); + QVERIFY(key.isValid()); QCOMPARE(getPrivate(key)->key, 1); QCOMPARE(p3.width(), 10); @@ -438,7 +438,7 @@ void tst_QPixmapCache::clear() for (int k = 0; k < numberOfKeys; ++k) { QVERIFY(QPixmapCache::find(keys.at(k), &p1) == 0); - QCOMPARE(getPrivate(keys[k])->isValid, false); + QVERIFY(!keys[k].isValid()); } } diff --git a/tests/auto/gui/itemmodels/qstandarditem/qstandarditem.pro b/tests/auto/gui/itemmodels/qstandarditem/qstandarditem.pro index b85d475e97..50426612dc 100644 --- a/tests/auto/gui/itemmodels/qstandarditem/qstandarditem.pro +++ b/tests/auto/gui/itemmodels/qstandarditem/qstandarditem.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qstandarditem QT += testlib SOURCES += tst_qstandarditem.cpp diff --git a/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp b/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp index ff263c166a..06f7793ace 100644 --- a/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp +++ b/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp @@ -140,7 +140,8 @@ void tst_QStandardItem::getSetData() QStandardItem item; for (int x = 0; x < 2; ++x) { for (int i = 1; i <= 2; ++i) { - QString text = QString("text %0").arg(i); + const QString iS = QString::number(i); + QString text = QLatin1String("text ") + iS; item.setText(text); QCOMPARE(item.text(), text); @@ -150,15 +151,15 @@ void tst_QStandardItem::getSetData() item.setIcon(icon); QCOMPARE(item.icon(), icon); - QString toolTip = QString("toolTip %0").arg(i); + QString toolTip = QLatin1String("toolTip ") + iS; item.setToolTip(toolTip); QCOMPARE(item.toolTip(), toolTip); - QString statusTip = QString("statusTip %0").arg(i); + QString statusTip = QLatin1String("statusTip ") + iS; item.setStatusTip(statusTip); QCOMPARE(item.statusTip(), statusTip); - QString whatsThis = QString("whatsThis %0").arg(i); + QString whatsThis = QLatin1String("whatsThis ") + iS; item.setWhatsThis(whatsThis); QCOMPARE(item.whatsThis(), whatsThis); @@ -188,11 +189,11 @@ void tst_QStandardItem::getSetData() item.setCheckState(checkState); QCOMPARE(item.checkState(), checkState); - QString accessibleText = QString("accessibleText %0").arg(i); + QString accessibleText = QLatin1String("accessibleText ") + iS; item.setAccessibleText(accessibleText); QCOMPARE(item.accessibleText(), accessibleText); - QString accessibleDescription = QString("accessibleDescription %0").arg(i); + QString accessibleDescription = QLatin1String("accessibleDescription ") + iS; item.setAccessibleDescription(accessibleDescription); QCOMPARE(item.accessibleDescription(), accessibleDescription); diff --git a/tests/auto/gui/itemmodels/qstandarditemmodel/qstandarditemmodel.pro b/tests/auto/gui/itemmodels/qstandarditemmodel/qstandarditemmodel.pro index 71ef4acb88..eef165d9f7 100644 --- a/tests/auto/gui/itemmodels/qstandarditemmodel/qstandarditemmodel.pro +++ b/tests/auto/gui/itemmodels/qstandarditemmodel/qstandarditemmodel.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qstandarditemmodel QT += widgets widgets-private testlib diff --git a/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp index ae47b2053b..7fc234670d 100644 --- a/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp +++ b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp @@ -256,7 +256,7 @@ void tst_QStandardItemModel::insertRow() QCOMPARE(rcLast[RowsInserted], expectedRow); //check that the inserted item has different DisplayRole than initial items - QVERIFY(m_model->data(m_model->index(expectedRow, 0), Qt::DisplayRole).toString() != "initialitem"); + QVERIFY(m_model->data(m_model->index(expectedRow, 0), Qt::DisplayRole).toString() != QLatin1String("initialitem")); } else { // We inserted something outside the bounds, do nothing QCOMPARE(m_model->rowCount(), defaultSize); @@ -300,7 +300,7 @@ void tst_QStandardItemModel::insertRowsItems() QStandardItemModel *m = qobject_cast<QStandardItemModel*>(m_model); QStandardItem *hiddenRoot = m->invisibleRootItem(); for (int i = 0; i < 3; ++i) - items.append(new QStandardItem(QString("%1").arg(i + 10))); + items.append(new QStandardItem(QString::number(i + 10))); hiddenRoot->appendRows(items); QCOMPARE(m_model->rowCount(), rowCount + 3); QCOMPARE(m_model->index(rowCount + 0, 0).data().toInt(), 10); @@ -365,7 +365,7 @@ void tst_QStandardItemModel::insertColumn() QCOMPARE(rcLast[ColumnsInserted], expectedColumn); //check that the inserted item has different DisplayRole than initial items - QVERIFY(m_model->data(m_model->index(0, expectedColumn), Qt::DisplayRole).toString() != "initialitem"); + QVERIFY(m_model->data(m_model->index(0, expectedColumn), Qt::DisplayRole).toString() != QLatin1String("initialitem")); } else { // We inserted something outside the bounds, do nothing QCOMPARE(m_model->columnCount(), defaultSize); @@ -729,8 +729,8 @@ void tst_QStandardItemModel::data() } } - QVERIFY(m_model->data(m_model->index(0, 0), Qt::DisplayRole).toString() == "initialitem"); - QVERIFY(m_model->data(m_model->index(0, 0), Qt::ToolTipRole).toString() == "tooltip"); + QCOMPARE(m_model->data(m_model->index(0, 0), Qt::DisplayRole).toString(), QLatin1String("initialitem")); + QCOMPARE(m_model->data(m_model->index(0, 0), Qt::ToolTipRole).toString(), QLatin1String("tooltip")); } @@ -874,7 +874,7 @@ void tst_QStandardItemModel::sort_data() << "zulu"); QStringList list; for (int i=1000; i < 2000; ++i) - list.append(QString("Number: %1").arg(i)); + list.append(QStringLiteral("Number: ") + QString::number(i)); QTest::newRow("large set ascending") << static_cast<int>(Qt::AscendingOrder) << list << list; } @@ -1336,7 +1336,7 @@ void tst_QStandardItemModel::useCase3() // create the tree structure first QStandardItem *childItem = 0; for (int i = 0; i < 100; ++i) { - QStandardItem *item = new QStandardItem(QString("item %0").arg(i)); + QStandardItem *item = new QStandardItem(QStringLiteral("item ") + QString::number(i)); if (childItem) item->appendRow(childItem); childItem = item; @@ -1466,55 +1466,48 @@ struct FriendlyTreeView : public QTreeView #endif #ifdef QT_BUILD_INTERNAL -void tst_QStandardItemModel::treeDragAndDrop() -{ - const int nRow = 5; - const int nCol = 3; - - QStandardItemModel model; - QStandardItemModel checkModel; +static void populateDragAndDropModel(QStandardItemModel &model, int nRow, int nCol) +{ + const QString item = QStringLiteral("item "); + const QString dash = QStringLiteral(" - "); for (int i = 0; i < nRow; ++i) { + const QString iS = QString::number(i); QList<QStandardItem *> colItems1; for (int c = 0 ; c < nCol; c ++) - colItems1 << new QStandardItem(QString("item %1 - %0").arg(c).arg(i)); + colItems1 << new QStandardItem(item + iS + dash + QString::number(c)); model.appendRow(colItems1); for (int j = 0; j < nRow; ++j) { + const QString jS = QString::number(j); QList<QStandardItem *> colItems2; for (int c = 0 ; c < nCol; c ++) - colItems2 << new QStandardItem(QString("item %1/%2 - %0").arg(c).arg(i).arg(j)); + colItems2 << new QStandardItem(item + iS + QLatin1Char('/') + jS + dash + QString::number(c)); colItems1.at(0)->appendRow(colItems2); for (int k = 0; k < nRow; ++k) { QList<QStandardItem *> colItems3; + const QString kS = QString::number(k); for (int c = 0 ; c < nCol; c ++) - colItems3 << new QStandardItem(QString("item %1/%2/%3 - %0").arg(c).arg(i).arg(j).arg(k)); + colItems3 << new QStandardItem(item + iS + QLatin1Char('/') + jS + + QLatin1Char('/') + kS + + dash + QString::number(c)); colItems2.at(0)->appendRow(colItems3); } } } +} - for (int i = 0; i < nRow; ++i) { - QList<QStandardItem *> colItems1; - for (int c = 0 ; c < nCol; c ++) - colItems1 << new QStandardItem(QString("item %1 - %0").arg(c).arg(i)); - checkModel.appendRow(colItems1); +void tst_QStandardItemModel::treeDragAndDrop() +{ + const int nRow = 5; + const int nCol = 3; - for (int j = 0; j < nRow; ++j) { - QList<QStandardItem *> colItems2; - for (int c = 0 ; c < nCol; c ++) - colItems2 << new QStandardItem(QString("item %1/%2 - %0").arg(c).arg(i).arg(j)); - colItems1.at(0)->appendRow(colItems2); + QStandardItemModel model; + QStandardItemModel checkModel; - for (int k = 0; k < nRow; ++k) { - QList<QStandardItem *> colItems3; - for (int c = 0 ; c < nCol; c ++) - colItems3 << new QStandardItem(QString("item %1/%2/%3 - %0").arg(c).arg(i).arg(j).arg(k)); - colItems2.at(0)->appendRow(colItems3); - } - } - } + populateDragAndDropModel(model, nRow, nCol); + populateDragAndDropModel(checkModel, nRow, nCol); QVERIFY(compareModels(&model, &checkModel)); @@ -1613,14 +1606,14 @@ void tst_QStandardItemModel::removeRowsAndColumns() #define VERIFY_MODEL \ for (int c = 0; c < col_list.count(); c++) \ for (int r = 0; r < row_list.count(); r++) \ - QCOMPARE(model.item(r,c)->text() , row_list[r] + "x" + col_list[c]); + QCOMPARE(model.item(r,c)->text() , row_list[r] + QLatin1Char('x') + col_list[c]); QVector<QString> row_list = QString("1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20").split(',').toVector(); QVector<QString> col_list = row_list; QStandardItemModel model; for (int c = 0; c < col_list.count(); c++) for (int r = 0; r < row_list.count(); r++) - model.setItem(r, c, new QStandardItem(row_list[r] + "x" + col_list[c])); + model.setItem(r, c, new QStandardItem(row_list[r] + QLatin1Char('x') + col_list[c])); VERIFY_MODEL row_list.remove(3); @@ -1642,14 +1635,14 @@ void tst_QStandardItemModel::removeRowsAndColumns() QList<QStandardItem *> row_taken = model.takeRow(6); QCOMPARE(row_taken.count(), col_list.count()); for (int c = 0; c < col_list.count(); c++) - QCOMPARE(row_taken[c]->text() , row_list[6] + "x" + col_list[c]); + QCOMPARE(row_taken[c]->text() , row_list[6] + QLatin1Char('x') + col_list[c]); row_list.remove(6); VERIFY_MODEL QList<QStandardItem *> col_taken = model.takeColumn(10); QCOMPARE(col_taken.count(), row_list.count()); for (int r = 0; r < row_list.count(); r++) - QCOMPARE(col_taken[r]->text() , row_list[r] + "x" + col_list[10]); + QCOMPARE(col_taken[r]->text() , row_list[r] + QLatin1Char('x') + col_list[10]); col_list.remove(10); VERIFY_MODEL } @@ -1661,7 +1654,7 @@ void tst_QStandardItemModel::itemRoleNames() QStandardItemModel model; for (int c = 0; c < col_list.count(); c++) for (int r = 0; r < row_list.count(); r++) - model.setItem(r, c, new QStandardItem(row_list[r] + "x" + col_list[c])); + model.setItem(r, c, new QStandardItem(row_list[r] + QLatin1Char('x') + col_list[c])); VERIFY_MODEL QHash<int, QByteArray> newRoleNames; diff --git a/tests/auto/gui/kernel/qdrag/qdrag.pro b/tests/auto/gui/kernel/qdrag/qdrag.pro index d4a7bc2705..ac3fde8028 100644 --- a/tests/auto/gui/kernel/qdrag/qdrag.pro +++ b/tests/auto/gui/kernel/qdrag/qdrag.pro @@ -3,7 +3,6 @@ ############################################################ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qdrag QT += testlib SOURCES += tst_qdrag.cpp diff --git a/tests/auto/gui/kernel/qevent/qevent.pro b/tests/auto/gui/kernel/qevent/qevent.pro index 09d4395f4d..2959089ce3 100644 --- a/tests/auto/gui/kernel/qevent/qevent.pro +++ b/tests/auto/gui/kernel/qevent/qevent.pro @@ -2,4 +2,3 @@ CONFIG += testcase TARGET = tst_qevent SOURCES += tst_qevent.cpp QT = core testlib -CONFIG += parallel_test diff --git a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp index d18f9664fc..ea8f594f9c 100644 --- a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp +++ b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp @@ -63,6 +63,7 @@ private slots: void initTestCase(); void cleanup(); void displayName(); + void desktopFileName(); void firstWindowTitle(); void windowIcon(); void focusObject(); @@ -117,6 +118,21 @@ void tst_QGuiApplication::displayName() QCOMPARE(QGuiApplication::applicationDisplayName(), QString::fromLatin1("The GUI Application")); } +void tst_QGuiApplication::desktopFileName() +{ + int argc = 1; + char *argv[] = { const_cast<char*>("tst_qguiapplication") }; + QGuiApplication app(argc, argv); + + QCOMPARE(QGuiApplication::desktopFileName(), QString()); + + QGuiApplication::setDesktopFileName("io.qt.QGuiApplication.desktop"); + QCOMPARE(QGuiApplication::desktopFileName(), QString::fromLatin1("io.qt.QGuiApplication.desktop")); + + QGuiApplication::setDesktopFileName(QString()); + QCOMPARE(QGuiApplication::desktopFileName(), QString()); +} + void tst_QGuiApplication::firstWindowTitle() { int argc = 3; diff --git a/tests/auto/gui/kernel/qguimetatype/qguimetatype.pro b/tests/auto/gui/kernel/qguimetatype/qguimetatype.pro index 914142404b..331295bab9 100644 --- a/tests/auto/gui/kernel/qguimetatype/qguimetatype.pro +++ b/tests/auto/gui/kernel/qguimetatype/qguimetatype.pro @@ -2,4 +2,3 @@ CONFIG += testcase TARGET = tst_qguimetatype SOURCES += tst_qguimetatype.cpp QT = core gui testlib -CONFIG += parallel_test diff --git a/tests/auto/gui/kernel/qguitimer/qguitimer.pro b/tests/auto/gui/kernel/qguitimer/qguitimer.pro index 15793d6e70..8a71e48007 100644 --- a/tests/auto/gui/kernel/qguitimer/qguitimer.pro +++ b/tests/auto/gui/kernel/qguitimer/qguitimer.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qguitimer QT = core gui testlib SOURCES += ../../../corelib/kernel/qtimer/tst_qtimer.cpp diff --git a/tests/auto/gui/kernel/qguivariant/no_application/no_application.pro b/tests/auto/gui/kernel/qguivariant/no_application/no_application.pro index cc72c225a3..ada3817e55 100644 --- a/tests/auto/gui/kernel/qguivariant/no_application/no_application.pro +++ b/tests/auto/gui/kernel/qguivariant/no_application/no_application.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = no_application SOURCES += main.cpp QT += testlib diff --git a/tests/auto/gui/kernel/qguivariant/test/test.pro b/tests/auto/gui/kernel/qguivariant/test/test.pro index c4123797d2..39e4b3b71f 100644 --- a/tests/auto/gui/kernel/qguivariant/test/test.pro +++ b/tests/auto/gui/kernel/qguivariant/test/test.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qguivariant SOURCES += tst_qguivariant.cpp RESOURCES = tst_qguivariant.qrc diff --git a/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp b/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp index 0e822ced5b..84fdd81f6c 100644 --- a/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp +++ b/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp @@ -380,7 +380,7 @@ void tst_QGuiVariant::toString_data() #ifndef Q_OS_MAC << QString( "Ctrl+A" ); #else - << QString(QChar(0x2318)) + "A"; + << QString(QChar(0x2318)) + QLatin1Char('A'); #endif QFont font( "times", 12 ); diff --git a/tests/auto/gui/kernel/qkeysequence/qkeysequence.pro b/tests/auto/gui/kernel/qkeysequence/qkeysequence.pro index 7c1e8d52de..9f79fe9ab7 100644 --- a/tests/auto/gui/kernel/qkeysequence/qkeysequence.pro +++ b/tests/auto/gui/kernel/qkeysequence/qkeysequence.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qkeysequence QT += testlib @@ -8,4 +7,3 @@ QT += core-private gui-private SOURCES += tst_qkeysequence.cpp RESOURCES += qkeysequence.qrc -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp index 3fcbd0a16f..84680fb7a6 100644 --- a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp +++ b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp @@ -250,7 +250,7 @@ void tst_QKeySequence::operatorQString() seq = QKeySequence( modifiers | keycode ); - QCOMPARE( (QString)seq, keystring ); + QCOMPARE( seq.toString(QKeySequence::NativeText), keystring ); } // this verifies that the constructors can handle the same strings in and out @@ -260,7 +260,7 @@ void tst_QKeySequence::symetricConstructors() QFETCH( int, keycode ); QKeySequence seq1( modifiers | keycode ); - QKeySequence seq2( (QString)seq1 ); + QKeySequence seq2( seq1.toString(QKeySequence::NativeText) ); QVERIFY( seq1 == seq2 ); } diff --git a/tests/auto/gui/kernel/qpalette/qpalette.pro b/tests/auto/gui/kernel/qpalette/qpalette.pro index de87e8fafe..9dd3f3e715 100644 --- a/tests/auto/gui/kernel/qpalette/qpalette.pro +++ b/tests/auto/gui/kernel/qpalette/qpalette.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qpalette QT += testlib SOURCES += tst_qpalette.cpp diff --git a/tests/auto/gui/kernel/qscreen/qscreen.pro b/tests/auto/gui/kernel/qscreen/qscreen.pro index b2c98a9dfd..b631f4cf37 100644 --- a/tests/auto/gui/kernel/qscreen/qscreen.pro +++ b/tests/auto/gui/kernel/qscreen/qscreen.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qscreen QT += core-private gui-private testlib diff --git a/tests/auto/gui/kernel/qsurfaceformat/qsurfaceformat.pro b/tests/auto/gui/kernel/qsurfaceformat/qsurfaceformat.pro index 9a705f443e..97d9d69fb7 100644 --- a/tests/auto/gui/kernel/qsurfaceformat/qsurfaceformat.pro +++ b/tests/auto/gui/kernel/qsurfaceformat/qsurfaceformat.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qsurfaceformat QT += core-private gui-private testlib diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index 2219306b81..a953a36559 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -58,12 +58,17 @@ class tst_QWindow: public QObject Q_OBJECT private slots: + void create(); + void setParent(); + void setVisible(); void eventOrderOnShow(); void resizeEventAfterResize(); void mapGlobal(); void positioning_data(); void positioning(); void positioningDuringMinimized(); + void childWindowPositioning_data(); + void childWindowPositioning(); void platformSurface(); void isExposed(); void isActive(); @@ -124,6 +129,111 @@ void tst_QWindow::cleanup() QVERIFY(QGuiApplication::allWindows().isEmpty()); } +void tst_QWindow::create() +{ + QWindow a; + QVERIFY2(!a.handle(), "QWindow should lazy init the platform window"); + + a.create(); + QVERIFY2(a.handle(), "Explicitly creating a platform window should never fail"); + + QWindow b; + QWindow c(&b); + b.create(); + QVERIFY(b.handle()); + QVERIFY2(!c.handle(), "Creating a parent window should not automatically create children"); + + QWindow d; + QWindow e(&d); + e.create(); + QVERIFY(e.handle()); + QVERIFY2(d.handle(), "Creating a child window should automatically create parents"); + + QWindow f; + QWindow g(&f); + f.create(); + QVERIFY(f.handle()); + QPlatformWindow *platformWindow = f.handle(); + g.create(); + QVERIFY(g.handle()); + QVERIFY2(f.handle() == platformWindow, "Creating a child window should not affect parent if already created"); +} + +void tst_QWindow::setParent() +{ + QWindow a; + QWindow b(&a); + QVERIFY2(b.parent() == &a, "Setting parent at construction time should work"); + QVERIFY2(a.children().contains(&b), "Parent should have child in list of children"); + + QWindow c; + QWindow d; + d.setParent(&c); + QVERIFY2(d.parent() == &c, "Setting parent after construction should work"); + QVERIFY2(c.children().contains(&d), "Parent should have child in list of children"); + + a.create(); + b.setParent(0); + QVERIFY2(!b.handle(), "Making window top level shouild not automatically create it"); + + QWindow e; + c.create(); + e.setParent(&c); + QVERIFY2(!e.handle(), "Making window a child of a created window should not automatically create it"); + + QWindow f; + QWindow g; + g.create(); + QVERIFY(g.handle()); + g.setParent(&f); + QVERIFY2(f.handle(), "Making a created window a child of a non-created window should automatically create it"); +} + +void tst_QWindow::setVisible() +{ + QWindow a; + QWindow b(&a); + a.setVisible(true); + QVERIFY2(!b.handle(), "Making a top level window visible doesn't create its children"); + QVERIFY2(!b.isVisible(), "Making a top level window visible doesn't make its children visible"); + QVERIFY(QTest::qWaitForWindowExposed(&a)); + + QWindow c; + QWindow d(&c); + d.setVisible(true); + QVERIFY2(!c.handle(), "Making a child window visible doesn't create parent window if parent is hidden"); + QVERIFY2(!c.isVisible(), "Making a child window visible doesn't make its parent visible"); + + QVERIFY2(!d.handle(), "Making a child window visible doesn't create platform window if parent is hidden"); + + c.create(); + QVERIFY(c.handle()); + QVERIFY2(d.handle(), "Creating a parent window should automatically create children if they are visible"); + QVERIFY2(!c.isVisible(), "Creating a parent window should not make it visible just because it has visible children"); + + QWindow e; + QWindow f(&e); + f.setVisible(true); + QVERIFY(!f.handle()); + QVERIFY(!e.handle()); + f.setParent(0); + QVERIFY2(f.handle(), "Making a visible but not created child window top level should create it"); + QVERIFY(QTest::qWaitForWindowExposed(&f)); + + QWindow g; + QWindow h; + QWindow i(&g); + i.setVisible(true); + h.setVisible(true); + QVERIFY(QTest::qWaitForWindowExposed(&h)); + QVERIFY(!i.handle()); + QVERIFY(!g.handle()); + QVERIFY(h.handle()); + i.setParent(&h); + QVERIFY2(i.handle(), "Making a visible but not created child window child of a created window should create it"); + QVERIFY(QTest::qWaitForWindowExposed(&i)); +} + void tst_QWindow::mapGlobal() { QWindow a; @@ -212,6 +322,19 @@ private: QPlatformSurfaceEvent::SurfaceEventType m_surfaceventType; }; +class ColoredWindow : public QRasterWindow { +public: + explicit ColoredWindow(const QColor &color, QWindow *parent = 0) : QRasterWindow(parent), m_color(color) {} + void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE + { + QPainter p(this); + p.fillRect(QRect(QPoint(0, 0), size()), m_color); + } + +private: + const QColor m_color; +}; + void tst_QWindow::eventOrderOnShow() { // Some platforms enforce minimum widths for windows, which can cause extra resize @@ -394,6 +517,60 @@ void tst_QWindow::positioningDuringMinimized() QTRY_COMPARE(window.geometry(), newGeometry); } +void tst_QWindow::childWindowPositioning_data() +{ + QTest::addColumn<bool>("showInsteadOfCreate"); + + QTest::newRow("create") << false; + QTest::newRow("show") << true; +} + +void tst_QWindow::childWindowPositioning() +{ + const QPoint topLeftOrigin(0, 0); + + ColoredWindow topLevelWindowFirst(Qt::green); + topLevelWindowFirst.setObjectName("topLevelWindowFirst"); + ColoredWindow childWindowAfter(Qt::yellow, &topLevelWindowFirst); + childWindowAfter.setObjectName("childWindowAfter"); + + topLevelWindowFirst.setFramePosition(m_availableTopLeft); + childWindowAfter.setFramePosition(topLeftOrigin); + + ColoredWindow topLevelWindowAfter(Qt::green); + topLevelWindowAfter.setObjectName("topLevelWindowAfter"); + ColoredWindow childWindowFirst(Qt::yellow, &topLevelWindowAfter); + childWindowFirst.setObjectName("childWindowFirst"); + + topLevelWindowAfter.setFramePosition(m_availableTopLeft); + childWindowFirst.setFramePosition(topLeftOrigin); + + QFETCH(bool, showInsteadOfCreate); + + QWindow* windows[] = { &topLevelWindowFirst, &childWindowAfter, &childWindowFirst, &topLevelWindowAfter, 0 }; + for (int i = 0; windows[i]; ++i) { + QWindow *window = windows[i]; + if (showInsteadOfCreate) { + window->showNormal(); + } else { + window->create(); + } + } + + if (showInsteadOfCreate) { + QVERIFY(QTest::qWaitForWindowExposed(&topLevelWindowFirst)); + QVERIFY(QTest::qWaitForWindowExposed(&topLevelWindowAfter)); + } + + // Creation order shouldn't affect the geometry + QCOMPARE(topLevelWindowFirst.geometry(), topLevelWindowAfter.geometry()); + QCOMPARE(childWindowAfter.geometry(), childWindowFirst.geometry()); + + // Creation order shouldn't affect the child ending up at 0,0 + QCOMPARE(childWindowFirst.framePosition(), topLeftOrigin); + QCOMPARE(childWindowAfter.framePosition(), topLeftOrigin); +} + class PlatformWindowFilter : public QObject { Q_OBJECT @@ -1665,19 +1842,6 @@ void tst_QWindow::modalWindowPosition() QCOMPARE(window.geometry(), origGeo); } -class ColoredWindow : public QRasterWindow { -public: - explicit ColoredWindow(const QColor &color, QWindow *parent = 0) : QRasterWindow(parent), m_color(color) {} - void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE - { - QPainter p(this); - p.fillRect(QRect(QPoint(0, 0), size()), m_color); - } - -private: - const QColor m_color; -}; - static bool isNativeWindowVisible(const QWindow *window) { #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) diff --git a/tests/auto/gui/math3d/qmatrixnxn/qmatrixnxn.pro b/tests/auto/gui/math3d/qmatrixnxn/qmatrixnxn.pro index 3302535dda..1401619cd0 100644 --- a/tests/auto/gui/math3d/qmatrixnxn/qmatrixnxn.pro +++ b/tests/auto/gui/math3d/qmatrixnxn/qmatrixnxn.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qmatrixnxn SOURCES += tst_qmatrixnxn.cpp QT += testlib diff --git a/tests/auto/gui/math3d/qquaternion/qquaternion.pro b/tests/auto/gui/math3d/qquaternion/qquaternion.pro index d20719fd11..f578a38580 100644 --- a/tests/auto/gui/math3d/qquaternion/qquaternion.pro +++ b/tests/auto/gui/math3d/qquaternion/qquaternion.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qquaternion SOURCES += tst_qquaternion.cpp QT += testlib diff --git a/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp b/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp index 1fbad5b829..53d9a987a6 100644 --- a/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp +++ b/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp @@ -999,16 +999,16 @@ static QByteArray testnameForAxis(const QVector3D &axis) testname = "null"; } else { if (axis.x()) { - testname += axis.x() < 0 ? "-" : "+"; - testname += "X"; + testname += axis.x() < 0 ? '-' : '+'; + testname += 'X'; } if (axis.y()) { - testname += axis.y() < 0 ? "-" : "+"; - testname += "Y"; + testname += axis.y() < 0 ? '-' : '+'; + testname += 'Y'; } if (axis.z()) { - testname += axis.z() < 0 ? "-" : "+"; - testname += "Z"; + testname += axis.z() < 0 ? '-' : '+'; + testname += 'Z'; } } return testname; diff --git a/tests/auto/gui/math3d/qvectornd/qvectornd.pro b/tests/auto/gui/math3d/qvectornd/qvectornd.pro index 9504b4a02b..9e5155aa6f 100644 --- a/tests/auto/gui/math3d/qvectornd/qvectornd.pro +++ b/tests/auto/gui/math3d/qvectornd/qvectornd.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qvectornd SOURCES += tst_qvectornd.cpp QT += testlib diff --git a/tests/auto/gui/painting/qbrush/qbrush.pro b/tests/auto/gui/painting/qbrush/qbrush.pro index 0cb11398dc..5016267e66 100644 --- a/tests/auto/gui/painting/qbrush/qbrush.pro +++ b/tests/auto/gui/painting/qbrush/qbrush.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qbrush QT += testlib gui-private SOURCES += tst_qbrush.cpp diff --git a/tests/auto/gui/painting/qcolor/qcolor.pro b/tests/auto/gui/painting/qcolor/qcolor.pro index 44d65bb50b..c8aab4ab75 100644 --- a/tests/auto/gui/painting/qcolor/qcolor.pro +++ b/tests/auto/gui/painting/qcolor/qcolor.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qcolor SOURCES += tst_qcolor.cpp QT += testlib gui-private core-private diff --git a/tests/auto/gui/painting/qpagelayout/qpagelayout.pro b/tests/auto/gui/painting/qpagelayout/qpagelayout.pro index 38a1064357..21fc8e0bb7 100644 --- a/tests/auto/gui/painting/qpagelayout/qpagelayout.pro +++ b/tests/auto/gui/painting/qpagelayout/qpagelayout.pro @@ -1,9 +1,7 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qpagelayout SOURCES += tst_qpagelayout.cpp QT += gui-private testlib DEFINES += QT_USE_USING_NAMESPACE -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/gui/painting/qpagesize/qpagesize.pro b/tests/auto/gui/painting/qpagesize/qpagesize.pro index 5836dc9ba0..5e1cdb64eb 100644 --- a/tests/auto/gui/painting/qpagesize/qpagesize.pro +++ b/tests/auto/gui/painting/qpagesize/qpagesize.pro @@ -1,9 +1,7 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qpagesize SOURCES += tst_qpagesize.cpp QT += testlib DEFINES += QT_USE_USING_NAMESPACE -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/gui/painting/qpaintengine/qpaintengine.pro b/tests/auto/gui/painting/qpaintengine/qpaintengine.pro index 1cf79af0a7..810dd81311 100644 --- a/tests/auto/gui/painting/qpaintengine/qpaintengine.pro +++ b/tests/auto/gui/painting/qpaintengine/qpaintengine.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qpaintengine SOURCES += tst_qpaintengine.cpp QT += testlib diff --git a/tests/auto/gui/painting/qpainter/qpainter.pro b/tests/auto/gui/painting/qpainter/qpainter.pro index e90b516ef2..d4f1d43a74 100644 --- a/tests/auto/gui/painting/qpainter/qpainter.pro +++ b/tests/auto/gui/painting/qpainter/qpainter.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qpainter QT += testlib gui-private core-private @@ -9,7 +8,6 @@ SOURCES += tst_qpainter.cpp TESTDATA += drawEllipse/* drawLine_rop_bitmap/* drawPixmap_rop/* drawPixmap_rop_bitmap/* \ task217400.png -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 android: !android-no-sdk { RESOURCES += \ diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp index 1ed78fa0ef..1571053d7e 100644 --- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp +++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp @@ -663,7 +663,7 @@ QColor tst_QPainter::baseColor( int k, int intensity ) QImage tst_QPainter::getResImage( const QString &dir, const QString &addition, const QString &extension ) { QImage res; - QString resFilename = dir + QString( "/res_%1." ).arg( addition ) + extension; + QString resFilename = dir + QLatin1String("/res_") + addition + QLatin1Char('.') + extension; if ( !res.load( resFilename ) ) { QWARN(QString("Could not load result data %s %1").arg(resFilename).toLatin1()); return QImage(); @@ -674,14 +674,14 @@ QImage tst_QPainter::getResImage( const QString &dir, const QString &addition, c QBitmap tst_QPainter::getBitmap( const QString &dir, const QString &filename, bool mask ) { QBitmap bm; - QString bmFilename = dir + QString( "/%1.xbm" ).arg( filename ); + QString bmFilename = dir + QLatin1Char('/') + filename + QLatin1String(".xbm"); if ( !bm.load( bmFilename ) ) { QWARN(QString("Could not load bitmap '%1'").arg(bmFilename).toLatin1()); return QBitmap(); } if ( mask ) { QBitmap mask; - QString maskFilename = dir + QString( "/%1-mask.xbm" ).arg( filename ); + QString maskFilename = dir + QLatin1Char('/') + filename + QLatin1String("-mask.xbm"); if (!mask.load(maskFilename)) { QWARN(QString("Could not load mask '%1'").arg(maskFilename).toLatin1()); return QBitmap(); @@ -1521,10 +1521,11 @@ void tst_QPainter::drawEllipse_data() // ratio between width and hight is too large/small (task 114874). Those // ratios are therefore currently avoided. for (int w = 10; w < 128; w += 7) { + const QByteArray wB = QByteArray::number(w); for (int h = w/2; h < qMin(2*w, 128); h += 13) { - QString s = QString("%1x%2").arg(w).arg(h); - QTest::newRow(QString("%1 with pen").arg(s).toLatin1()) << QSize(w, h) << true; - QTest::newRow(QString("%1 no pen").arg(s).toLatin1()) << QSize(w, h) << false; + const QByteArray sB = wB + 'x' + QByteArray::number(h); + QTest::newRow((sB + " with pen").constData()) << QSize(w, h) << true; + QTest::newRow((sB + " no pen").constData()) << QSize(w, h) << false; } } } @@ -1562,16 +1563,17 @@ void tst_QPainter::drawClippedEllipse_data() QTest::addColumn<QRect>("rect"); for (int w = 20; w < 128; w += 7) { + const QByteArray wB = QByteArray::number(w); for (int h = w/2; h < qMin(2*w, 128); h += 13) { - QString s = QString("%1x%2").arg(w).arg(h); - QTest::newRow(QString("%1 top").arg(s).toLatin1()) << QRect(0, -h/2, w, h); - QTest::newRow(QString("%1 topright").arg(s).toLatin1()) << QRect(w/2, -h/2, w, h); - QTest::newRow(QString("%1 right").arg(s).toLatin1()) << QRect(w/2, 0, w, h); - QTest::newRow(QString("%1 bottomright").arg(s).toLatin1()) << QRect(w/2, h/2, w, h); - QTest::newRow(QString("%1 bottom").arg(s).toLatin1()) << QRect(0, h/2, w, h); - QTest::newRow(QString("%1 bottomleft").arg(s).toLatin1()) << QRect(-w/2, h/2, w, h); - QTest::newRow(QString("%1 left").arg(s).toLatin1()) << QRect(-w/2, 0, w, h); - QTest::newRow(QString("%1 topleft").arg(s).toLatin1()) << QRect(-w/2, -h/2, w, h); + const QByteArray sB = wB + 'x' + QByteArray::number(h); + QTest::newRow((sB + " top").constData()) << QRect(0, -h/2, w, h); + QTest::newRow((sB + " topright").constData()) << QRect(w/2, -h/2, w, h); + QTest::newRow((sB + " right").constData()) << QRect(w/2, 0, w, h); + QTest::newRow((sB + " bottomright").constData()) << QRect(w/2, h/2, w, h); + QTest::newRow((sB + " bottom").constData()) << QRect(0, h/2, w, h); + QTest::newRow((sB + " bottomleft").constData()) << QRect(-w/2, h/2, w, h); + QTest::newRow((sB + " left").constData()) << QRect(-w/2, 0, w, h); + QTest::newRow((sB + " topleft").constData()) << QRect(-w/2, -h/2, w, h); } } } @@ -1678,13 +1680,14 @@ void tst_QPainter::fillData() QTest::addColumn<bool>("usePen"); for (int w = 3; w < 50; w += 7) { + const QByteArray wB = QByteArray::number(w); for (int h = 3; h < 50; h += 11) { int x = w/2 + 5; int y = h/2 + 5; - QTest::newRow(QString("rect(%1, %2, %3, %4) with pen").arg(x).arg(y).arg(w).arg(h).toLatin1()) - << QRect(x, y, w, h) << true; - QTest::newRow(QString("rect(%1, %2, %3, %4) no pen").arg(x).arg(y).arg(w).arg(h).toLatin1()) - << QRect(x, y, w, h) << false; + const QByteArray rB = "rect(" + QByteArray::number(x) + ", " + QByteArray::number(y) + + ", " + QByteArray::number(w) + ", " + QByteArray::number(h) + ')'; + QTest::newRow((rB + " with pen").constData()) << QRect(x, y, w, h) << true; + QTest::newRow((rB + " no pen").constData()) << QRect(x, y, w, h) << false; } } } @@ -2167,21 +2170,23 @@ void tst_QPainter::clippedLines_data() << QLineF(15, 50, 66, 50); foreach (QLineF line, lines) { - QString desc = QString("line (%1, %2, %3, %4) %5").arg(line.x1()) - .arg(line.y1()).arg(line.x2()).arg(line.y2()); - QTest::newRow(qPrintable(desc.arg(0))) << QSize(100, 100) << line + const QByteArray desc = "line (" + QByteArray::number(line.x1()) + + ", " + QByteArray::number(line.y1()) + ", " + + QByteArray::number(line.x2()) + ", " + QByteArray::number(line.y2()) + + ") "; + QTest::newRow((desc + '0').constData()) << QSize(100, 100) << line << QRect(15, 15, 49, 49) << QPen(Qt::black); - QTest::newRow(qPrintable(desc.arg(1))) << QSize(100, 100) << line + QTest::newRow((desc + '1').constData()) << QSize(100, 100) << line << QRect(15, 15, 50, 50) << QPen(Qt::black); - QTest::newRow(qPrintable(desc.arg(2))) << QSize(100, 100) << line + QTest::newRow((desc + '2').constData()) << QSize(100, 100) << line << QRect(15, 15, 51, 51) << QPen(Qt::black); - QTest::newRow(qPrintable(desc.arg(3))) << QSize(100, 100) << line + QTest::newRow((desc + '3').constData()) << QSize(100, 100) << line << QRect(15, 15, 51, 51) << QPen(Qt::NoPen); - QTest::newRow(qPrintable(desc.arg(4))) << QSize(100, 100) << line + QTest::newRow((desc + '4').constData()) << QSize(100, 100) << line << QRect(15, 15, 51, 51) << pen2; } @@ -4487,7 +4492,7 @@ void tst_QPainter::QTBUG5939_attachPainterPrivate() TestWidget *widget = new TestWidget(); proxy->setWidget(widget); scene->addItem(proxy); - proxy->rotate(45); + proxy->setTransform(QTransform().rotate(45)); w->resize(scene->sceneRect().size().toSize()); w->show(); diff --git a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp index ae30719ee7..b5e2ef96d1 100644 --- a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp +++ b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp @@ -270,13 +270,13 @@ void tst_QPainterPath::contains_QPointF_data() inside.addEllipse(base_rect.adjusted(5, 5, -5, -5)); QPolygonF inside_poly = inside.toFillPolygon(); for (int i=0; i<inside_poly.size(); ++i) - QTest::newRow(qPrintable(QString("inside_ellipse %1").arg(i))) << path << inside_poly.at(i) << true; + QTest::newRow(("inside_ellipse " + QByteArray::number(i)).constData()) << path << inside_poly.at(i) << true; QPainterPath outside; outside.addEllipse(base_rect.adjusted(-5, -5, 5, 5)); QPolygonF outside_poly = outside.toFillPolygon(); for (int i=0; i<outside_poly.size(); ++i) - QTest::newRow(qPrintable(QString("outside_ellipse %1").arg(i))) << path << outside_poly.at(i) << false; + QTest::newRow(("outside_ellipse " + QByteArray::number(i)).constData()) << path << outside_poly.at(i) << false; path = QPainterPath(); base_rect = QRectF(50, 50, 200, 200); @@ -852,8 +852,10 @@ void tst_QPainterPath::testArcMoveTo_data() << QRectF(100, 100, -100, -100); for (int domain=0; domain<rects.size(); ++domain) { + const QByteArray dB = QByteArray::number(domain); for (int i=-360; i<=360; ++i) { - QTest::newRow(qPrintable(QString("test %1 %2").arg(domain).arg(i))) << rects.at(domain) << (qreal) i; + QTest::newRow(("test " + dB + ' ' + QByteArray::number(i)).constData()) + << rects.at(domain) << (qreal) i; } // test low angles diff --git a/tests/auto/gui/painting/qpainterpathstroker/qpainterpathstroker.pro b/tests/auto/gui/painting/qpainterpathstroker/qpainterpathstroker.pro index 8ad476b498..218183da3d 100644 --- a/tests/auto/gui/painting/qpainterpathstroker/qpainterpathstroker.pro +++ b/tests/auto/gui/painting/qpainterpathstroker/qpainterpathstroker.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qpainterpathstroker SOURCES += tst_qpainterpathstroker.cpp QT += testlib diff --git a/tests/auto/gui/painting/qpathclipper/qpathclipper.pro b/tests/auto/gui/painting/qpathclipper/qpathclipper.pro index b90bca8df3..2536cb24c0 100644 --- a/tests/auto/gui/painting/qpathclipper/qpathclipper.pro +++ b/tests/auto/gui/painting/qpathclipper/qpathclipper.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qpathclipper INCLUDEPATH += . HEADERS += paths.h diff --git a/tests/auto/gui/painting/qpdfwriter/qpdfwriter.pro b/tests/auto/gui/painting/qpdfwriter/qpdfwriter.pro index fda0fad3b5..4d2dd70e26 100644 --- a/tests/auto/gui/painting/qpdfwriter/qpdfwriter.pro +++ b/tests/auto/gui/painting/qpdfwriter/qpdfwriter.pro @@ -1,9 +1,7 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qpdfwriter SOURCES += tst_qpdfwriter.cpp QT += gui-private testlib DEFINES += QT_USE_USING_NAMESPACE -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/gui/painting/qpen/qpen.pro b/tests/auto/gui/painting/qpen/qpen.pro index cafec29947..762b8f47d4 100644 --- a/tests/auto/gui/painting/qpen/qpen.pro +++ b/tests/auto/gui/painting/qpen/qpen.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qpen SOURCES += tst_qpen.cpp QT += testlib diff --git a/tests/auto/gui/painting/qpolygon/qpolygon.pro b/tests/auto/gui/painting/qpolygon/qpolygon.pro index 4783e4b5d4..9385b6458d 100644 --- a/tests/auto/gui/painting/qpolygon/qpolygon.pro +++ b/tests/auto/gui/painting/qpolygon/qpolygon.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qpolygon QT += testlib SOURCES += tst_qpolygon.cpp diff --git a/tests/auto/gui/painting/qregion/qregion.pro b/tests/auto/gui/painting/qregion/qregion.pro index 01eb9dd937..e9dff9a32e 100644 --- a/tests/auto/gui/painting/qregion/qregion.pro +++ b/tests/auto/gui/painting/qregion/qregion.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qregion QT += gui-private testlib diff --git a/tests/auto/gui/painting/qtransform/qtransform.pro b/tests/auto/gui/painting/qtransform/qtransform.pro index d59c040fb8..62c7518da0 100644 --- a/tests/auto/gui/painting/qtransform/qtransform.pro +++ b/tests/auto/gui/painting/qtransform/qtransform.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qtransform SOURCES += tst_qtransform.cpp QT += testlib diff --git a/tests/auto/gui/painting/qwmatrix/qwmatrix.pro b/tests/auto/gui/painting/qwmatrix/qwmatrix.pro index b3bec3d4ff..efa2963091 100644 --- a/tests/auto/gui/painting/qwmatrix/qwmatrix.pro +++ b/tests/auto/gui/painting/qwmatrix/qwmatrix.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qwmatrix SOURCES += tst_qwmatrix.cpp QT += testlib diff --git a/tests/auto/gui/qopengl/qopengl.pro b/tests/auto/gui/qopengl/qopengl.pro index bddccac747..2ca2fe4fb6 100644 --- a/tests/auto/gui/qopengl/qopengl.pro +++ b/tests/auto/gui/qopengl/qopengl.pro @@ -3,7 +3,6 @@ ############################################################ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qopengl QT += gui-private core-private testlib diff --git a/tests/auto/gui/qopenglconfig/qopenglconfig.pro b/tests/auto/gui/qopenglconfig/qopenglconfig.pro index bcf7215eea..9b0175acea 100644 --- a/tests/auto/gui/qopenglconfig/qopenglconfig.pro +++ b/tests/auto/gui/qopenglconfig/qopenglconfig.pro @@ -3,7 +3,6 @@ ############################################################ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qopenglconfig QT += gui-private core-private testlib diff --git a/tests/auto/gui/text/qabstracttextdocumentlayout/qabstracttextdocumentlayout.pro b/tests/auto/gui/text/qabstracttextdocumentlayout/qabstracttextdocumentlayout.pro index 866638f154..ec71130350 100644 --- a/tests/auto/gui/text/qabstracttextdocumentlayout/qabstracttextdocumentlayout.pro +++ b/tests/auto/gui/text/qabstracttextdocumentlayout/qabstracttextdocumentlayout.pro @@ -3,7 +3,6 @@ ############################################################ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qabstracttextdocumentlayout QT += testlib SOURCES += tst_qabstracttextdocumentlayout.cpp diff --git a/tests/auto/gui/text/qcssparser/qcssparser.pro b/tests/auto/gui/text/qcssparser/qcssparser.pro index bb0c8c4f40..88d1fcfd2d 100644 --- a/tests/auto/gui/text/qcssparser/qcssparser.pro +++ b/tests/auto/gui/text/qcssparser/qcssparser.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qcssparser SOURCES += tst_qcssparser.cpp QT += xml gui-private testlib diff --git a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp index b1beb0ffd0..2308f4f215 100644 --- a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp +++ b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp @@ -185,7 +185,7 @@ static void debug(const QVector<QCss::Symbol> &symbols, int index = -1) { qDebug() << "all symbols:"; for (int i = 0; i < symbols.count(); ++i) - qDebug() << "(" << i << "); Token:" << tokenName(symbols.at(i).token) << "; Lexem:" << symbols.at(i).lexem(); + qDebug() << '(' << i << "); Token:" << tokenName(symbols.at(i).token) << "; Lexem:" << symbols.at(i).lexem(); if (index != -1) qDebug() << "failure at index" << index; } @@ -916,21 +916,37 @@ void tst_QCssParser::marginValue_data() int ex = QFontMetrics(f).xHeight(); int em = QFontMetrics(f).height(); + const QString ex1234 = QString::number(ex) + QLatin1Char(' ') + QString::number(2 * ex) + + QLatin1Char(' ') + QString::number(3 * ex) + QLatin1Char(' ') + + QString::number(4 * ex); + const QString em2ex4 = QLatin1String("1 ") + QString::number(2*em) + QLatin1String(" 3 ") + + QString::number(4 * ex); + QTest::newRow("one value") << "margin: 1px" << "1 1 1 1"; QTest::newRow("two values") << "margin: 1px 2px" << "1 2 1 2"; QTest::newRow("three value") << "margin: 1px 2px 3px" << "1 2 3 2"; QTest::newRow("four values") << "margin: 1px 2px 3px 4px" << "1 2 3 4"; QTest::newRow("default px") << "margin: 1 2 3 4" << "1 2 3 4"; QTest::newRow("no unit") << "margin: 1 2 3 4" << "1 2 3 4"; - QTest::newRow("em") << "margin: 1ex 2ex 3ex 4ex" << QString("%1 %2 %3 %4").arg(ex).arg(2*ex).arg(3*ex).arg(4*ex); - QTest::newRow("ex") << "margin: 1 2em 3px 4ex" << QString("%1 %2 %3 %4").arg(1).arg(2*em).arg(3).arg(4*ex); + QTest::newRow("em") << "margin: 1ex 2ex 3ex 4ex" + << (QString::number(ex) + QLatin1Char(' ') + QString::number(2 * ex) + + QLatin1Char(' ') + QString::number(3 * ex) + QLatin1Char(' ') + + QString::number(4 * ex)); + QTest::newRow("ex") << "margin: 1 2em 3px 4ex" + << (QLatin1String("1 ") + QString::number(2 * em) + QLatin1String(" 3 ") + + QString::number(4 * ex)); f.setPointSize(20); f.setBold(true); ex = QFontMetrics(f).xHeight(); em = QFontMetrics(f).height(); - QTest::newRow("em2") << "font: bold 20pt; margin: 1ex 2ex 3ex 4ex" << QString("%1 %2 %3 %4").arg(ex).arg(2*ex).arg(3*ex).arg(4*ex); - QTest::newRow("ex2") << "margin: 1 2em 3px 4ex; font-size: 20pt; font-weight: bold;" << QString("%1 %2 %3 %4").arg(1).arg(2*em).arg(3).arg(4*ex); + QTest::newRow("em2") << "font: bold 20pt; margin: 1ex 2ex 3ex 4ex" + << (QString::number(ex) + QLatin1Char(' ') + QString::number(2 * ex) + + QLatin1Char(' ') + QString::number(3 * ex) + QLatin1Char(' ') + + QString::number(4 * ex)); + QTest::newRow("ex2") << "margin: 1 2em 3px 4ex; font-size: 20pt; font-weight: bold;" + << (QLatin1String("1 ") + QString::number(2 * em) + QLatin1String(" 3 ") + + QString::number(4 * ex)); QTest::newRow("crap") << "margin: crap" << "0 0 0 0"; } @@ -963,7 +979,8 @@ void tst_QCssParser::marginValue() int p[4]; int spacing; v.extractBox(m, p, &spacing); - QString str = QString("%1 %2 %3 %4").arg(m[0]).arg(m[1]).arg(m[2]).arg(m[3]); + QString str = QString::number(m[0]) + QLatin1Char(' ') + QString::number(m[1]) + + QLatin1Char(' ') + QString::number(m[2]) + QLatin1Char(' ') + QString::number(m[3]); QCOMPARE(str, expectedMargin); } } @@ -1090,7 +1107,7 @@ void tst_QCssParser::styleSelector() QFETCH(QString, xml); QFETCH(QString, elementToCheck); - QString css = QString("%1 { background-color: green }").arg(selector); + const QString css = selector + QLatin1String(" { background-color: green }"); QCss::Parser parser(css); QCss::StyleSheet sheet; QVERIFY(parser.parse(&sheet)); @@ -1154,7 +1171,7 @@ void tst_QCssParser::specificity() { QFETCH(QString, selector); - QString css = QString("%1 { }").arg(selector); + QString css = selector + QLatin1String(" { }"); QCss::Parser parser(css); QCss::StyleSheet sheet; QVERIFY(parser.parse(&sheet)); @@ -1340,7 +1357,7 @@ void tst_QCssParser::shorthandBackgroundProperty() QVERIFY(doc.setContent(QLatin1String("<!DOCTYPE test><test> <dummy/> </test>"))); css.prepend("dummy {"); - css.append("}"); + css.append(QLatin1Char('}')); QCss::Parser parser(css); QCss::StyleSheet sheet; @@ -1500,7 +1517,7 @@ void tst_QCssParser::gradient() QVERIFY(doc.setContent(QLatin1String("<!DOCTYPE test><test> <dummy/> </test>"))); css.prepend("dummy {"); - css.append("}"); + css.append(QLatin1Char('}')); QCss::Parser parser(css); QCss::StyleSheet sheet; @@ -1560,7 +1577,7 @@ void tst_QCssParser::extractFontFamily() { QFETCH(QString, css); css.prepend("dummy {"); - css.append("}"); + css.append(QLatin1Char('}')); QCss::Parser parser(css); QCss::StyleSheet sheet; @@ -1618,7 +1635,7 @@ void tst_QCssParser::extractBorder() QFETCH(QColor, expectedTopColor); css.prepend("dummy {"); - css.append("}"); + css.append(QLatin1Char('}')); QCss::Parser parser(css); QCss::StyleSheet sheet; diff --git a/tests/auto/gui/text/qfont/qfont.pro b/tests/auto/gui/text/qfont/qfont.pro index ced66c226c..048d952faf 100644 --- a/tests/auto/gui/text/qfont/qfont.pro +++ b/tests/auto/gui/text/qfont/qfont.pro @@ -1,10 +1,6 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qfont QT += testlib QT += core-private gui-private qtHaveModule(widgets): QT += widgets SOURCES += tst_qfont.cpp - - -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/gui/text/qfont/tst_qfont.cpp b/tests/auto/gui/text/qfont/tst_qfont.cpp index 93e308b96a..844a091495 100644 --- a/tests/auto/gui/text/qfont/tst_qfont.cpp +++ b/tests/auto/gui/text/qfont/tst_qfont.cpp @@ -504,7 +504,7 @@ void tst_QFont::isCopyOf() void tst_QFont::insertAndRemoveSubstitutions() { - QFont::removeSubstitution("BogusFontFamily"); + QFont::removeSubstitutions("BogusFontFamily"); // make sure it is empty before we start QVERIFY(QFont::substitutes("BogusFontFamily").isEmpty()); QVERIFY(QFont::substitutes("bogusfontfamily").isEmpty()); @@ -521,7 +521,7 @@ void tst_QFont::insertAndRemoveSubstitutions() QCOMPARE(QFont::substitutes("BogusFontFamily").count(), 3); QCOMPARE(QFont::substitutes("bogusfontfamily").count(), 3); - QFont::removeSubstitution("BogusFontFamily"); + QFont::removeSubstitutions("BogusFontFamily"); // make sure it is empty again QVERIFY(QFont::substitutes("BogusFontFamily").isEmpty()); QVERIFY(QFont::substitutes("bogusfontfamily").isEmpty()); @@ -679,7 +679,7 @@ static inline QByteArray msgNotAcceptableFont(const QString &defaultFamily, cons { QString res = QString::fromLatin1("Font family '%1' is not one of the following acceptable results: ").arg(defaultFamily); Q_FOREACH (const QString &family, acceptableFamilies) - res += QString::fromLatin1("\n %1").arg(family); + res += QLatin1String("\n ") + family; return res.toLocal8Bit(); } diff --git a/tests/auto/gui/text/qfontcache/qfontcache.pro b/tests/auto/gui/text/qfontcache/qfontcache.pro index 5068c12cd6..bc1042a91b 100644 --- a/tests/auto/gui/text/qfontcache/qfontcache.pro +++ b/tests/auto/gui/text/qfontcache/qfontcache.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qfontcache QT += testlib QT += core-private gui-private diff --git a/tests/auto/gui/text/qfontdatabase/qfontdatabase.pro b/tests/auto/gui/text/qfontdatabase/qfontdatabase.pro index 831ed1f572..5dba2fc06a 100644 --- a/tests/auto/gui/text/qfontdatabase/qfontdatabase.pro +++ b/tests/auto/gui/text/qfontdatabase/qfontdatabase.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qfontdatabase SOURCES += tst_qfontdatabase.cpp QT += testlib core-private gui-private diff --git a/tests/auto/gui/text/qfontmetrics/qfontmetrics.pro b/tests/auto/gui/text/qfontmetrics/qfontmetrics.pro index 7286c53d74..5dfabadd1a 100644 --- a/tests/auto/gui/text/qfontmetrics/qfontmetrics.pro +++ b/tests/auto/gui/text/qfontmetrics/qfontmetrics.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qfontmetrics QT += testlib core-private gui-private SOURCES += tst_qfontmetrics.cpp diff --git a/tests/auto/gui/text/qglyphrun/qglyphrun.pro b/tests/auto/gui/text/qglyphrun/qglyphrun.pro index b7d9f164c9..39f641a3b2 100644 --- a/tests/auto/gui/text/qglyphrun/qglyphrun.pro +++ b/tests/auto/gui/text/qglyphrun/qglyphrun.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qglyphrun QT = core gui testlib diff --git a/tests/auto/gui/text/qrawfont/qrawfont.pro b/tests/auto/gui/text/qrawfont/qrawfont.pro index 20da2e9a22..47e760e1da 100644 --- a/tests/auto/gui/text/qrawfont/qrawfont.pro +++ b/tests/auto/gui/text/qrawfont/qrawfont.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qrawfont QT = core core-private gui gui-private testlib diff --git a/tests/auto/gui/text/qstatictext/qstatictext.pro b/tests/auto/gui/text/qstatictext/qstatictext.pro index 435b132ffd..55146c4482 100644 --- a/tests/auto/gui/text/qstatictext/qstatictext.pro +++ b/tests/auto/gui/text/qstatictext/qstatictext.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test linux: CONFIG += insignificant_test TARGET = tst_qstatictext QT += testlib diff --git a/tests/auto/gui/text/qsyntaxhighlighter/qsyntaxhighlighter.pro b/tests/auto/gui/text/qsyntaxhighlighter/qsyntaxhighlighter.pro index a8dd6437ba..a78c429433 100644 --- a/tests/auto/gui/text/qsyntaxhighlighter/qsyntaxhighlighter.pro +++ b/tests/auto/gui/text/qsyntaxhighlighter/qsyntaxhighlighter.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qsyntaxhighlighter SOURCES += tst_qsyntaxhighlighter.cpp QT += testlib diff --git a/tests/auto/gui/text/qtextblock/qtextblock.pro b/tests/auto/gui/text/qtextblock/qtextblock.pro index 6048361f7a..cf3456bbf6 100644 --- a/tests/auto/gui/text/qtextblock/qtextblock.pro +++ b/tests/auto/gui/text/qtextblock/qtextblock.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qtextblock QT += testlib diff --git a/tests/auto/gui/text/qtextcursor/qtextcursor.pro b/tests/auto/gui/text/qtextcursor/qtextcursor.pro index 5e045404f1..bae85d9c37 100644 --- a/tests/auto/gui/text/qtextcursor/qtextcursor.pro +++ b/tests/auto/gui/text/qtextcursor/qtextcursor.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qtextcursor SOURCES += tst_qtextcursor.cpp QT += testlib diff --git a/tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp b/tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp index 9396cd678b..1ecc3f2eae 100644 --- a/tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp +++ b/tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp @@ -175,7 +175,7 @@ void tst_QTextCursor::navigation1() { cursor.insertText("Hello World"); - QVERIFY(doc->toPlainText() == "Hello World"); + QCOMPARE(doc->toPlainText(), QLatin1String("Hello World")); cursor.movePosition(QTextCursor::End); QCOMPARE(cursor.position(), 11); @@ -205,7 +205,7 @@ void tst_QTextCursor::navigation1() doc->undo(); doc->undo(); - QVERIFY(doc->toPlainText() == "Hello World"); + QCOMPARE(doc->toPlainText(), QLatin1String("Hello World")); cursor.movePosition(QTextCursor::Start); cursor.movePosition(QTextCursor::Right, QTextCursor::MoveAnchor, 6); diff --git a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp index 7378ca85ee..ef96cda97d 100644 --- a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp +++ b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp @@ -216,8 +216,8 @@ public: QString tst_QTextDocument::cssFontSizeString(const QFont &font) { return font.pointSize() >= 0 - ? QStringLiteral("%1pt").arg(font.pointSizeF()) - : QStringLiteral("%1px").arg(font.pixelSize()); + ? QString::number(font.pointSizeF()) + QStringLiteral("pt") + : QString::number(font.pixelSize()) + QStringLiteral("px"); } // Testing get/set functions @@ -3082,7 +3082,7 @@ void tst_QTextDocument::baseUrl() document.setBaseUrl(base); QCOMPARE(document.baseUrl(), base); - document.setHtml(QString("<img src='%1'/>").arg(resource.toString())); + document.setHtml(QLatin1String("<img src='") + resource.toString() + QLatin1String("'/>")); document.resource(QTextDocument::ImageResource, resource); QCOMPARE(document.loadedResource(), loaded); } diff --git a/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp b/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp index 1cd9d9bcbe..2ec64e5acc 100644 --- a/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp +++ b/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp @@ -1177,9 +1177,11 @@ void tst_QTextDocumentFragment::copySubTable() fmt.setColumnWidthConstraints(constraints); QTextTable *table = cursor.insertTable(4, 4, fmt); - for (int row = 0; row < 4; ++row) + for (int row = 0; row < 4; ++row) { + const QString rowS = QString::number(row) + QLatin1Char('/'); for (int col = 0; col < 4; ++col) - table->cellAt(row, col).firstCursorPosition().insertText(QString("%1/%2").arg(row).arg(col)); + table->cellAt(row, col).firstCursorPosition().insertText(rowS + QString::number(col)); + } QCOMPARE(table->format().columnWidthConstraints().count(), table->columns()); diff --git a/tests/auto/gui/text/qtextdocumentlayout/qtextdocumentlayout.pro b/tests/auto/gui/text/qtextdocumentlayout/qtextdocumentlayout.pro index 42c6406fdb..5d31ee3930 100644 --- a/tests/auto/gui/text/qtextdocumentlayout/qtextdocumentlayout.pro +++ b/tests/auto/gui/text/qtextdocumentlayout/qtextdocumentlayout.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qtextdocumentlayout QT += testlib qtHaveModule(widgets) QT += widgets diff --git a/tests/auto/gui/text/qtextformat/qtextformat.pro b/tests/auto/gui/text/qtextformat/qtextformat.pro index c64d266916..bf909bafd2 100644 --- a/tests/auto/gui/text/qtextformat/qtextformat.pro +++ b/tests/auto/gui/text/qtextformat/qtextformat.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qtextformat QT += testlib core-private gui-private SOURCES += tst_qtextformat.cpp diff --git a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp index de0c2d6dbe..60ad5d32f5 100644 --- a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp +++ b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp @@ -1123,10 +1123,10 @@ void tst_QTextLayout::boundingRectTopLeft() void tst_QTextLayout::graphemeBoundaryForSurrogatePairs() { QString txt; - txt.append("a"); + txt.append(QLatin1Char('a')); txt.append(0xd87e); txt.append(0xdc25); - txt.append("b"); + txt.append(QLatin1Char('b')); QTextLayout layout(txt); QTextEngine *engine = layout.engine(); const QCharAttributes *attrs = engine->attributes(); diff --git a/tests/auto/gui/text/qtextlist/qtextlist.pro b/tests/auto/gui/text/qtextlist/qtextlist.pro index b837f1f81b..e9ca3ad0a0 100644 --- a/tests/auto/gui/text/qtextlist/qtextlist.pro +++ b/tests/auto/gui/text/qtextlist/qtextlist.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qtextlist QT += core-private gui-private testlib diff --git a/tests/auto/gui/text/qtextobject/qtextobject.pro b/tests/auto/gui/text/qtextobject/qtextobject.pro index b2bf793e8e..3c69757410 100644 --- a/tests/auto/gui/text/qtextobject/qtextobject.pro +++ b/tests/auto/gui/text/qtextobject/qtextobject.pro @@ -3,7 +3,6 @@ ############################################################ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qtextobject QT += testlib qtHaveModule(widgets): QT += widgets diff --git a/tests/auto/gui/text/qtextodfwriter/tst_qtextodfwriter.cpp b/tests/auto/gui/text/qtextodfwriter/tst_qtextodfwriter.cpp index f12bbbdd7e..17541912ce 100644 --- a/tests/auto/gui/text/qtextodfwriter/tst_qtextodfwriter.cpp +++ b/tests/auto/gui/text/qtextodfwriter/tst_qtextodfwriter.cpp @@ -135,7 +135,7 @@ void tst_QTextOdfWriter::testWriteParagraph_data() "<text:p text:style-name=\"p1\"><text:span text:style-name=\"c0\">foobar <text:s text:c=\"2\"/>word<text:tab/>tab x</text:span></text:p>"; QTest::newRow("misc2") << "\t \tFoo" << "<text:p text:style-name=\"p1\"><text:span text:style-name=\"c0\"><text:tab/> <text:s text:c=\"4\"/><text:tab/>Foo</text:span></text:p>"; - QTest::newRow("linefeed") << QString("line1%1line2").arg(QChar(0x2028)) << + QTest::newRow("linefeed") << (QStringLiteral("line1") + QChar(0x2028) + QStringLiteral("line2")) << "<text:p text:style-name=\"p1\"><text:span text:style-name=\"c0\">line1<text:line-break/>line2</text:span></text:p>"; QTest::newRow("spaces") << "The quick brown fox jumped over the lazy dog" << "<text:p text:style-name=\"p1\"><text:span text:style-name=\"c0\">The quick brown fox jumped over the lazy dog</text:span></text:p>"; diff --git a/tests/auto/gui/text/qtextscriptengine/qtextscriptengine.pro b/tests/auto/gui/text/qtextscriptengine/qtextscriptengine.pro index 2179fcbdf8..756073e171 100644 --- a/tests/auto/gui/text/qtextscriptengine/qtextscriptengine.pro +++ b/tests/auto/gui/text/qtextscriptengine/qtextscriptengine.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qtextscriptengine QT += core-private gui-private testlib diff --git a/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp b/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp index 2595bba2a9..37b815c2e3 100644 --- a/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp +++ b/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp @@ -130,7 +130,7 @@ struct ShapeTable { static void prepareShapingTest(const QFont &font, const ShapeTable *shape_table) { for (const ShapeTable *s = shape_table; s->unicode[0]; ++s) { - QByteArray testName = font.family().toLatin1() + ":"; + QByteArray testName = font.family().toLatin1() + ':'; QString string; for (const ushort *u = s->unicode; *u; ++u) { string.append(QChar(*u)); diff --git a/tests/auto/gui/text/qtexttable/qtexttable.pro b/tests/auto/gui/text/qtexttable/qtexttable.pro index 1e7249090a..2faadfcb0d 100644 --- a/tests/auto/gui/text/qtexttable/qtexttable.pro +++ b/tests/auto/gui/text/qtexttable/qtexttable.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qtexttable QT += testlib qtHaveModule(widgets): QT += widgets diff --git a/tests/auto/gui/util/qdesktopservices/qdesktopservices.pro b/tests/auto/gui/util/qdesktopservices/qdesktopservices.pro index 162cc796e5..f5fb11effd 100644 --- a/tests/auto/gui/util/qdesktopservices/qdesktopservices.pro +++ b/tests/auto/gui/util/qdesktopservices/qdesktopservices.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test QT += testlib SOURCES += tst_qdesktopservices.cpp diff --git a/tests/auto/gui/util/qdoublevalidator/qdoublevalidator.pro b/tests/auto/gui/util/qdoublevalidator/qdoublevalidator.pro index 9f04bdbb60..955369527f 100644 --- a/tests/auto/gui/util/qdoublevalidator/qdoublevalidator.pro +++ b/tests/auto/gui/util/qdoublevalidator/qdoublevalidator.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qdoublevalidator QT += testlib SOURCES += tst_qdoublevalidator.cpp diff --git a/tests/auto/gui/util/qintvalidator/qintvalidator.pro b/tests/auto/gui/util/qintvalidator/qintvalidator.pro index 4bc35416b5..52e0b85735 100644 --- a/tests/auto/gui/util/qintvalidator/qintvalidator.pro +++ b/tests/auto/gui/util/qintvalidator/qintvalidator.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qintvalidator SOURCES += tst_qintvalidator.cpp QT += testlib diff --git a/tests/auto/gui/util/qregexpvalidator/qregexpvalidator.pro b/tests/auto/gui/util/qregexpvalidator/qregexpvalidator.pro index 5b70d7b11d..8f1de5b747 100644 --- a/tests/auto/gui/util/qregexpvalidator/qregexpvalidator.pro +++ b/tests/auto/gui/util/qregexpvalidator/qregexpvalidator.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qregexpvalidator SOURCES += tst_qregexpvalidator.cpp QT += testlib diff --git a/tests/auto/gui/util/qregularexpressionvalidator/qregularexpressionvalidator.pro b/tests/auto/gui/util/qregularexpressionvalidator/qregularexpressionvalidator.pro index 1e8e50563e..ab76cef3d1 100644 --- a/tests/auto/gui/util/qregularexpressionvalidator/qregularexpressionvalidator.pro +++ b/tests/auto/gui/util/qregularexpressionvalidator/qregularexpressionvalidator.pro @@ -1,4 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qregularexpressionvalidator SOURCES += tst_qregularexpressionvalidator.cpp QT += testlib |