diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2012-02-06 19:12:19 +0000 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2012-02-06 19:12:19 +0000 |
| commit | 78711c314a4cc20aaf276e519d9db1d91cf22fa7 (patch) | |
| tree | a2ae5b3c1c0fef7e231f828444d5878ad0ad5b41 /tests/tests.cpp | |
| parent | f38253b159f7cbb4bc2c9990d76255d167d3af7b (diff) | |
| download | qxmpp-78711c314a4cc20aaf276e519d9db1d91cf22fa7.tar.gz | |
add an attribute to QXmppMessage to carry delivery receipt request
Diffstat (limited to 'tests/tests.cpp')
| -rw-r--r-- | tests/tests.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/tests.cpp b/tests/tests.cpp index 0de5b38f..82dbcd4b 100644 --- a/tests/tests.cpp +++ b/tests/tests.cpp @@ -323,6 +323,7 @@ void TestPackets::testMessage() QCOMPARE(message.thread(), QString()); QCOMPARE(message.state(), QXmppMessage::None); QCOMPARE(message.isAttentionRequested(), false); + QCOMPARE(message.isReceiptRequested(), false); serializePacket(message, xml); } @@ -338,7 +339,29 @@ void TestPackets::testMessageAttention() QCOMPARE(message.to(), QString("foo@example.com/QXmpp")); QCOMPARE(message.from(), QString("bar@example.com/QXmpp")); QCOMPARE(message.type(), QXmppMessage::Normal); + QCOMPARE(message.body(), QString()); QCOMPARE(message.isAttentionRequested(), true); + QCOMPARE(message.isReceiptRequested(), false); + serializePacket(message, xml); +} + +void TestPackets::testMessageDelivery() +{ + const QByteArray xml( + "<message id=\"richard2-4.1.247\" to=\"foo@example.com/QXmpp\" from=\"bar@example.com/QXmpp\" type=\"normal\">" + "<body>My lord, dispatch; read o'er these articles.</body>" + "<request xmlns=\"urn:xmpp:receipts\"/>" + "</message>"); + + QXmppMessage message; + parsePacket(message, xml); + QCOMPARE(message.id(), QString("richard2-4.1.247")); + QCOMPARE(message.to(), QString("foo@example.com/QXmpp")); + QCOMPARE(message.from(), QString("bar@example.com/QXmpp")); + QCOMPARE(message.type(), QXmppMessage::Normal); + QCOMPARE(message.body(), QLatin1String("My lord, dispatch; read o'er these articles.")); + QCOMPARE(message.isAttentionRequested(), false); + QCOMPARE(message.isReceiptRequested(), true); serializePacket(message, xml); } |
