diff options
Diffstat (limited to 'tests/auto/corelib/io')
-rw-r--r-- | tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp | 4 | ||||
-rw-r--r-- | tests/auto/corelib/io/qdir/tst_qdir.cpp | 10 | ||||
-rw-r--r-- | tests/auto/corelib/io/qfile/tst_qfile.cpp | 2 | ||||
-rw-r--r-- | tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp | 2 | ||||
-rw-r--r-- | tests/auto/corelib/io/qprocess/tst_qprocess.cpp | 10 | ||||
-rw-r--r-- | tests/auto/corelib/io/qsettings/tst_qsettings.cpp | 2 | ||||
-rw-r--r-- | tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp | 18 | ||||
-rw-r--r-- | tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp | 2 |
8 files changed, 25 insertions, 25 deletions
diff --git a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp index 43c644ca43..39c9455b39 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,7 +338,7 @@ 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); } diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp index 7672ee030a..8a1777d7fd 100644 --- a/tests/auto/corelib/io/qdir/tst_qdir.cpp +++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp @@ -1063,7 +1063,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; @@ -1107,11 +1107,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() diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index ae4f1b8774..c1aed842cf 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -1994,7 +1994,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); diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp index 7690a0a52b..0319568229 100644 --- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp @@ -1065,7 +1065,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); } diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp index 8c3a96f10d..426c378967 100644 --- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp +++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp @@ -1421,11 +1421,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); @@ -1479,9 +1479,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. diff --git a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp index 9c2ffa80d4..1dfba368bc 100644 --- a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp +++ b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp @@ -211,7 +211,7 @@ static QString settingsPath(const char *path = "") #else QString tempPath = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation); #endif - if (tempPath.endsWith("/")) + if (tempPath.endsWith(QLatin1Char('/'))) tempPath.truncate(tempPath.size() - 1); return QDir::toNativeSeparators(tempPath + "/tst_QSettings/" + QLatin1String(path)); } diff --git a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp index 36da3b8770..4bcdd1b827 100644 --- a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp +++ b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp @@ -1615,18 +1615,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")); } @@ -1636,7 +1636,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")); } @@ -1773,9 +1773,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")); @@ -2565,7 +2565,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); @@ -2601,7 +2601,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/qurlquery/tst_qurlquery.cpp b/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp index 14944e7f94..9a4e020aad 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(); } |