aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-10-13 13:06:26 +0200
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-10-13 14:24:16 +0000
commit0f5a7217617e30bfb06991390b4bf673c67ed4aa (patch)
tree3808db0e23d0fb8ceef37f825559e768be06df89 /tests/auto/qml
parent16154fba86798bd6bbee90eb79a9f3b26cae2fad (diff)
Tests: Fix single-character string literals.
Use character literals where applicable. Change-Id: Ib0e618752fbc762a73a0a91c43efab61ef2c9687 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'tests/auto/qml')
-rw-r--r--tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp2
-rw-r--r--tests/auto/qml/qjsonbinding/tst_qjsonbinding.cpp2
-rw-r--r--tests/auto/qml/qjsvalue/tst_qjsvalue.cpp2
-rw-r--r--tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp2
-rw-r--r--tests/auto/qml/qqmldirparser/tst_qqmldirparser.cpp9
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp2
-rw-r--r--tests/auto/qml/qqmlincubator/tst_qqmlincubator.cpp4
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp4
-rw-r--r--tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp2
-rw-r--r--tests/auto/qml/qqmllocale/tst_qqmllocale.cpp6
-rw-r--r--tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp11
-rw-r--r--tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp2
-rw-r--r--tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp4
13 files changed, 29 insertions, 23 deletions
diff --git a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp
index 4ab1ac0a4c..98ef590317 100644
--- a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp
+++ b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp
@@ -98,7 +98,7 @@ bool tst_QQmlDebuggingEnabler::init(bool blockMode, bool qmlscene, int portFrom,
if (qmlscene) {
process->start(QStringList() << QLatin1String("-qmljsdebugger=port:") +
- QString::number(portFrom) + QLatin1String(",") + QString::number(portTo) +
+ QString::number(portFrom) + QLatin1Char(',') + QString::number(portTo) +
QLatin1String(blockMode ? ",block": "") <<
testFile(QLatin1String("test.qml")));
} else {
diff --git a/tests/auto/qml/qjsonbinding/tst_qjsonbinding.cpp b/tests/auto/qml/qjsonbinding/tst_qjsonbinding.cpp
index e01ea73e1b..52d676ef3c 100644
--- a/tests/auto/qml/qjsonbinding/tst_qjsonbinding.cpp
+++ b/tests/auto/qml/qjsonbinding/tst_qjsonbinding.cpp
@@ -110,7 +110,7 @@ QJsonValue tst_qjsonbinding::valueFromJson(const QByteArray &json)
// QJsonDocument::fromJson() only handles objects and arrays...
// Wrap the JSON inside a dummy object and extract the value.
- QByteArray wrappedJson = "{\"prop\":" + json + "}";
+ QByteArray wrappedJson = "{\"prop\":" + json + '}';
doc = QJsonDocument::fromJson(wrappedJson);
Q_ASSERT(doc.isObject());
return doc.object().value("prop");
diff --git a/tests/auto/qml/qjsvalue/tst_qjsvalue.cpp b/tests/auto/qml/qjsvalue/tst_qjsvalue.cpp
index bea44cb6e3..bf9bd18807 100644
--- a/tests/auto/qml/qjsvalue/tst_qjsvalue.cpp
+++ b/tests/auto/qml/qjsvalue/tst_qjsvalue.cpp
@@ -2436,7 +2436,7 @@ void tst_QJSValue::prettyPrinter()
QFETCH(QString, function);
QFETCH(QString, expected);
QJSEngine eng;
- QJSValue val = eng.evaluate("(" + function + ")");
+ QJSValue val = eng.evaluate(QLatin1Char('(') + function + QLatin1Char(')'));
QVERIFY(val.isCallable());
QString actual = val.toString();
QSKIP("Function::toString() doesn't give the whole function on v4");
diff --git a/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp b/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp
index 2a534b5913..28d687bd1c 100644
--- a/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp
+++ b/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp
@@ -84,7 +84,7 @@ void tst_qmlplugindump::builtins()
if (dumper.error() != QProcess::UnknownError
|| dumper.exitStatus() != QProcess::NormalExit) {
qWarning() << QString("Error while running '%1 %2'").arg(
- qmlplugindumpPath, args.join(QLatin1String(" ")));
+ qmlplugindumpPath, args.join(QLatin1Char(' ')));
}
if (dumper.error() == QProcess::FailedToStart) {
diff --git a/tests/auto/qml/qqmldirparser/tst_qqmldirparser.cpp b/tests/auto/qml/qqmldirparser/tst_qqmldirparser.cpp
index 6b2add309a..6f2febaccf 100644
--- a/tests/auto/qml/qqmldirparser/tst_qqmldirparser.cpp
+++ b/tests/auto/qml/qqmldirparser/tst_qqmldirparser.cpp
@@ -73,7 +73,7 @@ namespace {
QString toString(const QQmlDirParser::Plugin &p)
{
- return p.name + "|" + p.path;
+ return p.name + QLatin1Char('|') + p.path;
}
QStringList toStringList(const QList<QQmlDirParser::Plugin> &plugins)
@@ -88,7 +88,9 @@ namespace {
QString toString(const QQmlDirParser::Component &c)
{
- return c.typeName + "|" + c.fileName + "|" + QString::number(c.majorVersion) + "|" + QString::number(c.minorVersion) + "|" + (c.internal ? "true" : "false");
+ return c.typeName + QLatin1Char('|') + c.fileName + QLatin1Char('|')
+ + QString::number(c.majorVersion) + QLatin1Char('|') + QString::number(c.minorVersion)
+ + QLatin1Char('|') + (c.internal ? "true" : "false");
}
QStringList toStringList(const QQmlDirComponents &components)
@@ -104,7 +106,8 @@ namespace {
QString toString(const QQmlDirParser::Script &s)
{
- return s.nameSpace + "|" + s.fileName + "|" + QString::number(s.majorVersion) + "|" + QString::number(s.minorVersion);
+ return s.nameSpace + QLatin1Char('|') + s.fileName + QLatin1Char('|')
+ + QString::number(s.majorVersion) + '|' + QString::number(s.minorVersion);
}
QStringList toStringList(const QList<QQmlDirParser::Script> &scripts)
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index 87815c8821..f238bf6b90 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -7330,7 +7330,7 @@ void tst_qqmlecmascript::sequenceSort_data()
for (size_t t=0 ; t < sizeof(types)/sizeof(types[0]) ; ++t) {
for (size_t s=0 ; s < sizeof(sort)/sizeof(sort[0]) ; ++s) {
for (int c=0 ; c < 2 ; ++c) {
- QString testName = QLatin1String(types[t]) + QLatin1String("_") + QLatin1String(sort[s]);
+ QString testName = QLatin1String(types[t]) + QLatin1Char('_') + QLatin1String(sort[s]);
QString fnName = QLatin1String("test_") + testName;
bool useComparer = c != 0;
testName += useComparer ? QLatin1String("[custom]") : QLatin1String("[default]");
diff --git a/tests/auto/qml/qqmlincubator/tst_qqmlincubator.cpp b/tests/auto/qml/qqmlincubator/tst_qqmlincubator.cpp
index 4f559b0d33..2f581e296a 100644
--- a/tests/auto/qml/qqmlincubator/tst_qqmlincubator.cpp
+++ b/tests/auto/qml/qqmlincubator/tst_qqmlincubator.cpp
@@ -96,8 +96,8 @@ private:
QList<QByteArray> actual; \
for (int ii = 0; ii < errors.count(); ++ii) { \
const QQmlError &error = errors.at(ii); \
- QByteArray errorStr = QByteArray::number(error.line()) + ":" + \
- QByteArray::number(error.column()) + ":" + \
+ QByteArray errorStr = QByteArray::number(error.line()) + ':' + \
+ QByteArray::number(error.column()) + ':' + \
error.description().toUtf8(); \
actual << errorStr; \
} \
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index 54e9c361e4..3c7584bfa1 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -282,8 +282,8 @@ private:
QList<QQmlError> errors = component.errors(); \
for (int ii = 0; ii < errors.count(); ++ii) { \
const QQmlError &error = errors.at(ii); \
- QByteArray errorStr = QByteArray::number(error.line()) + ":" + \
- QByteArray::number(error.column()) + ":" + \
+ QByteArray errorStr = QByteArray::number(error.line()) + ':' + \
+ QByteArray::number(error.column()) + ':' + \
error.description().toUtf8(); \
actual << errorStr; \
} \
diff --git a/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
index 519ee7ac26..d26c1c584b 100644
--- a/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
+++ b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
@@ -625,7 +625,7 @@ void tst_qqmllistmodel::enumerate()
int expectedStringCount = sizeof(expectedStrings) / sizeof(expectedStrings[0]);
- QStringList r = item->property("result").toString().split(":");
+ QStringList r = item->property("result").toString().split(QLatin1Char(':'));
int matchCount = 0;
for (int i=0 ; i < expectedStringCount ; ++i) {
diff --git a/tests/auto/qml/qqmllocale/tst_qqmllocale.cpp b/tests/auto/qml/qqmllocale/tst_qqmllocale.cpp
index ba3f72f2c1..030af07a70 100644
--- a/tests/auto/qml/qqmllocale/tst_qqmllocale.cpp
+++ b/tests/auto/qml/qqmllocale/tst_qqmllocale.cpp
@@ -676,7 +676,7 @@ void tst_qqmllocale::addDateTimeFormatData(const QString &l)
int i = 0;
while (formats[i]) {
QByteArray t(locale);
- t += " ";
+ t += ' ';
t += formats[i];
QTest::newRow(t.constData()) << l << QString(formats[i]);
++i;
@@ -768,7 +768,7 @@ void tst_qqmllocale::addDateFormatData(const QString &l)
int i = 0;
while (formats[i]) {
QByteArray t(locale);
- t += " ";
+ t += ' ';
t += formats[i];
QTest::newRow(t.constData()) << l << QString(formats[i]);
++i;
@@ -860,7 +860,7 @@ void tst_qqmllocale::addTimeFormatData(const QString &l)
int i = 0;
while (formats[i]) {
QByteArray t(locale);
- t += " ";
+ t += ' ';
t += formats[i];
QTest::newRow(t.constData()) << l << QString(formats[i]);
++i;
diff --git a/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp b/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp
index 0e326abad9..77fc67a1ac 100644
--- a/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp
+++ b/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp
@@ -110,8 +110,8 @@ void tst_qqmlmoduleplugin::initTestCase()
QList<QByteArray> actual; \
for (int ii = 0; ii < errors.count(); ++ii) { \
const QQmlError &error = errors.at(ii); \
- QByteArray errorStr = QByteArray::number(error.line()) + ":" + \
- QByteArray::number(error.column()) + ":" + \
+ QByteArray errorStr = QByteArray::number(error.line()) + ':' + \
+ QByteArray::number(error.column()) + ':' + \
error.description().toUtf8(); \
actual << errorStr; \
} \
@@ -202,8 +202,11 @@ void tst_qqmlmoduleplugin::incorrectPluginCase()
caseSensitive = false;
QString libname = "PluGin.dll";
#endif
- if (!caseSensitive)
- expectedError = QLatin1String("plugin cannot be loaded for module \"org.qtproject.WrongCase\": File name case mismatch for \"") + QDir(m_importsDirectory).filePath("org/qtproject/WrongCase/" + libname) + QLatin1String("\"");
+ if (!caseSensitive) {
+ expectedError = QLatin1String("plugin cannot be loaded for module \"org.qtproject.WrongCase\": File name case mismatch for \"")
+ + QDir(m_importsDirectory).filePath("org/qtproject/WrongCase/" + libname)
+ + QLatin1Char('"');
+ }
#endif
QCOMPARE(errors.at(0).description(), expectedError);
diff --git a/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp b/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp
index 47bf151a37..68f85daacd 100644
--- a/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp
+++ b/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp
@@ -621,7 +621,7 @@ void tst_qqmlxmlhttprequest::send_options()
QVERIFY(!object.isNull());
QString url = server.baseUrl().toString();
if (url_suffix != "/")
- url.append("/");
+ url.append(QLatin1Char('/'));
if (!url_suffix.isEmpty())
url.append(url_suffix);
object->setProperty("url", url);
diff --git a/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp b/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp
index dc6e2fa561..aca809a137 100644
--- a/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp
+++ b/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp
@@ -93,8 +93,8 @@ void tst_qquickfolderlistmodel::checkNoErrors(const QQmlComponent& component)
QList<QQmlError> errors = component.errors();
for (int ii = 0; ii < errors.count(); ++ii) {
const QQmlError &error = errors.at(ii);
- QByteArray errorStr = QByteArray::number(error.line()) + ":" +
- QByteArray::number(error.column()) + ":" +
+ QByteArray errorStr = QByteArray::number(error.line()) + ':' +
+ QByteArray::number(error.column()) + ':' +
error.description().toUtf8();
qWarning() << errorStr;
}