Merge PR #19: Fix tests

add-websocket-support
jenkins 2022-04-25 23:53:29 +02:00
commit 29889a11ff
1 changed files with 13 additions and 0 deletions

View File

@ -783,6 +783,19 @@ void OperationTests::testRetain()
QSignalSpy publishReceivedSpy5(client2, &MqttClient::publishReceived);
client2->subscribe("/retaintopic", Mqtt::QoS1);
QTRY_VERIFY2(publishReceivedSpy5.count() == 1, "Did not receive exactly 1 retained message.");
publishReceivedSpy5.clear();
// post an empty payload to this topic. it should clear all retained messages
client1->publish("/retaintopic", "", Mqtt::QoS1, true);
QTRY_VERIFY2_WITH_TIMEOUT(publishReceivedSpy5.count() == 0, "Recaived a message but should not have.", 250);
disconnectAndWait(client2);
client2 = connectAndWait("client2");
QSignalSpy publishReceivedSpy6(client2, &MqttClient::publishReceived);
client2->subscribe("/retaintopic", Mqtt::QoS1);
QTRY_VERIFY2_WITH_TIMEOUT(publishReceivedSpy6.count() == 0, "Recaived a message but should not have.", 250);
}
void OperationTests::testUnsubscribe()