diff options
| author | Linus Jahn <lnj@kaidan.im> | 2018-12-29 23:54:06 +0100 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2018-12-30 13:50:27 +0100 |
| commit | 1d838fb55fc7f4be8c96f8a02dfa9d1a82af2c05 (patch) | |
| tree | c7ee7fb6957a724728d4db8b2aa601da32ce743e /tests | |
| parent | fc389736df1107245ca91ecbe0bca0526a42288a (diff) | |
| download | qxmpp-1d838fb55fc7f4be8c96f8a02dfa9d1a82af2c05.tar.gz | |
Implement XEP-0308: Last Message Correction
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/qxmppmessage/tst_qxmppmessage.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/qxmppmessage/tst_qxmppmessage.cpp b/tests/qxmppmessage/tst_qxmppmessage.cpp index 25c110c6..6b39e8b0 100644 --- a/tests/qxmppmessage/tst_qxmppmessage.cpp +++ b/tests/qxmppmessage/tst_qxmppmessage.cpp @@ -47,6 +47,7 @@ private slots: void testChatMarkers(); void testPrivateMessage(); void testOutOfBandUrl(); + void testMessageCorrect(); }; void tst_QXmppMessage::testBasic_data() @@ -597,5 +598,22 @@ void tst_QXmppMessage::testOutOfBandUrl() serializePacket(oobMessage, oobXml); } +void tst_QXmppMessage::testMessageCorrect() +{ + const QByteArray xml( + "<message to=\"foo@example.com/QXmpp\" from=\"bar@example.com/QXmpp\" type=\"normal\">" + "<body>This is the corrected version.</body>" + "<replace xmlns=\"urn:xmpp:message-correct:0\" id=\"badmessage\"/>" + "</message>"); + + QXmppMessage message; + parsePacket(message, xml); + QCOMPARE(message.replaceId(), QString("badmessage")); + serializePacket(message, xml); + + message.setReplaceId("someotherid"); + QCOMPARE(message.replaceId(), QString("someotherid")); +} + QTEST_MAIN(tst_QXmppMessage) #include "tst_qxmppmessage.moc" |
