From a5857ca37d0ad49b7b944b92d58d3e519b253c6c Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 8 Mar 2013 11:47:51 +0100 Subject: Fix warnings in tests (CLANG). - Statement has no effect - Adding int to string - Unspecified behavior when comparing character literals. Change-Id: Ie9cb9a1036b5cf5c62890685c60dee4af1ce7148 Reviewed-by: Frederik Gladhorn --- .../qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp | 2 +- tests/auto/qlocalsocket/example/server/main.cpp | 2 +- tests/auto/qstringlistmodel/tst_qstringlistmodel.cpp | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp b/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp index b8f4a01..6864775 100644 --- a/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp +++ b/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp @@ -525,7 +525,7 @@ void tst_qdeclarativevisualdatamodel::qaimRowsMoved() SingleRoleModel model; model.list.clear(); for (int i=0; i<30; i++) - model.list << ("item " + i); + model.list << (QLatin1String("item ") + QString::number(i)); engine.rootContext()->setContextProperty("myModel", &model); QDeclarativeVisualDataModel *obj = qobject_cast(c.create()); diff --git a/tests/auto/qlocalsocket/example/server/main.cpp b/tests/auto/qlocalsocket/example/server/main.cpp index 54b8789..d20b627 100644 --- a/tests/auto/qlocalsocket/example/server/main.cpp +++ b/tests/auto/qlocalsocket/example/server/main.cpp @@ -72,7 +72,7 @@ public: if (n == 0) break; qDebug() << "Read" << str; - if ("exit" == str) + if (!qstrcmp("exit", str)) qApp->quit(); if (socket->write(str, 100) < 0) { diff --git a/tests/auto/qstringlistmodel/tst_qstringlistmodel.cpp b/tests/auto/qstringlistmodel/tst_qstringlistmodel.cpp index b9c260f..2ecf571 100644 --- a/tests/auto/qstringlistmodel/tst_qstringlistmodel.cpp +++ b/tests/auto/qstringlistmodel/tst_qstringlistmodel.cpp @@ -169,8 +169,7 @@ void tst_QStringListModel::rowsAboutToBeRemoved_rowsRemoved_data() QStringList strings3; strings3 << "One" << "Two" << "Three" << "Four" << "Five"; QStringList aboutto3; aboutto3 << "One" << "Two" << "Three" << "Four" << "Five"; - QStringList res3; res3 ; - QTest::newRow( "data3" ) << strings3 << 0 << 5 << aboutto3 << res3; + QTest::newRow( "data3" ) << strings3 << 0 << 5 << aboutto3 << QStringList(); /* Not sure if this is a valid test */ QStringList strings4; strings4 << "One" << "Two" << "Three" << "Four" << "Five"; -- cgit v0.12