diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-10-20 10:08:39 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-10-22 03:54:29 +0000 |
commit | 456f721917d07b3dd4259c324ff216f90bd32139 (patch) | |
tree | fbc30a9a04ab5be9fc6b332a16910e2cf7fc24d9 /tests/auto/corelib/io | |
parent | acdd4850a485a0cb8f8f0502cafd65a9f214b2a9 (diff) |
tests/auto/corelib: Remove some placeholder formatting.
Use QByteArray/QString addition instead in loops and for
test row names.
Change-Id: Ieffb429efdc14aa5932b3fcdef5a18e13a62d35f
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Diffstat (limited to 'tests/auto/corelib/io')
6 files changed, 14 insertions, 10 deletions
diff --git a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp index 39c9455b39..729cf6547e 100644 --- a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp +++ b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp @@ -340,7 +340,7 @@ void tst_QDataStream::stream_data(int noOfElements) 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; } } } @@ -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() diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp index 2106a1cea8..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'); 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/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/qsettings/tst_qsettings.cpp b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp index a520010b47..30812700c5 100644 --- a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp +++ b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp @@ -2621,7 +2621,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; diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp index b64753e798..97dfac3062 100644 --- a/tests/auto/corelib/io/qurl/tst_qurl.cpp +++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp @@ -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()); |