Skip to content

Commit

Permalink
tst_QUdpSocket: Fix Clang warning about unused expression
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
FriedemannKleint committed May 2, 2018
1 parent 3e001fe commit 6171d64
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down

0 comments on commit 6171d64

Please sign in to comment.