diff options
Diffstat (limited to 'tests/auto')
4 files changed, 10 insertions, 7 deletions
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index 287b8aebd8..2ef4c2c6a1 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -2618,9 +2618,10 @@ void tst_QFile::appendAndRead() // Write blocks and read them back for (int j = 0; j < 18; ++j) { - writeFile.write(QByteArray(1 << j, '@')); + const int size = 1 << j; + writeFile.write(QByteArray(size, '@')); writeFile.flush(); - QCOMPARE(readFile.read(1 << j).size(), 1 << j); + QCOMPARE(readFile.read(size).size(), size); } readFile.close(); diff --git a/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp b/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp index 0c41f66357..3be8379d29 100644 --- a/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp +++ b/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp @@ -751,8 +751,8 @@ void tst_QArrayData::alignment_data() { QTest::addColumn<size_t>("alignment"); - for (int i = 1; i < 10; ++i) { - size_t alignment = 1u << i; + for (size_t i = 1; i < 10; ++i) { + size_t alignment = size_t(1u) << i; QTest::newRow(qPrintable(QString::number(alignment))) << alignment; } } diff --git a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp index fe1057bdde..9fd5620cec 100644 --- a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp @@ -603,7 +603,7 @@ void tst_QTcpSocket::bind() if (port) QCOMPARE(int(boundPort), port); fd = socket->socketDescriptor(); - QVERIFY(fd != INVALID_SOCKET); + QVERIFY(fd != qintptr(INVALID_SOCKET)); } else { QVERIFY(!socket->bind(addr, port)); QCOMPARE(socket->localPort(), quint16(0)); @@ -667,7 +667,7 @@ void tst_QTcpSocket::bindThenResolveHost() QCOMPARE(socket->state(), QAbstractSocket::BoundState); quint16 boundPort = socket->localPort(); qintptr fd = socket->socketDescriptor(); - QVERIFY(fd != INVALID_SOCKET); + QVERIFY(fd != quint16(INVALID_SOCKET)); dummySocket.close(); 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 46002dd326..5e75f7db3c 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 @@ -37,7 +37,9 @@ int main(int, char **argv) fflush(stdout); // wait for a newline - fgets(buf, sizeof buf, stdin); + const char *result = fgets(buf, sizeof buf, stdin); + if (result != buf) + return -1; puts(msg); fflush(stdout); |