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>
This commit is contained in:
Friedemann Kleint 2018-05-02 16:14:29 +02:00
parent 3e001feb4d
commit 6171d647b3

View File

@ -962,8 +962,10 @@ void tst_QUdpSocket::bindMode()
// Depending on the user's privileges, this or will succeed or // Depending on the user's privileges, this or will succeed or
// fail. Admins are allowed to reuse the address, but nobody else. // fail. Admins are allowed to reuse the address, but nobody else.
if (!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint), socket2.errorString().toLatin1().constData()) if (!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint)) {
qWarning("Failed to bind with QUdpSocket::ReuseAddressHint, user isn't an administrator?"); qWarning("Failed to bind with QUdpSocket::ReuseAddressHint(%s), user isn't an administrator?",
qPrintable(socket2.errorString()));
}
socket.close(); socket.close();
QVERIFY2(socket.bind(0, QUdpSocket::ShareAddress), socket.errorString().toLatin1().constData()); QVERIFY2(socket.bind(0, QUdpSocket::ShareAddress), socket.errorString().toLatin1().constData());
QVERIFY(!socket2.bind(socket.localPort())); QVERIFY(!socket2.bind(socket.localPort()));