From 49cdf51ac97d12749e770d792124b7f06d5fd9ca Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 25 Nov 2016 11:58:12 +0100 Subject: Fix some warnings in tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ../tst_qfile.cpp: In member function 'void tst_QFile::handle()': ../tst_qfile.cpp:2661:38: warning: ignoring return value of 'ssize_t read(int, void*, size_t)', declared with attribute warn_unused_result [-Wunused-result] tst_qstatictext.cpp:862:58: warning: unused parameter 'textItem' [-Wunused-parameter] ../tst_qtcpsocket.cpp: In member function 'void tst_QTcpSocket::abortiveClose()': ../tst_qtcpsocket.cpp:2254:90: warning: suggest parentheses around assignment used as truth value [-Wparentheses] Test.cpp: In member function 'void My4Socket::read()': Test.cpp:66:20: warning: 'reply' may be used uninitialized in this function [-Wmaybe-uninitialized] ../tst_qlocalsocket.cpp: In lambda function: ../tst_qlocalsocket.cpp:701:51: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] ../tst_qtcpserver.cpp: In member function 'void tst_QTcpServer::linkLocal()': ../tst_qtcpserver.cpp:935:92: warning: suggest parentheses around assignment used as truth value [-Wparentheses] ../tst_qtcpserver.cpp:940:92: warning: suggest parentheses around assignment used as truth value [-Wparentheses] Change-Id: Ic315069768bcb63a6b333c28ac65b0b992b0d43f Reviewed-by: Jędrzej Nowacki --- tests/auto/corelib/io/qfile/tst_qfile.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/auto/corelib/io/qfile') diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index eeba882c70..287b8aebd8 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -2658,7 +2658,8 @@ void tst_QFile::handle() QVERIFY(fd > 2); QCOMPARE(int(file.handle()), fd); char c = '\0'; - QT_READ(int(file.handle()), &c, 1); + const auto readResult = QT_READ(int(file.handle()), &c, 1); + QCOMPARE(readResult, static_cast(1)); QCOMPARE(c, '/'); // test if the QFile and the handle remain in sync -- cgit v1.2.3