AutoTest: Code cosmetics

* use nullptr
* override
* remove old style casts
* fix most of the code model warnings

Change-Id: Ia08e846f9326ae28ca7e7d66748e25a8b817b9b1
Reviewed-by: Xing Xiong
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2018-07-11 15:44:51 +02:00
parent b8da47af9c
commit 1d894c0f7a
39 changed files with 51 additions and 92 deletions

View File

@@ -47,9 +47,9 @@ static QString decode(const QString& original)
while ((pos = regex.indexIn(original, pos)) != -1) {
const QString value = regex.cap(1);
if (value.startsWith('x'))
result.replace(regex.cap(0), QChar(value.midRef(1).toInt(0, 16)));
result.replace(regex.cap(0), QChar(value.midRef(1).toInt(nullptr, 16)));
else
result.replace(regex.cap(0), QChar(value.toInt(0, 10)));
result.replace(regex.cap(0), QChar(value.toInt(nullptr, 10)));
pos += regex.matchedLength();
}
@@ -120,7 +120,7 @@ static QString constructBenchmarkInformation(const QString &metric, double value
return QtTestOutputReader::tr("%1 %2 per iteration (total: %3, iterations: %4)")
.arg(formatResult(value))
.arg(metricsText)
.arg(formatResult(value * (double)iterations))
.arg(formatResult(value * double(iterations)))
.arg(iterations);
}