diff --git a/tests/auto/corelib/tools/collections/tst_collections.cpp b/tests/auto/corelib/tools/collections/tst_collections.cpp index 1dfe01663f..78d3e9e2b8 100644 --- a/tests/auto/corelib/tools/collections/tst_collections.cpp +++ b/tests/auto/corelib/tools/collections/tst_collections.cpp @@ -3129,7 +3129,7 @@ void tst_Collections::qtimerList() QFAIL("QList preallocates too much memory"); } -#define QVERIFY_TYPE(Type) QVERIFY(sizeof(Type)) +#define QVERIFY_TYPE(Type) QVERIFY(sizeof(Type) > 0) template void testContainerTypedefs(Container container) diff --git a/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp b/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp index d892125c87..33f1b25519 100644 --- a/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp +++ b/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp @@ -294,16 +294,16 @@ void tst_QRingBuffer::readLine() char stringBuf[102]; stringBuf[101] = 0; // non-crash terminator QVERIFY(ringBuffer.readLine(stringBuf, sizeof(stringBuf) - 2) == ba1.size()); - QVERIFY(QByteArray(stringBuf, strlen(stringBuf)) == ba1); + QVERIFY(QByteArray(stringBuf, int(strlen(stringBuf))) == ba1); // check first empty string reading - stringBuf[0] = 0xFF; - QCOMPARE(ringBuffer.readLine(stringBuf, sizeof(stringBuf) - 2), ba2.size()); + stringBuf[0] = char(0xFF); + QCOMPARE(ringBuffer.readLine(stringBuf, int(sizeof(stringBuf)) - 2), ba2.size()); QVERIFY(stringBuf[0] == ba2[0]); - QVERIFY(ringBuffer.readLine(stringBuf, sizeof(stringBuf) - 2) == (ba3.size() + ba4.size() + QVERIFY(ringBuffer.readLine(stringBuf, int(sizeof(stringBuf)) - 2) == (ba3.size() + ba4.size() + ba2.size())); - QVERIFY(QByteArray(stringBuf, strlen(stringBuf)) == (ba3 + ba4 + ba2)); + QVERIFY(QByteArray(stringBuf, int(strlen(stringBuf))) == (ba3 + ba4 + ba2)); QVERIFY(ringBuffer.size() == 0); } diff --git a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp index a03bf2ba4e..6bfec61363 100644 --- a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp +++ b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp @@ -37,9 +37,7 @@ #include #include #include - -#define _USE_MATH_DEFINES -#include +#include class tst_QPainterPath : public QObject { diff --git a/tests/auto/gui/painting/qpainterpathstroker/tst_qpainterpathstroker.cpp b/tests/auto/gui/painting/qpainterpathstroker/tst_qpainterpathstroker.cpp index f55260c572..3bccfb75f7 100644 --- a/tests/auto/gui/painting/qpainterpathstroker/tst_qpainterpathstroker.cpp +++ b/tests/auto/gui/painting/qpainterpathstroker/tst_qpainterpathstroker.cpp @@ -36,9 +36,7 @@ #include #include - -#define _USE_MATH_DEFINES -#include +#include class tst_QPainterPathStroker : public QObject { diff --git a/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp b/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp index bd4da12ea3..df7de2b3b7 100644 --- a/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp +++ b/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp @@ -944,7 +944,7 @@ void tst_QRawFont::rawFontFromInvalidData() QVERIFY(!font.isValid()); - invalidData.fill(255, 1024); + invalidData.fill(char(255), 1024); font.loadFromData(invalidData, 10, QFont::PreferDefaultHinting); QVERIFY(!font.isValid()); diff --git a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp index 94d7c3905c..7f4f2ed2ad 100644 --- a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp +++ b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp @@ -227,6 +227,7 @@ void tst_QSslSocket_onDemandCertificates_member::onDemandRootCertLoadingMemberMe bool works; #if defined (Q_OS_WIN) works = false; // on Windows, this won't work even though we use on demand loading + Q_UNUSED(rootCertLoadingAllowed) #else works = rootCertLoadingAllowed; #endif diff --git a/tests/auto/other/qprocess_and_guieventloop/write-read-write/main.cpp b/tests/auto/other/qprocess_and_guieventloop/write-read-write/main.cpp index bddffc2c6a..352968729e 100644 --- a/tests/auto/other/qprocess_and_guieventloop/write-read-write/main.cpp +++ b/tests/auto/other/qprocess_and_guieventloop/write-read-write/main.cpp @@ -33,7 +33,7 @@ #include -int main(int argc, char **argv) +int main(int, char **argv) { const char *msg = argv[1]; char buf[2]; diff --git a/tests/manual/qnetworkaccessmanager/qget/downloadmanager.cpp b/tests/manual/qnetworkaccessmanager/qget/downloadmanager.cpp index 0694003e0a..0d1014a6ff 100644 --- a/tests/manual/qnetworkaccessmanager/qget/downloadmanager.cpp +++ b/tests/manual/qnetworkaccessmanager/qget/downloadmanager.cpp @@ -130,7 +130,7 @@ void DownloadManager::proxyAuthenticationRequired(const QNetworkProxy &, QAuthen } #ifndef QT_NO_SSL -void DownloadManager::sslErrors(QNetworkReply *reply, const QList &errors) +void DownloadManager::sslErrors(QNetworkReply *, const QList &errors) { qDebug() << "sslErrors"; foreach (const QSslError &error, errors) { diff --git a/tests/manual/qnetworkreply/main.cpp b/tests/manual/qnetworkreply/main.cpp index 9d199c3755..f91309502b 100644 --- a/tests/manual/qnetworkreply/main.cpp +++ b/tests/manual/qnetworkreply/main.cpp @@ -180,6 +180,8 @@ void tst_qnetworkreply::setSslConfiguration() QCOMPARE(rootCertLoadingAllowed, true); #elif defined(Q_OS_MAC) QCOMPARE(rootCertLoadingAllowed, false); +#else + Q_UNUSED(rootCertLoadingAllowed) #endif // other platforms: undecided (Windows: depends on the version) if (works) { QCOMPARE(reply->error(), QNetworkReply::NoError); diff --git a/tests/manual/windowflags/controllerwindow.cpp b/tests/manual/windowflags/controllerwindow.cpp index 5c06a9a646..2981bb9bf1 100644 --- a/tests/manual/windowflags/controllerwindow.cpp +++ b/tests/manual/windowflags/controllerwindow.cpp @@ -102,7 +102,7 @@ ControllerWindow::ControllerWindow() : previewWidget(0) updatePreview(); } -bool ControllerWindow::eventFilter(QObject *o, QEvent *e) +bool ControllerWindow::eventFilter(QObject *, QEvent *e) { if (e->type() == QEvent::WindowStateChange) updateStateControl();