aboutsummaryrefslogtreecommitdiff
path: root/tests/TestClient.h
diff options
context:
space:
mode:
authorLinus Jahn <lnj@kaidan.im>2022-09-09 21:06:44 +0200
committerLinus Jahn <lnj@kaidan.im>2022-09-09 22:49:06 +0200
commitb5a7e751ffc654f15cdf9c3fc189254a50574074 (patch)
treef4cb956c05b2754c753436df86aa3811c735f66b /tests/TestClient.h
parent5c9605262c3e5aeeb35a3ec004dae5086dfc25cf (diff)
downloadqxmpp-b5a7e751ffc654f15cdf9c3fc189254a50574074.tar.gz
tests: TestClient: Add takePacket() and takeLastPacket()
Diffstat (limited to 'tests/TestClient.h')
-rw-r--r--tests/TestClient.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/TestClient.h b/tests/TestClient.h
index fcfa4fb2..9da12a97 100644
--- a/tests/TestClient.h
+++ b/tests/TestClient.h
@@ -49,6 +49,16 @@ public:
QCOMPARE(m_sentPackets.takeFirst(), packet.replace(u'\'', u'"'));
resetIdCount();
}
+ QString takePacket()
+ {
+ [this]() { QVERIFY(!m_sentPackets.isEmpty()); }();
+ return m_sentPackets.takeFirst();
+ }
+ QString takeLastPacket()
+ {
+ [this]() { QVERIFY(!m_sentPackets.isEmpty()); }();
+ return m_sentPackets.takeLast();
+ }
void ignore()
{
m_sentPackets.takeFirst();