diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-08-23 09:18:16 +0000 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-08-23 09:18:16 +0000 |
| commit | 081175e7d57557a0e233beb9cafec2fc89a917db (patch) | |
| tree | f4fcec5002472ac818eec709bfd9e08f81ce3a3d /tests/tests.cpp | |
| parent | c5f33c1a732925c0243973c3334bcd8b47e7bc10 (diff) | |
| download | qxmpp-081175e7d57557a0e233beb9cafec2fc89a917db.tar.gz | |
test parsing of archive "retrieve" iqs
Diffstat (limited to 'tests/tests.cpp')
| -rw-r--r-- | tests/tests.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/tests.cpp b/tests/tests.cpp index 3eb90450..bbc8b286 100644 --- a/tests/tests.cpp +++ b/tests/tests.cpp @@ -125,6 +125,28 @@ void TestPackets::testArchiveList() serializePacket(iq, xml); } +void TestPackets::testArchiveRetrieve() +{ + const QByteArray xml( + "<iq id=\"retrieve_1\" type=\"get\">" + "<retrieve xmlns=\"urn:xmpp:archive\" with=\"juliet@capulet.com\"" + " start=\"1469-07-21T02:00:00Z\">" + "<set xmlns=\"http://jabber.org/protocol/rsm\">" + "<max>30</max>" + "</set>" + "</retrieve>" + "</iq>"); + + QXmppArchiveRetrieveIq iq; + parsePacket(iq, xml); + QCOMPARE(iq.type(), QXmppIq::Get); + QCOMPARE(iq.id(), QLatin1String("retrieve_1")); + QCOMPARE(iq.with(), QLatin1String("juliet@capulet.com")); + QCOMPARE(iq.start(), QDateTime(QDate(1469, 7, 21), QTime(2, 0, 0), Qt::UTC)); + QCOMPARE(iq.max(), 30); + serializePacket(iq, xml); +} + void TestPackets::testBindNoResource() { const QByteArray xml( |
