diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2012-04-10 12:48:01 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2012-04-10 15:31:45 +0200 |
commit | 143c4d3e13a430b951f4f4f8c28db14303f80605 (patch) | |
tree | 2b89637b93fc7d81c674106008566010f986d67c /tests/auto/testlib | |
parent | a7ed81b557d593a8ddb43b71bf4bbf3b44ead070 (diff) | |
parent | e5337ad1b1fb02873ce7b5ca8db45f6fd8063352 (diff) |
Merge remote-tracking branch 'origin/master' into api_changes
Conflicts:
configure
src/widgets/styles/qwindowsxpstyle.cpp
tests/auto/gui/kernel/qwindow/qwindow.pro
tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
Change-Id: I624b6d26abce9874c610c04954c1c45bc074bef3
Diffstat (limited to 'tests/auto/testlib')
-rw-r--r-- | tests/auto/testlib/selftests/differentexec/tst_differentexec.cpp | 2 | ||||
-rw-r--r-- | tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp | 6 | ||||
-rw-r--r-- | tests/auto/testlib/selftests/tst_selftests.cpp | 7 |
3 files changed, 8 insertions, 7 deletions
diff --git a/tests/auto/testlib/selftests/differentexec/tst_differentexec.cpp b/tests/auto/testlib/selftests/differentexec/tst_differentexec.cpp index 91b14e5051..f32a5e7cd5 100644 --- a/tests/auto/testlib/selftests/differentexec/tst_differentexec.cpp +++ b/tests/auto/testlib/selftests/differentexec/tst_differentexec.cpp @@ -76,7 +76,7 @@ private slots: int main() { - char *argv[] = {"appName", "slotName"}; + char *argv[] = { const_cast<char *>("appName"), const_cast<char *>("slotName") }; int argc = 2; tst_TestA testA; diff --git a/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp b/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp index 20bfc2228a..73de6df5f3 100644 --- a/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp +++ b/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp @@ -65,7 +65,7 @@ void tst_StrCmp::compareCharStars() const QCOMPARE(str1, "foo"); QCOMPARE(str1, str1); - char *str2 = "foo"; + char *str2 = const_cast<char *>("foo"); QCOMPARE("foo", str2); QCOMPARE(str2, "foo"); QCOMPARE(str2, str2); @@ -88,8 +88,8 @@ void tst_StrCmp::compareByteArray() const QCOMPARE(ba.constData(), "bar"); QCOMPARE(ba.constData(), "foo"); - char *bar = "bar"; - char *foo = "foo"; + char *bar = const_cast<char *>("bar"); + char *foo = const_cast<char *>("foo"); QEXPECT_FAIL("", "Next test should fail", Continue); QCOMPARE(ba.data(), bar); 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; |