From b5a7e751ffc654f15cdf9c3fc189254a50574074 Mon Sep 17 00:00:00 2001 From: Linus Jahn Date: Fri, 9 Sep 2022 21:06:44 +0200 Subject: tests: TestClient: Add takePacket() and takeLastPacket() --- tests/TestClient.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/TestClient.h') 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(); -- cgit v1.2.3