mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 10:22:55 +00:00
QNetworkInterface tests adjustment
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
bec40b8120
commit
11fdfa54a3
1 changed files with 3 additions and 17 deletions
|
@ -70,12 +70,11 @@ void tst_QNetworkInterface::dump()
|
|||
QDebug s = qDebug();
|
||||
s.nospace() << " address "
|
||||
<< " " << count++;
|
||||
s.nospace() << ": " << qPrintable(e.ip().toString());
|
||||
s.nospace() << ": " << e.ip().toString();
|
||||
if (!e.netmask().isNull())
|
||||
s.nospace() << '/' << e.prefixLength()
|
||||
<< " (" << qPrintable(e.netmask().toString()) << ")";
|
||||
s.nospace() << " netmask " << e.netmask().toString();
|
||||
if (!e.broadcast().isNull())
|
||||
s.nospace() << " broadcast " << qPrintable(e.broadcast().toString());
|
||||
s.nospace() << " broadcast " << e.broadcast().toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -132,19 +131,6 @@ void tst_QNetworkInterface::interfaceFromXXX()
|
|||
|
||||
if (!entry.netmask().isNull()) {
|
||||
QCOMPARE(entry.netmask().protocol(), entry.ip().protocol());
|
||||
|
||||
// if the netmask is known, the broadcast is known
|
||||
// but only for IPv4 (there is no such thing as broadcast in IPv6)
|
||||
if (entry.ip().protocol() == QAbstractSocket::IPv4Protocol) {
|
||||
QVERIFY(!entry.broadcast().isNull());
|
||||
|
||||
// verify that the broadcast address is correct
|
||||
quint32 ip = entry.ip().toIPv4Address();
|
||||
quint32 mask = entry.netmask().toIPv4Address();
|
||||
quint32 bcast = entry.broadcast().toIPv4Address();
|
||||
|
||||
QCOMPARE(bcast, ip | ~mask);
|
||||
}
|
||||
}
|
||||
|
||||
if (!entry.broadcast().isNull())
|
||||
|
|
Loading…
Add table
Reference in a new issue