summaryrefslogtreecommitdiffstats
path: root/tests/auto/testlib/selftests
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2012-04-02 14:22:04 +0200
committerQt by Nokia <qt-info@nokia.com>2012-04-02 16:56:48 +0200
commit8f2a088028cf074a08e5252509c60e0f1021c43f (patch)
treed8af228b3cf3f9c998f7a52dec50ddcce84a7af1 /tests/auto/testlib/selftests
parentb08f74f08939be310a79b5efcb5721e35c5deb21 (diff)
Fix MSVC warnings in tests.
- Unused variables - conversion truncations - Overflow in expressions like '-1 + sizeof()' Change-Id: Ibbd18497951e9e7e9dccaf596cb4e864b69ec02c Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Diffstat (limited to 'tests/auto/testlib/selftests')
-rw-r--r--tests/auto/testlib/selftests/tst_selftests.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp
index 97458abfbf..26ccd826ca 100644
--- a/tests/auto/testlib/selftests/tst_selftests.cpp
+++ b/tests/auto/testlib/selftests/tst_selftests.cpp
@@ -135,7 +135,7 @@ static QList<QByteArray> splitLines(QByteArray ba)
if (index == -1) {
continue;
}
- int end = line.indexOf('"', index + strlen(markers[j][0]));
+ const int end = line.indexOf('"', index + int(strlen(markers[j][0])));
if (end == -1) {
continue;
}
@@ -686,11 +686,12 @@ QString extractXmlAttribute(const QString &line, const char *attribute)
int index = line.indexOf(attribute);
if (index == -1)
return QString();
- int end = line.indexOf('"', index + strlen(attribute));
+ const int attributeLength = int(strlen(attribute));
+ const int end = line.indexOf('"', index + attributeLength);
if (end == -1)
return QString();
- QString result = line.mid(index + strlen(attribute), end - index - strlen(attribute));
+ const QString result = line.mid(index + attributeLength, end - index - attributeLength);
if (result.isEmpty())
return ""; // ensure empty but not null
return result;