summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/socket
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-05-02 16:14:29 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-05-02 15:56:04 +0000
commit6171d647b3a060e89b2a5f3f0218288ce0ccbcac (patch)
treec7cbd3a0d3822da66fe07f88833704b439c39a98 /tests/auto/network/socket
parent3e001feb4d03d350ecea76f136c503675a2431ab (diff)
tst_QUdpSocket: Fix Clang warning about unused expression
tst_qudpsocket.cpp(965,9): warning: expression result unused [-Wunused-value] if (!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint), socket2.errorString().toLatin1().constData()) Task-number: QTBUG-63512 Change-Id: I51959432c6ff166c188842e34c3033ab1319c079 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/network/socket')
-rw-r--r--tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
index 8165ccbc58..8ebb27e58c 100644
--- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
+++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
@@ -962,8 +962,10 @@ void tst_QUdpSocket::bindMode()
// Depending on the user's privileges, this or will succeed or
// fail. Admins are allowed to reuse the address, but nobody else.
- if (!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint), socket2.errorString().toLatin1().constData())
- qWarning("Failed to bind with QUdpSocket::ReuseAddressHint, user isn't an administrator?");
+ if (!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint)) {
+ qWarning("Failed to bind with QUdpSocket::ReuseAddressHint(%s), user isn't an administrator?",
+ qPrintable(socket2.errorString()));
+ }
socket.close();
QVERIFY2(socket.bind(0, QUdpSocket::ShareAddress), socket.errorString().toLatin1().constData());
QVERIFY(!socket2.bind(socket.localPort()));