diff options
Diffstat (limited to 'tests/tests.cpp')
| -rw-r--r-- | tests/tests.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/tests.cpp b/tests/tests.cpp index a066dd3e..98d0918e 100644 --- a/tests/tests.cpp +++ b/tests/tests.cpp @@ -3,6 +3,7 @@ * * Author: * Jeremy Lainé + * Manjeet Dahiya * * Source: * http://code.google.com/p/qxmpp @@ -40,6 +41,7 @@ #include "QXmppStreamFeatures.h" #include "QXmppUtils.h" #include "QXmppVCardIq.h" +#include "QXmppVersionIq.h" #include "tests.h" QString getImageType(const QByteArray &contents); @@ -527,6 +529,38 @@ void TestPackets::testVCard() serializePacket(vcard, xml); } +void TestPackets::testVersionGet() +{ + const QByteArray xmlGet( + "<iq id=\"version_1\" to=\"juliet@capulet.com/balcony\" " + "from=\"romeo@montague.net/orchard\" type=\"get\">" + "<query xmlns=\"jabber:iq:version\"/></iq>"); + + QXmppVersionIq verIqGet; + parsePacket(verIqGet, xmlGet); + serializePacket(verIqGet, xmlGet); +} + +void TestPackets::testVersionResult() +{ + const QByteArray xmlResult( + "<iq id=\"version_1\" to=\"romeo@montague.net/orchard\" " + "from=\"juliet@capulet.com/balcony\" type=\"result\">" + "<query xmlns=\"jabber:iq:version\">" + "<name>qxmpp</name>" + "<os>Windows-XP</os>" + "<version>0.2.0</version>" + "</query></iq>"); + + QXmppVersionIq verIqResult; + parsePacket(verIqResult, xmlResult); + QCOMPARE(verIqResult.name(), QString("qxmpp")); + QCOMPARE(verIqResult.version(), QString("0.2.0")); + QCOMPARE(verIqResult.os(), QString("Windows-XP")); + + serializePacket(verIqResult, xmlResult); +} + void TestJingle::testSession() { const QByteArray xml( |
