summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2012-04-23 10:05:24 (GMT)
committerRemko Tronçon <git@el-tramo.be>2012-04-23 10:05:24 (GMT)
commitc5dc30ae9ad8b9f3b0209c8ba177f1ce170a6364 (patch)
treecc28fb37c1ea9e136a5d96764dfe7bc700b47621 /Swiften/Queries/UnitTest
parentd072dcd1ee143357c41e53ee94a4b6d13e48e2fc (diff)
downloadswift-c5dc30ae9ad8b9f3b0209c8ba177f1ce170a6364.zip
swift-c5dc30ae9ad8b9f3b0209c8ba177f1ce170a6364.tar.bz2
Work around incorrect roster responses from ejabberd.
Resolves: #1072
Diffstat (limited to 'Swiften/Queries/UnitTest')
-rw-r--r--Swiften/Queries/UnitTest/RequestTest.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/Swiften/Queries/UnitTest/RequestTest.cpp b/Swiften/Queries/UnitTest/RequestTest.cpp
index cf9b381..6c2a805 100644
--- a/Swiften/Queries/UnitTest/RequestTest.cpp
+++ b/Swiften/Queries/UnitTest/RequestTest.cpp
@@ -37,6 +37,7 @@ class RequestTest : public CppUnit::TestFixture {
CPPUNIT_TEST(testHandleIQ_ServerRespondsWithDomain);
CPPUNIT_TEST(testHandleIQ_ServerRespondsWithBareJID);
CPPUNIT_TEST(testHandleIQ_ServerRespondsWithoutFrom);
+ CPPUNIT_TEST(testHandleIQ_ServerRespondsWithFullJID);
CPPUNIT_TEST_SUITE_END();
public:
@@ -283,6 +284,20 @@ class RequestTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(channel_->iqs_.size()));
}
+ // This tests a bug in ejabberd servers (2.0.5)
+ void testHandleIQ_ServerRespondsWithFullJID() {
+ MyRequest testling(IQ::Get, JID(), payload_, router_);
+ router_->setJID("alice@wonderland.lit/TeaParty");
+ testling.onResponse.connect(boost::bind(&RequestTest::handleResponse, this, _1, _2));
+ testling.send();
+
+ channel_->onIQReceived(createResponse(JID("alice@wonderland.lit/TeaParty"),"test-id"));
+
+ CPPUNIT_ASSERT_EQUAL(1, responsesReceived_);
+ CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(receivedErrors.size()));
+ CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(channel_->iqs_.size()));
+ }
+
void testHandleIQ_ServerRespondsWithoutFrom() {
MyRequest testling(IQ::Get, JID(), payload_, router_);
router_->setJID("alice@wonderland.lit/TeaParty");