-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for sticker pack message extension
- Loading branch information
1 parent
5270ae0
commit 3e99aba
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,7 @@ private slots: | |
void testE2eeFallbackBody(); | ||
void testFileSharing(); | ||
void testEncryptedFileSource(); | ||
void testStickers(); | ||
}; | ||
|
||
void tst_QXmppMessage::testBasic_data() | ||
|
@@ -1259,5 +1260,31 @@ void tst_QXmppMessage::testEncryptedFileSource() | |
} | ||
} | ||
|
||
void tst_QXmppMessage::testStickers() | ||
{ | ||
QByteArray xml( | ||
"<message id='sharing-a-file' to='[email protected]' from='[email protected]/pda' type='normal'>" | ||
"<body>😘</body>" | ||
"<file-sharing xmlns='urn:xmpp:sfs:0' disposition='inline'>" | ||
"<file xmlns='urn:xmpp:file:metadata:0'>" | ||
"<desc>😘</desc>" | ||
"<hash xmlns='urn:xmpp:hashes:2' algo='sha-256'>gw+6xdCgOcvCYSKuQNrXH33lV9NMzuDf/s0huByCDsY=</hash>" | ||
"<media-type>image/png</media-type>" | ||
"<size>67016</size>" | ||
"</file>" | ||
"<sources>" | ||
"<url-data xmlns='http://jabber.org/protocol/url-data' target='https://download.montague.lit/51078299-d071-46e1-b6d3-3de4a8ab67d6/sticker_marsey_kiss.png'/>" | ||
"</sources>" | ||
"</file-sharing>" | ||
"<sticker xmlns='urn:xmpp:stickers:0' pack='EpRv28DHHzFrE4zd+xaNpVb4'/>" | ||
"</message>"); | ||
|
||
QXmppMessage message1; | ||
parsePacket(message1, xml); | ||
QVERIFY(!message1.sharedFiles().empty()); | ||
QVERIFY(message1.stickerPackId().has_value()); | ||
serializePacket(message1, xml); | ||
} | ||
|
||
QTEST_MAIN(tst_QXmppMessage) | ||
#include "tst_qxmppmessage.moc" |