diff options
Diffstat (limited to 'tests/auto/corelib/io')
67 files changed, 275 insertions, 271 deletions
diff --git a/tests/auto/corelib/io/largefile/largefile.pro b/tests/auto/corelib/io/largefile/largefile.pro index d9938d07d5..caef116684 100644 --- a/tests/auto/corelib/io/largefile/largefile.pro +++ b/tests/auto/corelib/io/largefile/largefile.pro @@ -4,4 +4,3 @@ QT = core testlib SOURCES = tst_largefile.cpp wince: SOURCES += $$QT_SOURCE_TREE/src/corelib/kernel/qfunctions_wince.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qabstractfileengine/qabstractfileengine.pro b/tests/auto/corelib/io/qabstractfileengine/qabstractfileengine.pro index b950f8c062..641bb7341b 100644 --- a/tests/auto/corelib/io/qabstractfileengine/qabstractfileengine.pro +++ b/tests/auto/corelib/io/qabstractfileengine/qabstractfileengine.pro @@ -3,4 +3,3 @@ TARGET = tst_qabstractfileengine QT = core-private core testlib SOURCES = tst_qabstractfileengine.cpp RESOURCES += qabstractfileengine.qrc -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qbuffer/qbuffer.pro b/tests/auto/corelib/io/qbuffer/qbuffer.pro index 55d91f3cde..76b1088595 100644 --- a/tests/auto/corelib/io/qbuffer/qbuffer.pro +++ b/tests/auto/corelib/io/qbuffer/qbuffer.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qbuffer QT = core testlib SOURCES = tst_qbuffer.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qbuffer/tst_qbuffer.cpp b/tests/auto/corelib/io/qbuffer/tst_qbuffer.cpp index 3b730d97f9..c4800b4e10 100644 --- a/tests/auto/corelib/io/qbuffer/tst_qbuffer.cpp +++ b/tests/auto/corelib/io/qbuffer/tst_qbuffer.cpp @@ -378,7 +378,7 @@ void tst_QBuffer::read_rawdata() for (int i = 0; i < (int)sizeof(mydata); ++i) { QVERIFY(!buffer.atEnd()); in >> ch; - QVERIFY(ch == (quint8)mydata[i]); + QCOMPARE(ch, (quint8)mydata[i]); } QVERIFY(buffer.atEnd()); } diff --git a/tests/auto/corelib/io/qdatastream/qdatastream.pro b/tests/auto/corelib/io/qdatastream/qdatastream.pro index 9ab2b0948d..961e1933de 100644 --- a/tests/auto/corelib/io/qdatastream/qdatastream.pro +++ b/tests/auto/corelib/io/qdatastream/qdatastream.pro @@ -4,7 +4,6 @@ QT += testlib SOURCES = tst_qdatastream.cpp TESTDATA += datastream.q42 -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 android: !android-no-sdk { RESOURCES += \ diff --git a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp index d9d3f55d4a..729cf6547e 100644 --- a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp +++ b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp @@ -301,7 +301,7 @@ void tst_QDataStream::cleanupTestCase() static int dataIndex(const QString &tag) { - int pos = tag.lastIndexOf("_"); + int pos = tag.lastIndexOf(QLatin1Char('_')); if (pos >= 0) { int ret = 0; QString count = tag.mid(pos + 1); @@ -338,9 +338,9 @@ void tst_QDataStream::stream_data(int noOfElements) for (int b=0; b<2; b++) { QString byte_order = b == 0 ? "BigEndian" : "LittleEndian"; - QString tag = device + "_" + byte_order; + QString tag = device + QLatin1Char('_') + byte_order; for (int e=0; e<noOfElements; e++) { - QTest::newRow(qPrintable(tag + QString("_%1").arg(e))) << device << QString(byte_order); + QTest::newRow(qPrintable(tag + QLatin1Char('_') + QString::number(e))) << device << byte_order; } } } @@ -529,7 +529,7 @@ void tst_QDataStream::readQRegExp(QDataStream *s) *s >> R; QCOMPARE(R, test); *s >> V; - QVERIFY(V.type() == QVariant::RegExp); + QCOMPARE(V.type(), QVariant::RegExp); QCOMPARE(V.toRegExp(), test); } @@ -797,7 +797,7 @@ void tst_QDataStream::readbool(QDataStream *s) bool d1; *s >> d1; - QVERIFY(d1 == expected); + QCOMPARE(d1, expected); } // ************************************ @@ -860,7 +860,7 @@ void tst_QDataStream::readQBitArray(QDataStream *s) QBitArray d1; *s >> d1; - QVERIFY(d1 == expected); + QCOMPARE(d1, expected); } // ************************************ @@ -919,7 +919,7 @@ void tst_QDataStream::readQBrush(QDataStream *s) *s >> d2; QBrush brush = qBrushData(dataIndex(QTest::currentDataTag())); - QVERIFY(d2 == brush); + QCOMPARE(d2, brush); } // ************************************ @@ -961,7 +961,7 @@ void tst_QDataStream::readQColor(QDataStream *s) QColor test(QColorData(dataIndex(QTest::currentDataTag()))); QColor d3; *s >> d3; - QVERIFY(d3 == test); + QCOMPARE(d3, test); } @@ -1057,7 +1057,7 @@ void tst_QDataStream::readQCursor(QDataStream *s) *s >> d5; QVERIFY(d5.shape() == test.shape()); //## lacks operator== - QVERIFY(d5.hotSpot() == test.hotSpot()); + QCOMPARE(d5.hotSpot(), test.hotSpot()); QVERIFY((d5.bitmap() != 0 && test.bitmap() != 0) || (d5.bitmap() == 0 && test.bitmap() == 0)); if (d5.bitmap() != 0) { QPixmap actual = *(d5.bitmap()); @@ -1120,7 +1120,7 @@ void tst_QDataStream::readQDate(QDataStream *s) QDate test(qDateData(dataIndex(QTest::currentDataTag()))); QDate d6; *s >> d6; - QVERIFY(d6 == test); + QCOMPARE(d6, test); } // ************************************ @@ -1214,7 +1214,7 @@ void tst_QDataStream::readQTime(QDataStream *s) QTime test = qTimeData(dataIndex(QTest::currentDataTag())); QTime d7; *s >> d7; - QVERIFY(d7 == test); + QCOMPARE(d7, test); } // ************************************ @@ -1264,7 +1264,7 @@ void tst_QDataStream::readQDateTime(QDataStream *s) QDateTime test(qDateTimeData(dataIndex(QTest::currentDataTag()))); QDateTime d8; *s >> d8; - QVERIFY(d8 == test); + QCOMPARE(d8, test); } // ************************************ @@ -1415,16 +1415,16 @@ void tst_QDataStream::readQImage(QDataStream *s) QImage d12; *s >> d12; - QVERIFY(d12 == ref); + QCOMPARE(d12, ref); // do some extra neurotic tests - QVERIFY(d12.size() == ref.size()); - QVERIFY(d12.isNull() == ref.isNull()); - QVERIFY(d12.width() == ref.width()); - QVERIFY(d12.height() == ref.height()); - QVERIFY(d12.depth() == ref.depth()); - QVERIFY(d12.colorCount() == ref.colorCount()); - QVERIFY(d12.hasAlphaChannel() == ref.hasAlphaChannel()); + QCOMPARE(d12.size(), ref.size()); + QCOMPARE(d12.isNull(), ref.isNull()); + QCOMPARE(d12.width(), ref.width()); + QCOMPARE(d12.height(), ref.height()); + QCOMPARE(d12.depth(), ref.depth()); + QCOMPARE(d12.colorCount(), ref.colorCount()); + QCOMPARE(d12.hasAlphaChannel(), ref.hasAlphaChannel()); } // ************************************ @@ -1518,9 +1518,9 @@ void tst_QDataStream::readQPen(QDataStream *s) QCOMPARE(d15.style(), origPen.style()); QCOMPARE(d15.width(), origPen.width()); QCOMPARE(d15.color(), origPen.color()); - QVERIFY(d15.capStyle() == origPen.capStyle()); - QVERIFY(d15.joinStyle() == origPen.joinStyle()); - QVERIFY(d15 == origPen); + QCOMPARE(d15.capStyle(), origPen.capStyle()); + QCOMPARE(d15.joinStyle(), origPen.joinStyle()); + QCOMPARE(d15, origPen); } // ************************************ @@ -1568,11 +1568,11 @@ void tst_QDataStream::readQPixmap(QDataStream *s) QPixmap d16; *s >> d16; QVERIFY(!d16.isNull() && !pm.isNull()); - QVERIFY(d16.width() == pm.width()); - QVERIFY(d16.height() == pm.height()); - QVERIFY(d16.size() == pm.size()); - QVERIFY(d16.rect() == pm.rect()); - QVERIFY(d16.depth() == pm.depth()); + QCOMPARE(d16.width(), pm.width()); + QCOMPARE(d16.height(), pm.height()); + QCOMPARE(d16.size(), pm.size()); + QCOMPARE(d16.rect(), pm.rect()); + QCOMPARE(d16.depth(), pm.depth()); } void tst_QDataStream::writeQIcon(QDataStream *s) @@ -1639,11 +1639,11 @@ void tst_QDataStream::readQPoint(QDataStream *s) QPoint ref(qPointData(dataIndex(QTest::currentDataTag()))); QPoint d17; *s >> d17; - QVERIFY(d17 == ref); + QCOMPARE(d17, ref); QPointF d17f; *s >> d17f; - QVERIFY(d17f == QPointF(ref)); + QCOMPARE(d17f, QPointF(ref)); } // ************************************ @@ -1691,11 +1691,11 @@ void tst_QDataStream::readQRect(QDataStream *s) QRect ref(qRectData(dataIndex(QTest::currentDataTag()))); QRect d18; *s >> d18; - QVERIFY(d18 == ref); + QCOMPARE(d18, ref); QRectF d18f; *s >> d18f; - QVERIFY(d18f == QRectF(ref)); + QCOMPARE(d18f, QRectF(ref)); } // ************************************ @@ -1804,11 +1804,11 @@ void tst_QDataStream::readQPolygon(QDataStream *s) QPolygon ref(qPolygonData(dataIndex(QTest::currentDataTag()))); QPolygon d19; *s >> d19; - QVERIFY(d19 == ref); + QCOMPARE(d19, ref); QPolygonF d19f; *s >> d19f; - QVERIFY(d19f == QPolygonF(ref)); + QCOMPARE(d19f, QPolygonF(ref)); } // ************************************ @@ -1868,7 +1868,7 @@ void tst_QDataStream::readQRegion(QDataStream *s) QRegion ref(qRegionData(dataIndex(QTest::currentDataTag()))); QRegion r; *s >> r; - QVERIFY(r == ref); + QCOMPARE(r, ref); } // ************************************ @@ -1916,11 +1916,11 @@ void tst_QDataStream::readQSize(QDataStream *s) QSize ref(qSizeData(dataIndex(QTest::currentDataTag()))); QSize d21; *s >> d21; - QVERIFY(d21 == ref); + QCOMPARE(d21, ref); QSizeF d21f; *s >> d21f; - QVERIFY(d21f == QSizeF(ref)); + QCOMPARE(d21f, QSizeF(ref)); } // *********************** atEnd ****************************** @@ -2072,7 +2072,7 @@ void tst_QDataStream::setVersion_data() QDataStream latest; for (int vers = 1; vers <= latest.version(); ++vers) - QTest::newRow(qPrintable(QString("v_%1").arg(vers))) << vers; + QTest::newRow(("v_" + QByteArray::number(vers)).constData()) << vers; } void tst_QDataStream::setVersion() @@ -2096,13 +2096,13 @@ void tst_QDataStream::setVersion() QDataStream in(&ba1, QIODevice::ReadOnly); in.setVersion(vers); in >> keyseq1 >> keyseq2 >> deadbeef; - QVERIFY(keyseq1 == QKeySequence(Qt::Key_A)); + QCOMPARE(keyseq1, QKeySequence(Qt::Key_A)); if (vers >= 5) { QVERIFY(keyseq2 == QKeySequence(Qt::Key_B, Qt::Key_C)); } else { - QVERIFY(keyseq2 == QKeySequence(Qt::Key_B)); + QCOMPARE(keyseq2, QKeySequence(Qt::Key_B)); } - QVERIFY(deadbeef == 0xDEADBEEF); + QCOMPARE(deadbeef, 0xDEADBEEF); } /* @@ -2111,7 +2111,7 @@ void tst_QDataStream::setVersion() // revise the test if new color roles or color groups are added QVERIFY(QPalette::NColorRoles == QPalette::ToolTipText + 1); - QVERIFY(QPalette::NColorGroups == 3); + QCOMPARE(int(QPalette::NColorGroups), 3); QByteArray ba2; QPalette pal1, pal2; @@ -2176,8 +2176,8 @@ void tst_QDataStream::setVersion() } } } - QVERIFY(pal1 == inPal1); - QVERIFY(pal2 == inPal2); + QCOMPARE(pal1, inPal1); + QCOMPARE(pal2, inPal2); } } } @@ -3062,9 +3062,9 @@ void tst_QDataStream::compatibility_Qt3() in >> in_palette; in >> in_brush; } - QVERIFY(in_brush.style() == Qt::NoBrush); - QVERIFY(in_palette.brush(QPalette::Button).style() == Qt::NoBrush); - QVERIFY(in_palette.color(QPalette::Light) == Qt::green); + QCOMPARE(in_brush.style(), Qt::NoBrush); + QCOMPARE(in_palette.brush(QPalette::Button).style(), Qt::NoBrush); + QCOMPARE(in_palette.color(QPalette::Light), QColor(Qt::green)); } } @@ -3094,9 +3094,9 @@ void tst_QDataStream::compatibility_Qt2() in >> in_palette; in >> in_brush; } - QVERIFY(in_brush.style() == Qt::NoBrush); - QVERIFY(in_palette.brush(QPalette::Button).style() == Qt::NoBrush); - QVERIFY(in_palette.color(QPalette::Light) == Qt::green); + QCOMPARE(in_brush.style(), Qt::NoBrush); + QCOMPARE(in_palette.brush(QPalette::Button).style(), Qt::NoBrush); + QCOMPARE(in_palette.color(QPalette::Light), QColor(Qt::green)); } void tst_QDataStream::floatingPointNaN() diff --git a/tests/auto/corelib/io/qdataurl/qdataurl.pro b/tests/auto/corelib/io/qdataurl/qdataurl.pro index d21fc4ed15..7085c9d881 100644 --- a/tests/auto/corelib/io/qdataurl/qdataurl.pro +++ b/tests/auto/corelib/io/qdataurl/qdataurl.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qdataurl QT = core core-private testlib SOURCES = tst_qdataurl.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qdebug/qdebug.pro b/tests/auto/corelib/io/qdebug/qdebug.pro index 5e902bb105..45c0aa4061 100644 --- a/tests/auto/corelib/io/qdebug/qdebug.pro +++ b/tests/auto/corelib/io/qdebug/qdebug.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qdebug QT = core testlib concurrent SOURCES = tst_qdebug.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qdir/qdir.pro b/tests/auto/corelib/io/qdir/qdir.pro index 0adc7e0450..26bc60a731 100644 --- a/tests/auto/corelib/io/qdir/qdir.pro +++ b/tests/auto/corelib/io/qdir/qdir.pro @@ -5,7 +5,6 @@ SOURCES = tst_qdir.cpp RESOURCES += qdir.qrc TESTDATA += testdir testData searchdir resources entrylist types tst_qdir.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 android:!android-no-sdk { RESOURCES += android_testdata.qrc diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp index ae6fe7eaef..008293a15e 100644 --- a/tests/auto/corelib/io/qdir/tst_qdir.cpp +++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp @@ -556,7 +556,7 @@ void tst_QDir::exists_data() char drive = 'Z'; QString driv; do { - driv = QString::fromLatin1("%1:/").arg(drive); + driv = drive + QLatin1String(":/"); if (!driveLetters.contains(driv)) break; --drive; } while (drive >= 'A'); @@ -621,7 +621,7 @@ void tst_QDir::compare() dir.makeAbsolute(); QVERIFY(dir == QDir::currentPath()); - QVERIFY(QDir() == QDir(QDir::currentPath())); + QCOMPARE(QDir(), QDir(QDir::currentPath())); QVERIFY(QDir("../") == QDir(QDir::currentPath() + "/..")); } @@ -1058,7 +1058,7 @@ void tst_QDir::current() if (!path.isEmpty()) { bool b = QDir::setCurrent(path); // If path is non existent, then setCurrent should be false (currentDir is empty in testData) - QVERIFY(b == !currentDir.isEmpty()); + QCOMPARE(b, !currentDir.isEmpty()); } if (!currentDir.isEmpty()) { QDir newCurrent = QDir::current(); @@ -1080,7 +1080,7 @@ void tst_QDir::cd_data() QTest::addColumn<bool>("successExpected"); QTest::addColumn<QString>("newDir"); - int index = m_dataPath.lastIndexOf("/"); + int index = m_dataPath.lastIndexOf(QLatin1Char('/')); QTest::newRow("cdUp") << m_dataPath << ".." << true << m_dataPath.left(index==0?1:index); QTest::newRow("cdUp non existent (relative dir)") << "anonexistingDir" << ".." << true << m_dataPath; @@ -1124,11 +1124,11 @@ void tst_QDir::setNameFilters_data() QTest::newRow("spaces2") << m_dataPath + "/testdir/spaces" << QStringList("*.bar") << QStringList("foo.bar"); QTest::newRow("spaces3") << m_dataPath + "/testdir/spaces" << QStringList("foo.*") - << QString("foo. bar,foo.bar").split(","); - QTest::newRow("files1") << m_dataPath + "/testdir/dir" << QString("*r.cpp *.pro").split(" ") - << QString("qdir.pro,qrc_qdir.cpp,tst_qdir.cpp").split(","); + << QString("foo. bar,foo.bar").split(QLatin1Char(',')); + QTest::newRow("files1") << m_dataPath + "/testdir/dir" << QString("*r.cpp *.pro").split(QLatin1Char(' ')) + << QString("qdir.pro,qrc_qdir.cpp,tst_qdir.cpp").split(QLatin1Char(',')); QTest::newRow("resources1") << QString(":/tst_qdir/resources/entryList") << QStringList("*.data") - << QString("file1.data,file2.data,file3.data").split(','); + << QString("file1.data,file2.data,file3.data").split(QLatin1Char(',')); } void tst_QDir::setNameFilters() @@ -1695,7 +1695,7 @@ void tst_QDir::searchPaths() QDir::setSearchPaths(searchPathPrefixList.at(i), searchPathsList.at(i).split(",")); } for (int i = 0; i < searchPathPrefixList.count(); ++i) { - QVERIFY(QDir::searchPaths(searchPathPrefixList.at(i)) == searchPathsList.at(i).split(",")); + QCOMPARE(QDir::searchPaths(searchPathPrefixList.at(i)), searchPathsList.at(i).split(",")); } QCOMPARE(QFile(filename).exists(), exists); @@ -1718,7 +1718,7 @@ void tst_QDir::searchPaths() } } for (int i = 0; i < searchPathPrefixList.count(); ++i) { - QVERIFY(QDir::searchPaths(searchPathPrefixList.at(i)) == searchPathsList.at(i).split(",")); + QCOMPARE(QDir::searchPaths(searchPathPrefixList.at(i)), searchPathsList.at(i).split(",")); } QCOMPARE(QFile(filename).exists(), exists); diff --git a/tests/auto/corelib/io/qdiriterator/qdiriterator.pro b/tests/auto/corelib/io/qdiriterator/qdiriterator.pro index a2429bf2f0..2b50f97ac5 100644 --- a/tests/auto/corelib/io/qdiriterator/qdiriterator.pro +++ b/tests/auto/corelib/io/qdiriterator/qdiriterator.pro @@ -7,6 +7,5 @@ RESOURCES += qdiriterator.qrc TESTDATA += entrylist wince*mips*|wincewm50smart-msvc200*: DEFINES += WINCE_BROKEN_ITERATE=1 -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 win32: CONFIG += insignificant_test # Crashes on Windows in release builds diff --git a/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp b/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp index 6b1719ad53..9e368515e4 100644 --- a/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp +++ b/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp @@ -538,7 +538,7 @@ void tst_QDirIterator::recurseWithFilters() const QVERIFY(it.hasNext()); it.next(); actualEntries.insert(it.fileInfo().filePath()); - QVERIFY(actualEntries == expectedEntries); + QCOMPARE(actualEntries, expectedEntries); QVERIFY(!it.hasNext()); } diff --git a/tests/auto/corelib/io/qfile/qfile.pro b/tests/auto/corelib/io/qfile/qfile.pro index e2c714c67f..10c8d918f7 100644 --- a/tests/auto/corelib/io/qfile/qfile.pro +++ b/tests/auto/corelib/io/qfile/qfile.pro @@ -5,4 +5,3 @@ wince* { SUBDIRS = test stdinprocess } -CONFIG += parallel_test diff --git a/tests/auto/corelib/io/qfile/stdinprocess/stdinprocess.pro b/tests/auto/corelib/io/qfile/stdinprocess/stdinprocess.pro index 51badce898..8e463e4cef 100644 --- a/tests/auto/corelib/io/qfile/stdinprocess/stdinprocess.pro +++ b/tests/auto/corelib/io/qfile/stdinprocess/stdinprocess.pro @@ -6,4 +6,3 @@ CONFIG += console # This app is testdata for tst_qfile target.path = $$[QT_INSTALL_TESTS]/tst_qfile/$$TARGET INSTALLS += target -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qfile/test/test.pro b/tests/auto/corelib/io/qfile/test/test.pro index 9aa4119795..c9ba96cc1b 100644 --- a/tests/auto/corelib/io/qfile/test/test.pro +++ b/tests/auto/corelib/io/qfile/test/test.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test CONFIG -= app_bundle debug_and_release_target QT = core-private core testlib qtHaveModule(network): QT += network @@ -17,4 +16,3 @@ TESTDATA += ../dosfile.txt ../noendofline.txt ../testfile.txt \ ../resources/file1.ext1 win32:!winrt: LIBS+=-lole32 -luuid -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index 1c695a1113..b4140e1115 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -849,7 +849,7 @@ void tst_QFile::readAll() QByteArray a = file.readAll(); file.reset(); - QVERIFY(file.pos() == 0); + QCOMPARE(file.pos(), 0); QVERIFY(file.bytesAvailable() > 7); QByteArray b = file.read(1); @@ -1195,7 +1195,7 @@ void tst_QFile::append() f.close(); QVERIFY2(f.open(QIODevice::Append), msgOpenFailed(f).constData()); - QVERIFY(f.pos() == 1); + QCOMPARE(f.pos(), 1); f.putChar('a'); f.close(); QCOMPARE(int(f.size()), 2); @@ -2047,7 +2047,7 @@ void tst_QFile::longFileName() QString line = ts.readLine(); QCOMPARE(line, fileName); } - QString newName = fileName + QLatin1String("1"); + QString newName = fileName + QLatin1Char('1'); { QVERIFY(QFile::copy(fileName, newName)); QFile file(newName); @@ -2224,7 +2224,7 @@ void tst_QFile::removeOpenFile() QVERIFY(removed); QVERIFY(!f.isOpen()); QVERIFY(!f.exists()); - QVERIFY(f.error() == QFile::NoError); + QCOMPARE(f.error(), QFile::NoError); } { @@ -2251,7 +2251,7 @@ void tst_QFile::removeOpenFile() QVERIFY(removed); QVERIFY(!f.isOpen()); QVERIFY(!f.exists()); - QVERIFY(f.error() == QFile::NoError); + QCOMPARE(f.error(), QFile::NoError); } } @@ -2819,13 +2819,13 @@ void tst_QFile::readEof() char buf[10]; int ret = file.read(buf, sizeof buf); QCOMPARE(ret, 0); - QVERIFY(file.error() == QFile::NoError); + QCOMPARE(file.error(), QFile::NoError); QVERIFY(file.atEnd()); // Do it again to ensure that we get the same result ret = file.read(buf, sizeof buf); QCOMPARE(ret, 0); - QVERIFY(file.error() == QFile::NoError); + QCOMPARE(file.error(), QFile::NoError); QVERIFY(file.atEnd()); } @@ -2840,13 +2840,13 @@ void tst_QFile::readEof() QByteArray ret = file.read(10); QVERIFY(ret.isEmpty()); - QVERIFY(file.error() == QFile::NoError); + QCOMPARE(file.error(), QFile::NoError); QVERIFY(file.atEnd()); // Do it again to ensure that we get the same result ret = file.read(10); QVERIFY(ret.isEmpty()); - QVERIFY(file.error() == QFile::NoError); + QCOMPARE(file.error(), QFile::NoError); QVERIFY(file.atEnd()); } @@ -2862,13 +2862,13 @@ void tst_QFile::readEof() char buf[10]; int ret = file.readLine(buf, sizeof buf); QCOMPARE(ret, -1); - QVERIFY(file.error() == QFile::NoError); + QCOMPARE(file.error(), QFile::NoError); QVERIFY(file.atEnd()); // Do it again to ensure that we get the same result ret = file.readLine(buf, sizeof buf); QCOMPARE(ret, -1); - QVERIFY(file.error() == QFile::NoError); + QCOMPARE(file.error(), QFile::NoError); QVERIFY(file.atEnd()); } @@ -2883,13 +2883,13 @@ void tst_QFile::readEof() QByteArray ret = file.readLine(); QVERIFY(ret.isNull()); - QVERIFY(file.error() == QFile::NoError); + QCOMPARE(file.error(), QFile::NoError); QVERIFY(file.atEnd()); // Do it again to ensure that we get the same result ret = file.readLine(); QVERIFY(ret.isNull()); - QVERIFY(file.error() == QFile::NoError); + QCOMPARE(file.error(), QFile::NoError); QVERIFY(file.atEnd()); } @@ -2904,12 +2904,12 @@ void tst_QFile::readEof() char c; QVERIFY(!file.getChar(&c)); - QVERIFY(file.error() == QFile::NoError); + QCOMPARE(file.error(), QFile::NoError); QVERIFY(file.atEnd()); // Do it again to ensure that we get the same result QVERIFY(!file.getChar(&c)); - QVERIFY(file.error() == QFile::NoError); + QCOMPARE(file.error(), QFile::NoError); QVERIFY(file.atEnd()); } } @@ -2997,7 +2997,7 @@ void tst_QFile::map() memory = file.map(offset, size); QCOMPARE(file.error(), QFile::NoError); QVERIFY(memory); - QVERIFY(memory[0] == 'Q'); + QCOMPARE(memory[0], uchar('Q')); QVERIFY(file.unmap(memory)); QCOMPARE(file.error(), QFile::NoError); diff --git a/tests/auto/corelib/io/qfileinfo/qfileinfo.pro b/tests/auto/corelib/io/qfileinfo/qfileinfo.pro index 571637be37..8aa81896cc 100644 --- a/tests/auto/corelib/io/qfileinfo/qfileinfo.pro +++ b/tests/auto/corelib/io/qfileinfo/qfileinfo.pro @@ -6,6 +6,5 @@ RESOURCES += qfileinfo.qrc \ testdata.qrc win32:!wince:!winrt:LIBS += -ladvapi32 -lnetapi32 -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 win32: CONFIG += insignificant_test # Crashes on Windows in release builds diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp index 210fdb5a12..1d49c8e3b9 100644 --- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp @@ -1097,7 +1097,7 @@ void tst_QFileInfo::consistent() QFileInfo fi(file); QCOMPARE(fi.filePath(), expected); - QCOMPARE(fi.dir().path() + "/" + fi.fileName(), expected); + QCOMPARE(fi.dir().path() + QLatin1Char('/') + fi.fileName(), expected); } @@ -1429,7 +1429,7 @@ void tst_QFileInfo::refresh() QCOMPARE(file.write("JOJOJO"), qint64(6)); file.flush(); - QVERIFY(info.lastModified() == lastModified); + QCOMPARE(info.lastModified(), lastModified); QCOMPARE(info.size(), qint64(7)); #if defined(Q_OS_WIN) || defined(Q_OS_WINCE) diff --git a/tests/auto/corelib/io/qfileselector/qfileselector.pro b/tests/auto/corelib/io/qfileselector/qfileselector.pro index ded3d6502e..edcc91e8ed 100644 --- a/tests/auto/corelib/io/qfileselector/qfileselector.pro +++ b/tests/auto/corelib/io/qfileselector/qfileselector.pro @@ -1,4 +1,3 @@ -CONFIG += parallel_test CONFIG += testcase TARGET = tst_qfileselectors QT = core-private testlib diff --git a/tests/auto/corelib/io/qfilesystementry/qfilesystementry.pro b/tests/auto/corelib/io/qfilesystementry/qfilesystementry.pro index 99d3af1848..474836fba2 100644 --- a/tests/auto/corelib/io/qfilesystementry/qfilesystementry.pro +++ b/tests/auto/corelib/io/qfilesystementry/qfilesystementry.pro @@ -1,7 +1,6 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qfilesystementry QT = core-private testlib SOURCES = tst_qfilesystementry.cpp \ $$QT_SOURCE_TREE/src/corelib/io/qfilesystementry.cpp HEADERS = $$QT_SOURCE_TREE/src/corelib/io/qfilesystementry_p.h -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qfilesystemwatcher/qfilesystemwatcher.pro b/tests/auto/corelib/io/qfilesystemwatcher/qfilesystemwatcher.pro index 1faa089c6e..46dd70289b 100644 --- a/tests/auto/corelib/io/qfilesystemwatcher/qfilesystemwatcher.pro +++ b/tests/auto/corelib/io/qfilesystemwatcher/qfilesystemwatcher.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qfilesystemwatcher QT = core testlib SOURCES = tst_qfilesystemwatcher.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp index 026743257c..e8bbaa1b25 100644 --- a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp +++ b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp @@ -731,9 +731,10 @@ void tst_QFileSystemWatcher::signalsEmittedAfterFileMoved() QString movePath = testDir.filePath("movehere"); for (int i = 0; i < fileCount; ++i) { - QFile f(testDir.filePath(QString("test%1.txt").arg(i))); + const QByteArray iB = QByteArray::number(i); + QFile f(testDir.filePath(QLatin1String("test") + QString::fromLatin1(iB) + QLatin1String(".txt"))); QVERIFY(f.open(QIODevice::WriteOnly)); - f.write(QByteArray("i am ") + QByteArray::number(i)); + f.write(QByteArray("i am ") + iB); f.close(); } diff --git a/tests/auto/corelib/io/qiodevice/qiodevice.pro b/tests/auto/corelib/io/qiodevice/qiodevice.pro index 9fd70fb177..78f5b5e75d 100644 --- a/tests/auto/corelib/io/qiodevice/qiodevice.pro +++ b/tests/auto/corelib/io/qiodevice/qiodevice.pro @@ -5,7 +5,6 @@ SOURCES = tst_qiodevice.cpp TESTDATA += tst_qiodevice.cpp MOC_DIR=tmp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 android:!android-no-sdk: { RESOURCES += \ diff --git a/tests/auto/corelib/io/qipaddress/qipaddress.pro b/tests/auto/corelib/io/qipaddress/qipaddress.pro index ff569aa3d5..9c769052ed 100644 --- a/tests/auto/corelib/io/qipaddress/qipaddress.pro +++ b/tests/auto/corelib/io/qipaddress/qipaddress.pro @@ -1,5 +1,4 @@ SOURCES += tst_qipaddress.cpp TARGET = tst_qipaddress QT = core core-private testlib -CONFIG += testcase parallel_test -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 +CONFIG += testcase diff --git a/tests/auto/corelib/io/qnodebug/qnodebug.pro b/tests/auto/corelib/io/qnodebug/qnodebug.pro index ff8e09b84b..7e35f92474 100644 --- a/tests/auto/corelib/io/qnodebug/qnodebug.pro +++ b/tests/auto/corelib/io/qnodebug/qnodebug.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qnodebug QT = core testlib SOURCES = tst_qnodebug.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp b/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp index 5ece9190a5..304cf7b551 100644 --- a/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp +++ b/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp @@ -69,8 +69,9 @@ void tst_QNoDebug::noDebugOutput() const void tst_QNoDebug::streaming() const { QDateTime dt(QDate(1,2,3),QTime(4,5,6)); - const QString debugString = dt.toString(QStringLiteral("yyyy-MM-dd HH:mm:ss.zzz t")); - QTest::ignoreMessage(QtWarningMsg, qPrintable(QString::fromLatin1("QDateTime(%1 Qt::TimeSpec(LocalTime))").arg(debugString))); + const QByteArray debugString = dt.toString(QStringLiteral("yyyy-MM-dd HH:mm:ss.zzz t")).toLatin1(); + const QByteArray message = "QDateTime(" + debugString + " Qt::TimeSpec(LocalTime))"; + QTest::ignoreMessage(QtWarningMsg, message.constData()); qWarning() << dt; } diff --git a/tests/auto/corelib/io/qprocess-noapplication/qprocess-noapplication.pro b/tests/auto/corelib/io/qprocess-noapplication/qprocess-noapplication.pro index 2f409ebdbc..e46e7e1100 100644 --- a/tests/auto/corelib/io/qprocess-noapplication/qprocess-noapplication.pro +++ b/tests/auto/corelib/io/qprocess-noapplication/qprocess-noapplication.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test CONFIG -= app_bundle debug_and_release_target QT = core testlib SOURCES = tst_qprocessnoapplication.cpp diff --git a/tests/auto/corelib/io/qprocess/fileWriterProcess/fileWriterProcess.pro b/tests/auto/corelib/io/qprocess/fileWriterProcess/fileWriterProcess.pro index 55e9b05d1a..947dc916f2 100644 --- a/tests/auto/corelib/io/qprocess/fileWriterProcess/fileWriterProcess.pro +++ b/tests/auto/corelib/io/qprocess/fileWriterProcess/fileWriterProcess.pro @@ -3,4 +3,3 @@ CONFIG += console CONFIG -= app_bundle QT = core DESTDIR = ./ -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qprocess/test/test.pro b/tests/auto/corelib/io/qprocess/test/test.pro index f77dacc87b..96d105a4b4 100644 --- a/tests/auto/corelib/io/qprocess/test/test.pro +++ b/tests/auto/corelib/io/qprocess/test/test.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test CONFIG -= app_bundle debug_and_release_target QT = core-private testlib network SOURCES = ../tst_qprocess.cpp @@ -19,4 +18,3 @@ TEST_HELPER_INSTALLS += \ "../testProcessSpacesArgs/one space" \ "../testProcessSpacesArgs/two space s" \ "../test Space In Name/testSpaceInName" -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qprocess/testDetached/testDetached.pro b/tests/auto/corelib/io/qprocess/testDetached/testDetached.pro index 961b28ec7d..8d1fcba624 100644 --- a/tests/auto/corelib/io/qprocess/testDetached/testDetached.pro +++ b/tests/auto/corelib/io/qprocess/testDetached/testDetached.pro @@ -4,4 +4,3 @@ CONFIG += console CONFIG -= app_bundle INSTALLS = DESTDIR = ./ -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qprocess/testExitCodes/testExitCodes.pro b/tests/auto/corelib/io/qprocess/testExitCodes/testExitCodes.pro index 049454abe2..b08371804f 100644 --- a/tests/auto/corelib/io/qprocess/testExitCodes/testExitCodes.pro +++ b/tests/auto/corelib/io/qprocess/testExitCodes/testExitCodes.pro @@ -3,4 +3,3 @@ CONFIG -= qt app_bundle CONFIG += console DESTDIR = ./ -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qprocess/testGuiProcess/testGuiProcess.pro b/tests/auto/corelib/io/qprocess/testGuiProcess/testGuiProcess.pro index d3439072bb..8778da7ffe 100644 --- a/tests/auto/corelib/io/qprocess/testGuiProcess/testGuiProcess.pro +++ b/tests/auto/corelib/io/qprocess/testGuiProcess/testGuiProcess.pro @@ -3,4 +3,3 @@ QT += widgets CONFIG += console CONFIG -= app_bundle DESTDIR = ./ -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qprocess/testProcessCrash/testProcessCrash.pro b/tests/auto/corelib/io/qprocess/testProcessCrash/testProcessCrash.pro index f7c57abc37..7ccc976efc 100644 --- a/tests/auto/corelib/io/qprocess/testProcessCrash/testProcessCrash.pro +++ b/tests/auto/corelib/io/qprocess/testProcessCrash/testProcessCrash.pro @@ -3,4 +3,3 @@ CONFIG += console CONFIG -= qt app_bundle DESTDIR = ./ -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/testProcessDeadWhileReading.pro b/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/testProcessDeadWhileReading.pro index 56b4642bed..fbb3411d47 100644 --- a/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/testProcessDeadWhileReading.pro +++ b/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/testProcessDeadWhileReading.pro @@ -3,4 +3,3 @@ CONFIG -= qt app_bundle CONFIG += console DESTDIR = ./ -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qprocess/testProcessEOF/testProcessEOF.pro b/tests/auto/corelib/io/qprocess/testProcessEOF/testProcessEOF.pro index 8f77e46f74..98fe78c8b9 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEOF/testProcessEOF.pro +++ b/tests/auto/corelib/io/qprocess/testProcessEOF/testProcessEOF.pro @@ -4,4 +4,3 @@ CONFIG += console win32:!mingw:!equals(TEMPLATE_PREFIX, "vc"):QMAKE_CXXFLAGS += /GS- DESTDIR = ./ -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qprocess/testProcessEcho/testProcessEcho.pro b/tests/auto/corelib/io/qprocess/testProcessEcho/testProcessEcho.pro index 3940ddbf98..e236e05c7d 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEcho/testProcessEcho.pro +++ b/tests/auto/corelib/io/qprocess/testProcessEcho/testProcessEcho.pro @@ -2,4 +2,3 @@ SOURCES = main.cpp CONFIG -= qt app_bundle CONFIG += console DESTDIR = ./ -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qprocess/testProcessEcho2/testProcessEcho2.pro b/tests/auto/corelib/io/qprocess/testProcessEcho2/testProcessEcho2.pro index 3940ddbf98..e236e05c7d 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEcho2/testProcessEcho2.pro +++ b/tests/auto/corelib/io/qprocess/testProcessEcho2/testProcessEcho2.pro @@ -2,4 +2,3 @@ SOURCES = main.cpp CONFIG -= qt app_bundle CONFIG += console DESTDIR = ./ -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qprocess/testProcessEcho3/testProcessEcho3.pro b/tests/auto/corelib/io/qprocess/testProcessEcho3/testProcessEcho3.pro index 3940ddbf98..e236e05c7d 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEcho3/testProcessEcho3.pro +++ b/tests/auto/corelib/io/qprocess/testProcessEcho3/testProcessEcho3.pro @@ -2,4 +2,3 @@ SOURCES = main.cpp CONFIG -= qt app_bundle CONFIG += console DESTDIR = ./ -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qprocess/testProcessEnvironment/testProcessEnvironment.pro b/tests/auto/corelib/io/qprocess/testProcessEnvironment/testProcessEnvironment.pro index 962c1122c1..a07ae00605 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEnvironment/testProcessEnvironment.pro +++ b/tests/auto/corelib/io/qprocess/testProcessEnvironment/testProcessEnvironment.pro @@ -6,4 +6,3 @@ DESTDIR = ./ mac { CONFIG -= app_bundle } -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qprocess/testProcessNormal/testProcessNormal.pro b/tests/auto/corelib/io/qprocess/testProcessNormal/testProcessNormal.pro index f7bb0985a3..c6db9d1bac 100644 --- a/tests/auto/corelib/io/qprocess/testProcessNormal/testProcessNormal.pro +++ b/tests/auto/corelib/io/qprocess/testProcessNormal/testProcessNormal.pro @@ -3,5 +3,4 @@ CONFIG += console CONFIG -= qt app_bundle DESTDIR = ./ -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 QT = core diff --git a/tests/auto/corelib/io/qprocess/testProcessOutput/testProcessOutput.pro b/tests/auto/corelib/io/qprocess/testProcessOutput/testProcessOutput.pro index 2de4534896..95191098bd 100644 --- a/tests/auto/corelib/io/qprocess/testProcessOutput/testProcessOutput.pro +++ b/tests/auto/corelib/io/qprocess/testProcessOutput/testProcessOutput.pro @@ -2,5 +2,4 @@ SOURCES = main.cpp CONFIG -= qt app_bundle CONFIG += console DESTDIR = ./ -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 QT = core diff --git a/tests/auto/corelib/io/qprocess/testSetWorkingDirectory/testSetWorkingDirectory.pro b/tests/auto/corelib/io/qprocess/testSetWorkingDirectory/testSetWorkingDirectory.pro index d425d5569e..21a115b536 100644 --- a/tests/auto/corelib/io/qprocess/testSetWorkingDirectory/testSetWorkingDirectory.pro +++ b/tests/auto/corelib/io/qprocess/testSetWorkingDirectory/testSetWorkingDirectory.pro @@ -2,5 +2,4 @@ SOURCES = main.cpp CONFIG += console CONFIG -= app_bundle DESTDIR = ./ -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 QT = core diff --git a/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro b/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro index b59241851f..d19a631cae 100644 --- a/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro +++ b/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro @@ -9,5 +9,4 @@ unix { CONFIG -= qt app_bundle CONFIG += console DESTDIR = ./ -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 QT = core diff --git a/tests/auto/corelib/io/qprocess/testSpaceInName/testSpaceInName.pro b/tests/auto/corelib/io/qprocess/testSpaceInName/testSpaceInName.pro index b7213ae507..afa4f32a85 100644 --- a/tests/auto/corelib/io/qprocess/testSpaceInName/testSpaceInName.pro +++ b/tests/auto/corelib/io/qprocess/testSpaceInName/testSpaceInName.pro @@ -6,5 +6,4 @@ DESTDIR = "../test Space In Name" mac { CONFIG -= app_bundle } -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 QT = core diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp index 45d6cf3dcd..83da28767f 100644 --- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp +++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp @@ -845,11 +845,11 @@ void tst_QProcess::openModes() { QProcess proc; QVERIFY(!proc.isOpen()); - QVERIFY(proc.openMode() == QProcess::NotOpen); + QCOMPARE(proc.openMode(), QProcess::NotOpen); proc.start("testProcessEcho3/testProcessEcho3"); QVERIFY(proc.waitForStarted(5000)); QVERIFY(proc.isOpen()); - QVERIFY(proc.openMode() == QProcess::ReadWrite); + QCOMPARE(proc.openMode(), QProcess::ReadWrite); QVERIFY(proc.isReadable()); QVERIFY(proc.isWritable()); @@ -858,7 +858,7 @@ void tst_QProcess::openModes() proc.closeWriteChannel(); QVERIFY(proc.isWritable()); - QVERIFY(proc.openMode() == QProcess::ReadWrite); + QCOMPARE(proc.openMode(), QProcess::ReadWrite); while (proc.bytesAvailable() < 4 && proc.waitForReadyRead(5000)) { } @@ -867,12 +867,12 @@ void tst_QProcess::openModes() proc.closeReadChannel(QProcess::StandardOutput); - QVERIFY(proc.openMode() == QProcess::ReadWrite); + QCOMPARE(proc.openMode(), QProcess::ReadWrite); QVERIFY(proc.isReadable()); proc.closeReadChannel(QProcess::StandardError); - QVERIFY(proc.openMode() == QProcess::ReadWrite); + QCOMPARE(proc.openMode(), QProcess::ReadWrite); QVERIFY(proc.isReadable()); proc.close(); @@ -1444,11 +1444,11 @@ void tst_QProcess::spaceArgsTest() QCOMPARE(actual, args); #endif - if (program.contains(" ")) - program = "\"" + program + "\""; + if (program.contains(QLatin1Char(' '))) + program = QLatin1Char('"') + program + QLatin1Char('"'); if (!stringArgs.isEmpty()) - program += QString::fromLatin1(" ") + stringArgs; + program += QLatin1Char(' ') + stringArgs; errorMessage.clear(); process.start(program); @@ -1501,9 +1501,9 @@ void tst_QProcess::nativeArguments() char buf[256]; fgets(buf, 256, file); fclose(file); - QStringList actual = QString::fromLatin1(buf).split("|"); + QStringList actual = QString::fromLatin1(buf).split(QLatin1Char('|')); #else - QStringList actual = QString::fromLatin1(proc.readAll()).split("|"); + QStringList actual = QString::fromLatin1(proc.readAll()).split(QLatin1Char('|')); #endif QVERIFY(!actual.isEmpty()); // not interested in the program name, it might be different. @@ -2302,6 +2302,13 @@ void tst_QProcess::setNonExistentWorkingDirectory() QEXPECT_FAIL("", "QProcess cannot detect failure to start when using posix_spawn()", Continue); #endif QCOMPARE(int(process.error()), int(QProcess::FailedToStart)); + +#ifdef Q_OS_UNIX +# ifdef QPROCESS_USE_SPAWN + QEXPECT_FAIL("", "QProcess cannot detect failure to start when using posix_spawn()", Continue); +# endif + QVERIFY2(process.errorString().startsWith("chdir:"), process.errorString().toLocal8Bit()); +#endif } #endif diff --git a/tests/auto/corelib/io/qprocessenvironment/qprocessenvironment.pro b/tests/auto/corelib/io/qprocessenvironment/qprocessenvironment.pro index 760fa11b9e..04cef29a64 100644 --- a/tests/auto/corelib/io/qprocessenvironment/qprocessenvironment.pro +++ b/tests/auto/corelib/io/qprocessenvironment/qprocessenvironment.pro @@ -1,5 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qprocessenvironment QT = core testlib SOURCES = tst_qprocessenvironment.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp b/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp index 2099101a91..2bf2696639 100644 --- a/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp +++ b/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp @@ -57,25 +57,25 @@ private slots: void tst_QProcessEnvironment::operator_eq() { QProcessEnvironment e1; - QVERIFY(e1 == e1); + QCOMPARE(e1, e1); e1.clear(); - QVERIFY(e1 == e1); + QCOMPARE(e1, e1); e1 = QProcessEnvironment(); QProcessEnvironment e2; - QVERIFY(e1 == e2); + QCOMPARE(e1, e2); e1.clear(); - QVERIFY(e1 == e2); + QCOMPARE(e1, e2); e2.clear(); - QVERIFY(e1 == e2); + QCOMPARE(e1, e2); e1.insert("FOO", "bar"); QVERIFY(e1 != e2); e2.insert("FOO", "bar"); - QVERIFY(e1 == e2); + QCOMPARE(e1, e2); e2.insert("FOO", "baz"); QVERIFY(e1 != e2); @@ -212,7 +212,7 @@ void tst_QProcessEnvironment::insertEnv() e3.insert(e3); // mustn't deadlock - QVERIFY(e3 == e2); + QCOMPARE(e3, e2); } void tst_QProcessEnvironment::caseSensitivity() diff --git a/tests/auto/corelib/io/qresourceengine/qresourceengine.pro b/tests/auto/corelib/io/qresourceengine/qresourceengine.pro index 64f5cb46e0..e8b82b4df7 100644 --- a/tests/auto/corelib/io/qresourceengine/qresourceengine.pro +++ b/tests/auto/corelib/io/qresourceengine/qresourceengine.pro @@ -1,4 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qresourceengine load(resources) QT = core testlib @@ -16,7 +16,6 @@ TESTDATA += \ parentdir.txt \ testqrc/* GENERATED_TESTDATA = $${runtime_resource.target} -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 android:!android-no-sdk { RESOURCES += android_testdata.qrc diff --git a/tests/auto/corelib/io/qsavefile/qsavefile.pro b/tests/auto/corelib/io/qsavefile/qsavefile.pro index 36db000fa7..dd22d69ce6 100644 --- a/tests/auto/corelib/io/qsavefile/qsavefile.pro +++ b/tests/auto/corelib/io/qsavefile/qsavefile.pro @@ -1,4 +1,4 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qsavefile QT = core testlib SOURCES = tst_qsavefile.cpp diff --git a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp index 19155cc3ad..b0cb59a012 100644 --- a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp +++ b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp @@ -121,6 +121,7 @@ private slots: void testEmptyKey(); void testResourceFiles(); void testRegistryShortRootNames(); + void testRegistry32And64Bit(); void trailingWhitespace(); #ifdef Q_OS_MAC void fileName(); @@ -276,8 +277,8 @@ void tst_QSettings::initTestCase() , Qt::CaseInsensitive #endif ); - QVERIFY(custom1 == QSettings::CustomFormat1); - QVERIFY(custom2 == QSettings::CustomFormat2); + QCOMPARE(custom1, QSettings::CustomFormat1); + QCOMPARE(custom2, QSettings::CustomFormat2); cleanupTestFiles(); } @@ -357,27 +358,27 @@ void tst_QSettings::ctor() QSettings settings8(format, QSettings::SystemScope, "software.org"); // test QSettings::format() while we're at it - QVERIFY(settings1.format() == format); - QVERIFY(settings2.format() == format); - QVERIFY(settings3.format() == format); - QVERIFY(settings4.format() == format); + QCOMPARE(settings1.format(), format); + QCOMPARE(settings2.format(), format); + QCOMPARE(settings3.format(), format); + QCOMPARE(settings4.format(), format); // test QSettings::scope() while we're at it - QVERIFY(settings1.scope() == QSettings::UserScope); - QVERIFY(settings2.scope() == QSettings::UserScope); - QVERIFY(settings3.scope() == QSettings::SystemScope); - QVERIFY(settings4.scope() == QSettings::SystemScope); + QCOMPARE(settings1.scope(), QSettings::UserScope); + QCOMPARE(settings2.scope(), QSettings::UserScope); + QCOMPARE(settings3.scope(), QSettings::SystemScope); + QCOMPARE(settings4.scope(), QSettings::SystemScope); // test QSettings::organizationName() while we're at it - QVERIFY(settings1.organizationName() == "software.org"); - QVERIFY(settings2.organizationName() == "software.org"); - QVERIFY(settings3.organizationName() == "software.org"); - QVERIFY(settings4.organizationName() == "software.org"); + QCOMPARE(settings1.organizationName(), QLatin1String("software.org")); + QCOMPARE(settings2.organizationName(), QLatin1String("software.org")); + QCOMPARE(settings3.organizationName(), QLatin1String("software.org")); + QCOMPARE(settings4.organizationName(), QLatin1String("software.org")); // test QSettings::applicationName() while we're at it QCOMPARE(settings1.applicationName(), QString("KillerAPP")); QVERIFY(settings2.applicationName().isEmpty()); - QVERIFY(settings3.applicationName() == "KillerAPP"); + QCOMPARE(settings3.applicationName(), QLatin1String("KillerAPP")); QVERIFY(settings4.applicationName().isEmpty()); #if !defined(Q_OS_BLACKBERRY) @@ -553,7 +554,7 @@ void tst_QSettings::ctor() settings1.endGroup(); // test QSettings::scope() while we're at it - QVERIFY(settings1.scope() == QSettings::UserScope); + QCOMPARE(settings1.scope(), QSettings::UserScope); // test QSettings::organizationName() while we're at it QVERIFY(settings1.organizationName().isEmpty()); @@ -628,20 +629,20 @@ void tst_QSettings::ctor() QCOMPARE(settings2.status(), QSettings::NoError); // test QSettings::format() while we're at it - QVERIFY(settings.format() == format); - QVERIFY(settings2.format() == format); + QCOMPARE(settings.format(), format); + QCOMPARE(settings2.format(), format); // test QSettings::scope() while we're at it - QVERIFY(settings.scope() == QSettings::UserScope); - QVERIFY(settings2.scope() == QSettings::UserScope); + QCOMPARE(settings.scope(), QSettings::UserScope); + QCOMPARE(settings2.scope(), QSettings::UserScope); // test QSettings::organizationName() while we're at it QVERIFY(settings.organizationName().isEmpty()); - QVERIFY(settings2.organizationName() == "software.org"); + QCOMPARE(settings2.organizationName(), QLatin1String("software.org")); // test QSettings::applicationName() while we're at it QVERIFY(settings.applicationName().isEmpty()); - QVERIFY(settings2.applicationName() == "KillerAPP"); + QCOMPARE(settings2.applicationName(), QLatin1String("KillerAPP")); } } @@ -1187,16 +1188,16 @@ void tst_QSettings::remove() { QSettings settings0(QSettings::UserScope, "software.org", "KillerAPP"); int initialNumKeys = settings0.allKeys().size(); - QCOMPARE(settings0.value("key 1", "123").toString(), QString("123")); + QCOMPARE(settings0.value("key 1", "123").toString(), QLatin1String("123")); settings0.remove("key 1"); - QCOMPARE(settings0.value("key 1", "456").toString(), QString("456")); + QCOMPARE(settings0.value("key 1", "456").toString(), QLatin1String("456")); settings0.setValue("key 1", "bubloo"); - QCOMPARE(settings0.value("key 1").toString(), QString("bubloo")); + QCOMPARE(settings0.value("key 1").toString(), QLatin1String("bubloo")); settings0.remove("key 2"); - QCOMPARE(settings0.value("key 1").toString(), QString("bubloo")); + QCOMPARE(settings0.value("key 1").toString(), QLatin1String("bubloo")); settings0.remove("key 1"); - QCOMPARE(settings0.value("key 1", "789").toString(), QString("789")); + QCOMPARE(settings0.value("key 1", "789").toString(), QLatin1String("789")); /* Make sure that removing a key removes all the subkeys. @@ -1502,7 +1503,7 @@ void tst_QSettings::contains() } settings1.endGroup(); - QVERIFY(settings1.group() == "alpha"); + QCOMPARE(settings1.group(), QLatin1String("alpha")); keys = settings1.allKeys(); QCOMPARE(keys.size(), expectedResult.size() + 3); for (i = 0; i < keys.size(); ++i) { @@ -1794,26 +1795,26 @@ void tst_QSettings::testUpdateRequestEvent() QSettings settings1("foo", QSettings::IniFormat); QVERIFY(!QFile::exists("foo")); - QVERIFY(QFileInfo("foo").size() == 0); + QCOMPARE(QFileInfo("foo").size(), qint64(0)); settings1.setValue("key1", 1); - QVERIFY(QFileInfo("foo").size() == 0); + QCOMPARE(QFileInfo("foo").size(), qint64(0)); QTRY_VERIFY(QFileInfo("foo").size() > 0); settings1.remove("key1"); QVERIFY(QFileInfo("foo").size() > 0); - QTRY_VERIFY(QFileInfo("foo").size() == 0); + QTRY_COMPARE(QFileInfo("foo").size(), qint64(0)); settings1.setValue("key2", 2); - QVERIFY(QFileInfo("foo").size() == 0); + QCOMPARE(QFileInfo("foo").size(), qint64(0)); QTRY_VERIFY(QFileInfo("foo").size() > 0); settings1.clear(); QVERIFY(QFileInfo("foo").size() > 0); - QTRY_VERIFY(QFileInfo("foo").size() == 0); + QTRY_COMPARE(QFileInfo("foo").size(), qint64(0)); #ifdef Q_OS_WINRT QDir::setCurrent(oldCur); @@ -1960,7 +1961,7 @@ void tst_QSettings::testEmptyData() settings.setValue("vList", vList); settings.setValue("vList2", vList2); settings.setValue("vList3", vList3); - QVERIFY(settings.status() == QSettings::NoError); + QCOMPARE(settings.status(), QSettings::NoError); } { QSettings settings(filename, QSettings::IniFormat); @@ -1973,7 +1974,7 @@ void tst_QSettings::testEmptyData() QCOMPARE(settings.value("vList").toList(), vList); QCOMPARE(settings.value("vList2").toList(), vList2); QCOMPARE(settings.value("vList3").toList(), vList3); - QVERIFY(settings.status() == QSettings::NoError); + QCOMPARE(settings.status(), QSettings::NoError); } { @@ -1987,7 +1988,7 @@ void tst_QSettings::testEmptyData() settings.setValue("vList", vList); settings.setValue("vList2", vList2); settings.setValue("vList3", vList3); - QVERIFY(settings.status() == QSettings::NoError); + QCOMPARE(settings.status(), QSettings::NoError); } { QSettings settings("QtProject", "tst_qsettings"); @@ -2000,7 +2001,7 @@ void tst_QSettings::testEmptyData() QCOMPARE(settings.value("vList").toList(), vList); QCOMPARE(settings.value("vList2").toList(), vList2); QCOMPARE(settings.value("vList3").toList(), vList3); - QVERIFY(settings.status() == QSettings::NoError); + QCOMPARE(settings.status(), QSettings::NoError); } QFile::remove(filename); } @@ -2018,17 +2019,17 @@ void tst_QSettings::testEmptyKey() void tst_QSettings::testResourceFiles() { QSettings settings(":/resourcefile.ini", QSettings::IniFormat); - QVERIFY(settings.status() == QSettings::NoError); + QCOMPARE(settings.status(), QSettings::NoError); QVERIFY(!settings.isWritable()); QCOMPARE(settings.value("Field 1/Bottom").toInt(), 89); settings.setValue("Field 1/Bottom", 90); // the next two lines check the statu quo; another behavior would be possible - QVERIFY(settings.status() == QSettings::NoError); + QCOMPARE(settings.status(), QSettings::NoError); QCOMPARE(settings.value("Field 1/Bottom").toInt(), 90); settings.sync(); - QVERIFY(settings.status() == QSettings::AccessError); + QCOMPARE(settings.status(), QSettings::AccessError); QCOMPARE(settings.value("Field 1/Bottom").toInt(), 90); } @@ -2044,6 +2045,52 @@ void tst_QSettings::testRegistryShortRootNames() #endif } +void tst_QSettings::testRegistry32And64Bit() +{ +#if !defined (Q_OS_WIN) || defined(Q_OS_WINRT) + QSKIP("This test is specific to the Windows registry.", SkipAll); +#else + + const QString key("HKEY_LOCAL_MACHINE\\Software"); + const QString keyWow("HKEY_LOCAL_MACHINE\\Software\\Wow6432Node"); + +#ifndef Q_OS_WIN64 + // This branch is taken at compile time if targeting 32-bit; it does not + // necessarily mean that the OS running the test is 32-bit (it could be + // e.g. 64-bit). + QCOMPARE(QSettings(key, QSettings::NativeFormat).childGroups(), + QSettings(key, QSettings::Registry32Format).childGroups()); + + // Detect whether we are running under 64-bit Windows. + typedef BOOL (WINAPI *IsWow64ProcessPtr)(HANDLE hProcess, PBOOL Wow64Process); + IsWow64ProcessPtr IsWow64Process = (IsWow64ProcessPtr)QLibrary::resolve( + "kernel32.dll", "IsWow64Process"); + + if (IsWow64Process) { + BOOL IsWow64 = FALSE; + if (IsWow64Process(GetCurrentProcess(), &IsWow64) && IsWow64) { + // The 64-bit registry's "Wow6432Node" key should match the 32-bit registry. + // If we are not on 32-bit Windows, these should never be the same, + // because the 64-bit registry has a "Wow6432Node" key. + QCOMPARE(QSettings(keyWow, QSettings::Registry64Format).childGroups(), + QSettings(key, QSettings::Registry32Format).childGroups()); + } + } +#else + // This branch is taken at compile time if targeting 64-bit; it does not + // necessarily mean that the OS running the test is 64-bit (it could be + // e.g. 128-bit). + QCOMPARE(QSettings(key, QSettings::NativeFormat).childGroups(), + QSettings(key, QSettings::Registry64Format).childGroups()); + + // The 64-bit registry's "Wow6432Node" key should match the 32-bit registry. + QCOMPARE(QSettings(keyWow, QSettings::Registry64Format).childGroups(), + QSettings(key, QSettings::Registry32Format).childGroups()); +#endif + +#endif +} + void tst_QSettings::trailingWhitespace() { { @@ -2539,7 +2586,7 @@ QString escapeWeirdChars(const QString &s) QChar c = s.at(i); if (c.unicode() < ' ' || c.unicode() > '~' || (escapeNextDigit && c.unicode() >= '0' && c.unicode() <= 'f')) { - result += QString("\\x%1").arg(c.unicode(), 0, 16); + result += QLatin1String("\\x") + QString::number(c.unicode(), 16); escapeNextDigit = true; } else { result += c; @@ -3133,7 +3180,7 @@ void tst_QSettings::registerFormat() // so we can test error handling QSettings::Format custom3 = QSettings::registerFormat("custom3", readCustom3File, writeCustom3File); - QVERIFY(custom3 == QSettings::CustomFormat3); + QCOMPARE(custom3, QSettings::CustomFormat3); QDir dir(settingsPath()); QVERIFY(dir.mkpath("someDir")); @@ -3225,23 +3272,23 @@ void tst_QSettings::setPath() void tst_QSettings::setDefaultFormat() { - QVERIFY(QSettings::defaultFormat() == QSettings::NativeFormat); + QCOMPARE(QSettings::defaultFormat(), QSettings::NativeFormat); QSettings::setDefaultFormat(QSettings::CustomFormat1); QSettings settings1("org", "app"); QSettings settings2(QSettings::SystemScope, "org", "app"); QSettings settings3; - QVERIFY(settings1.format() == QSettings::NativeFormat); - QVERIFY(settings2.format() == QSettings::NativeFormat); - QVERIFY(settings3.format() == QSettings::CustomFormat1); + QCOMPARE(settings1.format(), QSettings::NativeFormat); + QCOMPARE(settings2.format(), QSettings::NativeFormat); + QCOMPARE(settings3.format(), QSettings::CustomFormat1); QSettings::setDefaultFormat(QSettings::NativeFormat); - QVERIFY(QSettings::defaultFormat() == QSettings::NativeFormat); + QCOMPARE(QSettings::defaultFormat(), QSettings::NativeFormat); - QVERIFY(settings1.format() == QSettings::NativeFormat); - QVERIFY(settings2.format() == QSettings::NativeFormat); - QVERIFY(settings3.format() == QSettings::CustomFormat1); + QCOMPARE(settings1.format(), QSettings::NativeFormat); + QCOMPARE(settings2.format(), QSettings::NativeFormat); + QCOMPARE(settings3.format(), QSettings::CustomFormat1); } void tst_QSettings::dontCreateNeedlessPaths() @@ -3302,7 +3349,7 @@ void tst_QSettings::dontReorderIniKeysNeedlessly() outFile.close(); QSettings settings(outFileName, QSettings::IniFormat); - QVERIFY(settings.status() == QSettings::NoError); + QCOMPARE(settings.status(), QSettings::NoError); QVERIFY(settings.isWritable()); settings.setValue("Field 1/Bottom", 90); diff --git a/tests/auto/corelib/io/qstandardpaths/qstandardpaths.pro b/tests/auto/corelib/io/qstandardpaths/qstandardpaths.pro index 9fb6f9b31f..c72d9e4fad 100644 --- a/tests/auto/corelib/io/qstandardpaths/qstandardpaths.pro +++ b/tests/auto/corelib/io/qstandardpaths/qstandardpaths.pro @@ -3,4 +3,3 @@ TARGET = tst_qstandardpaths QT = core testlib SOURCES = tst_qstandardpaths.cpp TESTDATA += tst_qstandardpaths.cpp qstandardpaths.pro -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp b/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp index efbcdc78e0..aaaa0d4949 100644 --- a/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp +++ b/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp @@ -61,9 +61,9 @@ void tst_QStorageInfo::defaultValues() QVERIFY(!storage.isRoot()); QVERIFY(storage.device().isEmpty()); QVERIFY(storage.fileSystemType().isEmpty()); - QVERIFY(storage.bytesTotal() == -1); - QVERIFY(storage.bytesFree() == -1); - QVERIFY(storage.bytesAvailable() == -1); + QCOMPARE(storage.bytesTotal(), -1); + QCOMPARE(storage.bytesFree(), -1); + QCOMPARE(storage.bytesAvailable(), -1); } void tst_QStorageInfo::operatorEqual() @@ -71,19 +71,19 @@ void tst_QStorageInfo::operatorEqual() { QStorageInfo storage1 = QStorageInfo::root(); QStorageInfo storage2(QDir::rootPath()); - QVERIFY(storage1 == storage2); + QCOMPARE(storage1, storage2); } { QStorageInfo storage1(QCoreApplication::applicationDirPath()); QStorageInfo storage2(QCoreApplication::applicationFilePath()); - QVERIFY(storage1 == storage2); + QCOMPARE(storage1, storage2); } { QStorageInfo storage1; QStorageInfo storage2; - QVERIFY(storage1 == storage2); + QCOMPARE(storage1, storage2); } } @@ -184,15 +184,15 @@ void tst_QStorageInfo::caching() qint64 free = storage1.bytesFree(); QStorageInfo storage2(storage1); - QVERIFY(free == storage2.bytesFree()); + QCOMPARE(free, storage2.bytesFree()); file.write(QByteArray(1024*1024, '\0')); file.flush(); - QVERIFY(free == storage1.bytesFree()); - QVERIFY(free == storage2.bytesFree()); + QCOMPARE(free, storage1.bytesFree()); + QCOMPARE(free, storage2.bytesFree()); storage2.refresh(); - QVERIFY(storage1 == storage2); + QCOMPARE(storage1, storage2); QVERIFY(free != storage2.bytesFree()); } #endif diff --git a/tests/auto/corelib/io/qtemporarydir/qtemporarydir.pro b/tests/auto/corelib/io/qtemporarydir/qtemporarydir.pro index 0908878514..4a69971f78 100644 --- a/tests/auto/corelib/io/qtemporarydir/qtemporarydir.pro +++ b/tests/auto/corelib/io/qtemporarydir/qtemporarydir.pro @@ -3,4 +3,3 @@ TARGET = tst_qtemporarydir SOURCES += tst_qtemporarydir.cpp QT = core testlib -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qtemporaryfile/qtemporaryfile.pro b/tests/auto/corelib/io/qtemporaryfile/qtemporaryfile.pro index c16a729ad0..8f250e4568 100644 --- a/tests/auto/corelib/io/qtemporaryfile/qtemporaryfile.pro +++ b/tests/auto/corelib/io/qtemporaryfile/qtemporaryfile.pro @@ -1,10 +1,8 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = tst_qtemporaryfile QT = core testlib SOURCES = tst_qtemporaryfile.cpp TESTDATA += tst_qtemporaryfile.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 RESOURCES += qtemporaryfile.qrc android:!android-no-sdk { diff --git a/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp b/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp index 94e6bbaade..1a586af569 100644 --- a/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp +++ b/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp @@ -697,7 +697,7 @@ void tst_QTemporaryFile::createNativeFile() f.seek(currentPos); } QTemporaryFile *tempFile = QTemporaryFile::createNativeFile(f); - QVERIFY(valid == (bool)tempFile); + QCOMPARE(valid, (bool)tempFile); if (currentPos != -1) QCOMPARE(currentPos, f.pos()); if (valid) { diff --git a/tests/auto/corelib/io/qtextstream/readAllStdinProcess/readAllStdinProcess.pro b/tests/auto/corelib/io/qtextstream/readAllStdinProcess/readAllStdinProcess.pro index 578fa86f5c..4a4c091dcb 100644 --- a/tests/auto/corelib/io/qtextstream/readAllStdinProcess/readAllStdinProcess.pro +++ b/tests/auto/corelib/io/qtextstream/readAllStdinProcess/readAllStdinProcess.pro @@ -7,4 +7,3 @@ DESTDIR = ./ # This app is testdata for tst_qtextstream target.path = $$[QT_INSTALL_TESTS]/tst_qtextstream/$$TARGET INSTALLS += target -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qtextstream/readLineStdinProcess/readLineStdinProcess.pro b/tests/auto/corelib/io/qtextstream/readLineStdinProcess/readLineStdinProcess.pro index 578fa86f5c..4a4c091dcb 100644 --- a/tests/auto/corelib/io/qtextstream/readLineStdinProcess/readLineStdinProcess.pro +++ b/tests/auto/corelib/io/qtextstream/readLineStdinProcess/readLineStdinProcess.pro @@ -7,4 +7,3 @@ DESTDIR = ./ # This app is testdata for tst_qtextstream target.path = $$[QT_INSTALL_TESTS]/tst_qtextstream/$$TARGET INSTALLS += target -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qtextstream/stdinProcess/stdinProcess.pro b/tests/auto/corelib/io/qtextstream/stdinProcess/stdinProcess.pro index 578fa86f5c..4a4c091dcb 100644 --- a/tests/auto/corelib/io/qtextstream/stdinProcess/stdinProcess.pro +++ b/tests/auto/corelib/io/qtextstream/stdinProcess/stdinProcess.pro @@ -7,4 +7,3 @@ DESTDIR = ./ # This app is testdata for tst_qtextstream target.path = $$[QT_INSTALL_TESTS]/tst_qtextstream/$$TARGET INSTALLS += target -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qtextstream/test/test.pro b/tests/auto/corelib/io/qtextstream/test/test.pro index 39d181344f..93fb6d232f 100644 --- a/tests/auto/corelib/io/qtextstream/test/test.pro +++ b/tests/auto/corelib/io/qtextstream/test/test.pro @@ -1,5 +1,4 @@ CONFIG += testcase -CONFIG += parallel_test TARGET = ../tst_qtextstream QT = core network testlib SOURCES = ../tst_qtextstream.cpp @@ -20,4 +19,3 @@ TESTDATA += \ ../qtextstream.qrc \ ../tst_qtextstream.cpp \ ../resources -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp index 6e58642eb6..24cde14459 100644 --- a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp +++ b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp @@ -1617,18 +1617,18 @@ void tst_QTextStream::forcePoint() { QString str; QTextStream stream(&str); - stream << fixed << forcepoint << 1.0 << " " << 1 << " " << 0 << " " << -1.0 << " " << -1; + stream << fixed << forcepoint << 1.0 << ' ' << 1 << ' ' << 0 << ' ' << -1.0 << ' ' << -1; QCOMPARE(str, QString("1.000000 1 0 -1.000000 -1")); str.clear(); stream.seek(0); - stream << scientific << forcepoint << 1.0 << " " << 1 << " " << 0 << " " << -1.0 << " " << -1; + stream << scientific << forcepoint << 1.0 << ' ' << 1 << ' ' << 0 << ' ' << -1.0 << ' ' << -1; QCOMPARE(str, QString("1.000000e+00 1 0 -1.000000e+00 -1")); str.clear(); stream.seek(0); stream.setRealNumberNotation(QTextStream::SmartNotation); - stream << forcepoint << 1.0 << " " << 1 << " " << 0 << " " << -1.0 << " " << -1; + stream << forcepoint << 1.0 << ' ' << 1 << ' ' << 0 << ' ' << -1.0 << ' ' << -1; QCOMPARE(str, QString("1.00000 1 0 -1.00000 -1")); } @@ -1638,7 +1638,7 @@ void tst_QTextStream::forceSign() { QString str; QTextStream stream(&str); - stream << forcesign << 1.2 << " " << -1.2 << " " << 0; + stream << forcesign << 1.2 << ' ' << -1.2 << ' ' << 0; QCOMPARE(str, QString("+1.2 -1.2 +0")); } @@ -1775,9 +1775,9 @@ void tst_QTextStream::nanInf() QString s; QTextStream out(&s); - out << qInf() << " " << -qInf() << " " << qQNaN() - << uppercasedigits << " " - << qInf() << " " << -qInf() << " " << qQNaN() + out << qInf() << ' ' << -qInf() << ' ' << qQNaN() + << uppercasedigits << ' ' + << qInf() << ' ' << -qInf() << ' ' << qQNaN() << flush; QCOMPARE(s, QString("inf -inf nan INF -INF NAN")); @@ -2583,7 +2583,7 @@ void tst_QTextStream::useCase1() stream.setCodec(QTextCodec::codecForName("ISO-8859-1")); stream.setAutoDetectUnicode(true); - stream << 4.15 << " " << QByteArray("abc") << " " << QString("ole"); + stream << 4.15 << ' ' << QByteArray("abc") << ' ' << QString("ole"); } file.seek(0); @@ -2619,7 +2619,7 @@ void tst_QTextStream::useCase2() stream.setCodec(QTextCodec::codecForName("ISO-8859-1")); stream.setAutoDetectUnicode(true); - stream << 4.15 << " " << QByteArray("abc") << " " << QString("ole"); + stream << 4.15 << ' ' << QByteArray("abc") << ' ' << QString("ole"); file.close(); QVERIFY(file.open(QFile::ReadWrite)); diff --git a/tests/auto/corelib/io/qurl/qurl.pro b/tests/auto/corelib/io/qurl/qurl.pro index f65a9c688c..c046c75522 100644 --- a/tests/auto/corelib/io/qurl/qurl.pro +++ b/tests/auto/corelib/io/qurl/qurl.pro @@ -1,7 +1,6 @@ -CONFIG += testcase parallel_test +CONFIG += testcase TARGET = tst_qurl QT = core testlib concurrent SOURCES = tst_qurl.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 mac: OBJECTIVE_SOURCES += tst_qurl_mac.mm diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp index 7579c6713d..97dfac3062 100644 --- a/tests/auto/corelib/io/qurl/tst_qurl.cpp +++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp @@ -226,7 +226,7 @@ void tst_QUrl::constructing() QVERIFY(url.isEmpty()); QCOMPARE(url.port(), -1); QCOMPARE(url.toString(), QString()); - QVERIFY(url == url); + QCOMPARE(url, url); QVERIFY(!(url < url)); QUrl fromLocal = QUrl::fromLocalFile(QString()); @@ -254,7 +254,7 @@ void tst_QUrl::hashInPath() QCOMPARE(withHashInPath.toDisplayString(QUrl::PreferLocalFile), QString("hi%23mum.txt")); QUrl fromHashInPath = QUrl::fromEncoded(withHashInPath.toEncoded()); - QVERIFY(withHashInPath == fromHashInPath); + QCOMPARE(withHashInPath, fromHashInPath); const QUrl localWithHash = QUrl::fromLocalFile("/hi#mum.txt"); QCOMPARE(localWithHash.path(), QString::fromLatin1("/hi#mum.txt")); @@ -284,7 +284,7 @@ void tst_QUrl::assignment() QUrl copy; copy = url; - QVERIFY(url == copy); + QCOMPARE(url, copy); } void tst_QUrl::comparison() @@ -295,7 +295,7 @@ void tst_QUrl::comparison() QUrl url2("http://qt-project.org/"); QVERIFY(url2.isValid()); - QVERIFY(url1 == url2); + QCOMPARE(url1, url2); QVERIFY(!(url1 < url2)); QVERIFY(!(url2 < url1)); QVERIFY(url1.matches(url2, QUrl::None)); @@ -329,7 +329,7 @@ void tst_QUrl::comparison() url5.setEncodedQuery("a=%2a"); QUrl url6; url6.setEncodedQuery("a=%2A"); - QVERIFY(url5 == url6); + QCOMPARE(url5, url6); QUrl url7; url7.setEncodedQuery("a=C"); @@ -366,7 +366,7 @@ void tst_QUrl::comparison() QUrl hostUrl1("file:/foo"); QUrl hostUrl2("file:///foo"); - QVERIFY(hostUrl1 == hostUrl2); + QCOMPARE(hostUrl1, hostUrl2); QVERIFY(hostUrl1.matches(hostUrl2, QUrl::None)); QVERIFY(hostUrl1.matches(hostUrl2, QUrl::RemoveAuthority)); @@ -460,7 +460,7 @@ void tst_QUrl::copying() QUrl copy(url); - QVERIFY(url == copy); + QCOMPARE(url, copy); } void tst_QUrl::setUrl() @@ -1635,9 +1635,9 @@ void tst_QUrl::percentEncoding() QFETCH(QByteArray, encoded); QCOMPARE(QUrl(original).toEncoded().constData(), encoded.constData()); - QVERIFY(QUrl::fromEncoded(QUrl(original).toEncoded()) == QUrl(original)); + QCOMPARE(QUrl::fromEncoded(QUrl(original).toEncoded()), QUrl(original)); QCOMPARE(QUrl::fromEncoded(QUrl(original).toEncoded()).toString(), original); - QVERIFY(QUrl::fromEncoded(encoded) == QUrl(original)); + QCOMPARE(QUrl::fromEncoded(encoded), QUrl(original)); QCOMPARE(QUrl(QUrl(original).toString()).toString(), original); } @@ -2872,7 +2872,8 @@ void tst_QUrl::fromUserInput_data() int c = 0; while (it.hasNext()) { it.next(); - QTest::newRow(QString("file-%1").arg(c++).toLatin1()) << it.filePath() << QUrl::fromLocalFile(it.filePath()); + QTest::newRow(("file-" + QByteArray::number(c++)).constData()) + << it.filePath() << QUrl::fromLocalFile(it.filePath()); } // basic latin1 @@ -2960,7 +2961,8 @@ void tst_QUrl::fromUserInputWithCwd_data() while (it.hasNext()) { it.next(); QUrl url = QUrl::fromLocalFile(it.filePath()); - QTest::newRow(QString("file-%1").arg(c++).toLatin1()) << it.fileName() << QDir::currentPath() << url << url; + QTest::newRow(("file-" + QByteArray::number(c++)).constData()) + << it.fileName() << QDir::currentPath() << url << url; } QDir parent = QDir::current(); QVERIFY(parent.cdUp()); @@ -3167,7 +3169,7 @@ void tst_QUrl::acceptEmptyAuthoritySegments() // However, file:/bar is the same as file:///bar QString file_triple_bar("file:///bar"), file_uni_bar("file:/bar"); - QVERIFY(QUrl(file_triple_bar) == QUrl(file_uni_bar)); + QCOMPARE(QUrl(file_triple_bar), QUrl(file_uni_bar)); QCOMPARE(QUrl(file_uni_bar).toString(), file_triple_bar); QCOMPARE(QUrl(file_uni_bar, QUrl::StrictMode).toString(), file_triple_bar); diff --git a/tests/auto/corelib/io/qurlinternal/qurlinternal.pro b/tests/auto/corelib/io/qurlinternal/qurlinternal.pro index c62cd045f3..ae5e023446 100644 --- a/tests/auto/corelib/io/qurlinternal/qurlinternal.pro +++ b/tests/auto/corelib/io/qurlinternal/qurlinternal.pro @@ -3,5 +3,3 @@ requires(contains(QT_CONFIG,private_tests)) TARGET = tst_qurlinternal SOURCES += tst_qurlinternal.cpp ../../codecs/utf8/utf8data.cpp QT = core core-private testlib -CONFIG += parallel_test -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qurlquery/qurlquery.pro b/tests/auto/corelib/io/qurlquery/qurlquery.pro index 3284903d5b..68129f356f 100644 --- a/tests/auto/corelib/io/qurlquery/qurlquery.pro +++ b/tests/auto/corelib/io/qurlquery/qurlquery.pro @@ -1,6 +1,5 @@ QT = core core-private testlib TARGET = tst_qurlquery -CONFIG += parallel_test testcase +CONFIG += testcase SOURCES += tst_qurlquery.cpp DEFINES += SRCDIR=\\\"$$PWD/\\\" -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp b/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp index 769a96ac64..7df085df7c 100644 --- a/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp +++ b/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp @@ -103,7 +103,7 @@ static QByteArray prettyList(const T &items) first = false; result += prettyPair(it); } - result += ")"; + result += QLatin1Char(')'); return result.toLocal8Bit(); } @@ -176,20 +176,20 @@ void tst_QUrlQuery::constructing() QUrlQuery copy(empty); QVERIFY(copy.isEmpty()); QVERIFY(!copy.isDetached()); - QVERIFY(copy == empty); + QCOMPARE(copy, empty); QCOMPARE(qHash(copy), qHash(empty)); QVERIFY(!(copy != empty)); copy = empty; - QVERIFY(copy == empty); + QCOMPARE(copy, empty); copy = QUrlQuery(); - QVERIFY(copy == empty); + QCOMPARE(copy, empty); QCOMPARE(qHash(copy), qHash(empty)); } { QUrlQuery copy(emptyQuery()); - QVERIFY(copy == empty); + QCOMPARE(copy, empty); } QVERIFY(!empty.hasQueryItem("a")); @@ -214,7 +214,7 @@ void tst_QUrlQuery::constructing() QVERIFY(!(other == empty)); QUrlQuery copy(other); - QVERIFY(copy == other); + QCOMPARE(copy, other); copy.clear(); QVERIFY(copy.isEmpty()); @@ -222,7 +222,7 @@ void tst_QUrlQuery::constructing() copy = other; QVERIFY(!copy.isEmpty()); - QVERIFY(copy == other); + QCOMPARE(copy, other); copy = QUrlQuery(); QVERIFY(copy.isEmpty()); @@ -298,7 +298,7 @@ void tst_QUrlQuery::addRemove() QCOMPARE(allItems.at(0).first, QString("a")); QCOMPARE(allItems.at(0).second, QString("b")); - QVERIFY(query == original); + QCOMPARE(query, original); QVERIFY(!(query != original)); QCOMPARE(qHash(query), qHash(original)); } @@ -346,7 +346,7 @@ void tst_QUrlQuery::multiAddRemove() QVERIFY(query.hasQueryItem("a")); // returns the first one - QVERIFY(query.queryItemValue("a") == "b"); + QCOMPARE(query.queryItemValue("a"), QLatin1String("b")); // order is the order we set them in QVERIFY(query.allQueryItemValues("a") == QStringList() << "b" << "c"); @@ -359,9 +359,9 @@ void tst_QUrlQuery::multiAddRemove() QVERIFY(query.hasQueryItem("A")); QVERIFY(query.hasQueryItem("a")); - QVERIFY(query.queryItemValue("a") == "b"); + QCOMPARE(query.queryItemValue("a"), QLatin1String("b")); QVERIFY(query.allQueryItemValues("a") == QStringList() << "b" << "c"); - QVERIFY(query.queryItemValue("A") == "B"); + QCOMPARE(query.queryItemValue("A"), QLatin1String("B")); QVERIFY(query.allQueryItemValues("A") == QStringList() << "B" << "C"); } @@ -371,7 +371,7 @@ void tst_QUrlQuery::multiAddRemove() QVERIFY(query.hasQueryItem("a")); // it must have removed the first one - QVERIFY(query.queryItemValue("a") == "c"); + QCOMPARE(query.queryItemValue("a"), QLatin1String("c")); } { @@ -720,7 +720,7 @@ void tst_QUrlQuery::old_queryItems() QVERIFY(!url.isEmpty()); QList<QPair<QString, QString> > setItems = url.queryItems(); - QVERIFY(newItems == setItems); + QCOMPARE(newItems, setItems); url.addQueryItem("1", "z"); @@ -746,18 +746,18 @@ void tst_QUrlQuery::old_queryItems() url.removeAllQueryItems("1"); QVERIFY(!url.hasQueryItem("1")); - QCOMPARE(url.queryItemValue("4").toLatin1().constData(), "a b"); - QCOMPARE(url.queryItemValue("5").toLatin1().constData(), "&"); - QCOMPARE(url.queryItemValue("tex").toLatin1().constData(), "a + b = c"); - QCOMPARE(url.queryItemValue("foo bar").toLatin1().constData(), "hello world"); + QCOMPARE(url.queryItemValue("4"), QLatin1String("a b")); + QCOMPARE(url.queryItemValue("5"), QLatin1String("&")); + QCOMPARE(url.queryItemValue("tex"), QLatin1String("a + b = c")); + QCOMPARE(url.queryItemValue("foo bar"), QLatin1String("hello world")); //url.setUrl("http://www.google.com/search?q=a+b"); url.setQuery("q=a+b"); - QCOMPARE(url.queryItemValue("q"), QString("a+b")); + QCOMPARE(url.queryItemValue("q"), QLatin1String("a+b")); //url.setUrl("http://www.google.com/search?q=a=b"); // invalid, but should be tolerated url.setQuery("q=a=b"); - QCOMPARE(url.queryItemValue("q"), QString("a=b")); + QCOMPARE(url.queryItemValue("q"), QLatin1String("a=b")); } void tst_QUrlQuery::old_hasQueryItem_data() diff --git a/tests/auto/corelib/io/qwinoverlappedionotifier/qwinoverlappedionotifier.pro b/tests/auto/corelib/io/qwinoverlappedionotifier/qwinoverlappedionotifier.pro index b7a36459f8..4f0e9da3c2 100644 --- a/tests/auto/corelib/io/qwinoverlappedionotifier/qwinoverlappedionotifier.pro +++ b/tests/auto/corelib/io/qwinoverlappedionotifier/qwinoverlappedionotifier.pro @@ -2,4 +2,3 @@ CONFIG += testcase TARGET = tst_qwinoverlappedionotifier QT = core-private testlib SOURCES = tst_qwinoverlappedionotifier.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qwinoverlappedionotifier/tst_qwinoverlappedionotifier.cpp b/tests/auto/corelib/io/qwinoverlappedionotifier/tst_qwinoverlappedionotifier.cpp index 57a01e0a79..ad2aa0dfd3 100644 --- a/tests/auto/corelib/io/qwinoverlappedionotifier/tst_qwinoverlappedionotifier.cpp +++ b/tests/auto/corelib/io/qwinoverlappedionotifier/tst_qwinoverlappedionotifier.cpp @@ -199,7 +199,7 @@ void tst_QWinOverlappedIoNotifier::waitForAnyNotified() NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL); notifier.setHandle(hFile); notifier.setEnabled(true); - QVERIFY(notifier.waitForAnyNotified(100) == 0); + QVERIFY(!notifier.waitForAnyNotified(100)); OVERLAPPED overlapped1; ZeroMemory(&overlapped1, sizeof(OVERLAPPED)); @@ -224,7 +224,7 @@ void tst_QWinOverlappedIoNotifier::waitForAnyNotified() CloseHandle(hFile); QVERIFY(overlappedObjects.isEmpty()); - QVERIFY(notifier.waitForAnyNotified(100) == 0); + QVERIFY(!notifier.waitForAnyNotified(100)); } void tst_QWinOverlappedIoNotifier::brokenPipe() |