summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-09-14 16:17:30 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-09-14 19:48:53 (GMT)
commitef5a4dc3a5b0224628a225ef0dccc679287478be (patch)
tree126d8f752f18d3d5891cd32cacf2a21734ab0b92 /Swiften/Serializer/PayloadSerializers/UnitTest
parent9ecba612d790c1f613dc959888f62e5d3575faae (diff)
downloadswift-contrib-ef5a4dc3a5b0224628a225ef0dccc679287478be.zip
swift-contrib-ef5a4dc3a5b0224628a225ef0dccc679287478be.tar.bz2
Add extended disco support to caps verifier.
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers/UnitTest')
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/DiscoInfoSerializerTest.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/DiscoInfoSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/DiscoInfoSerializerTest.cpp
index 6a81298..c67fcdb 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/DiscoInfoSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/DiscoInfoSerializerTest.cpp
@@ -15,6 +15,7 @@ class DiscoInfoSerializerTest : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE(DiscoInfoSerializerTest);
CPPUNIT_TEST(testSerialize);
+ CPPUNIT_TEST(testSerialize_Form);
CPPUNIT_TEST_SUITE_END();
public:
@@ -39,6 +40,27 @@ class DiscoInfoSerializerTest : public CppUnit::TestFixture
CPPUNIT_ASSERT_EQUAL(expectedResult, testling.serialize(discoInfo));
}
+
+ void testSerialize_Form() {
+ DiscoInfoSerializer testling;
+ boost::shared_ptr<DiscoInfo> discoInfo(new DiscoInfo());
+ discoInfo->addFeature("http://jabber.org/protocol/caps");
+ discoInfo->addFeature("http://jabber.org/protocol/disco#info");
+ boost::shared_ptr<Form> form(new Form(Form::FormType));
+ form->setTitle("Bot Configuration");
+ discoInfo->addExtension(form);
+
+ String expectedResult =
+ "<query xmlns=\"http://jabber.org/protocol/disco#info\">"
+ "<feature var=\"http://jabber.org/protocol/caps\"/>"
+ "<feature var=\"http://jabber.org/protocol/disco#info\"/>"
+ "<x type=\"form\" xmlns=\"jabber:x:data\">"
+ "<title>Bot Configuration</title>"
+ "</x>"
+ "</query>";
+
+ CPPUNIT_ASSERT_EQUAL(expectedResult, testling.serialize(discoInfo));
+ }
};
CPPUNIT_TEST_SUITE_REGISTRATION(DiscoInfoSerializerTest);