From a40682ebcdc4552b7185d4a6d0e9deb1dc5261cc Mon Sep 17 00:00:00 2001 From: Jeremy Lainé Date: Mon, 14 May 2012 11:20:09 +0200 Subject: implement/test XEP-0115 verification strings for dataforms (issue: #140) --- tests/tests.cpp | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) (limited to 'tests/tests.cpp') diff --git a/tests/tests.cpp b/tests/tests.cpp index 5aea4132..29c0253d 100644 --- a/tests/tests.cpp +++ b/tests/tests.cpp @@ -334,7 +334,7 @@ void TestPackets::testBindResult() serializePacket(bind, xml); } -void TestPackets::testDiscoveryIq() +void TestPackets::testDiscovery() { const QByteArray xml( "" @@ -353,6 +353,47 @@ void TestPackets::testDiscoveryIq() serializePacket(disco, xml); } +void TestPackets::testDiscoveryWithForm() +{ + const QByteArray xml( + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "urn:xmpp:dataforms:softwareinfo" + "" + "" + "ipv4" + "ipv6" + "" + "" + "Mac" + "" + "" + "10.5.1" + "" + "" + "Psi" + "" + "" + "0.11" + "" + "" + "" + ""); + + QXmppDiscoveryIq disco; + parsePacket(disco, xml); + QCOMPARE(disco.verificationString(), QByteArray::fromBase64("q07IKJEyjvHSyhy//CH0CxmKi8w=")); + serializePacket(disco, xml); +} + void TestPackets::testMessage() { const QByteArray xml( -- cgit v1.2.3