QNetworkDatagram: Test copy ctor and clear()

As they were not currently tested

Change-Id: I91bc8dead2c098376001a8502d29bfc746d33f73
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
bb10
Mårten Nordheim 2020-11-24 13:51:11 +01:00
parent fecacfb032
commit f7d7060b60
1 changed files with 11 additions and 0 deletions

View File

@ -83,6 +83,17 @@ void tst_QNetworkDatagram::getSetCheck()
dg.setDestination(QHostAddress::Broadcast, 137);
QCOMPARE(dg.destinationAddress(), QHostAddress(QHostAddress::Broadcast));
QCOMPARE(dg.destinationPort(), 137);
auto dg2 = dg;
QCOMPARE(dg2.hopLimit(), dg.hopLimit());
QCOMPARE(dg2.interfaceIndex(), dg.interfaceIndex());
QCOMPARE(dg2.senderAddress(), dg.senderAddress());
QCOMPARE(dg2.senderPort(), dg.senderPort());
QCOMPARE(dg2.destinationAddress(), dg.destinationAddress());
QCOMPARE(dg2.destinationPort(), dg.destinationPort());
dg.clear();
QVERIFY(dg.isNull());
}
void tst_QNetworkDatagram::makeReply_data()