diff options
| author | Zam-mbpr <love8879201@gmail.com> | 2015-06-04 01:38:57 +0800 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2015-06-04 08:08:46 +0200 |
| commit | f2f506807bdd41795acaddc80430025fb9a62a7b (patch) | |
| tree | 79dc3e30d2e68682d58695858106d071af581827 /tests | |
| parent | 4a350838696d32fcacfba05c5bf4e0e54ed02694 (diff) | |
| download | qxmpp-f2f506807bdd41795acaddc80430025fb9a62a7b.tar.gz | |
fix pubsub retract query
fix issue #56
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/qxmpppubsubiq/tst_qxmpppubsubiq.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/qxmpppubsubiq/tst_qxmpppubsubiq.cpp b/tests/qxmpppubsubiq/tst_qxmpppubsubiq.cpp index 999efc59..d3065f2a 100644 --- a/tests/qxmpppubsubiq/tst_qxmpppubsubiq.cpp +++ b/tests/qxmpppubsubiq/tst_qxmpppubsubiq.cpp @@ -33,6 +33,7 @@ private slots: void testItems(); void testItemsResponse(); void testPublish(); + void testRetractItem(); void testSubscribe(); void testSubscription(); void testSubscriptions(); @@ -135,6 +136,35 @@ void tst_QXmppPubSubIq::testPublish() serializePacket(iq, xml); } +void tst_QXmppPubSubIq::testRetractItem() +{ + const QByteArray xml( + "<iq" + " id=\"retract1\"" + " to=\"pubsub.shakespeare.lit\"" + " from=\"hamlet@denmark.lit/elsinore\"" + " type=\"set\">" + "<pubsub xmlns=\"http://jabber.org/protocol/pubsub\">" + "<retract node=\"princely_musings\">" + "<item id=\"ae890ac52d0df67ed7cfdf51b644e901\"/>" + "</retract>" + "</pubsub>" + "</iq>"); + + QXmppPubSubIq iq; + parsePacket(iq, xml); + QCOMPARE(iq.id(), QString("retract1")); + QCOMPARE(iq.to(), QLatin1String("pubsub.shakespeare.lit")); + QCOMPARE(iq.from(), QLatin1String("hamlet@denmark.lit/elsinore")); + QCOMPARE(iq.type(), QXmppIq::Set); + QCOMPARE(iq.queryType(), QXmppPubSubIq::RetractQuery); + QCOMPARE(iq.queryJid(), QString()); + QCOMPARE(iq.queryNode(), QLatin1String("princely_musings")); + QCOMPARE(iq.items().size(), 1); + QCOMPARE(iq.items().at(0).id(), QString("ae890ac52d0df67ed7cfdf51b644e901")); + serializePacket(iq, xml); +} + void tst_QXmppPubSubIq::testSubscribe() { const QByteArray xml( |
