summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-08-28 09:42:34 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-08-28 09:42:34 (GMT)
commita9d22136fc81516b3b870f76efae2eb818e89122 (patch)
tree1b6fafe8315ce8ef01101bd04200d0c72a86fd13 /Swiften/Queries/UnitTest
parent5f1cb0d768265347bc80862c33f5967f07759b10 (diff)
downloadswift-contrib-a9d22136fc81516b3b870f76efae2eb818e89122.zip
swift-contrib-a9d22136fc81516b3b870f76efae2eb818e89122.tar.bz2
Fixed Request::isAccountJID().
Diffstat (limited to 'Swiften/Queries/UnitTest')
-rw-r--r--Swiften/Queries/UnitTest/RequestTest.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/Swiften/Queries/UnitTest/RequestTest.cpp b/Swiften/Queries/UnitTest/RequestTest.cpp
index b3925dd..75e0a1d 100644
--- a/Swiften/Queries/UnitTest/RequestTest.cpp
+++ b/Swiften/Queries/UnitTest/RequestTest.cpp
@@ -33,6 +33,7 @@ class RequestTest : public CppUnit::TestFixture {
CPPUNIT_TEST(testHandleIQ_SetWithSameID);
CPPUNIT_TEST(testHandleIQ_IncorrectSender);
CPPUNIT_TEST(testHandleIQ_IncorrectSenderForServerQuery);
+ CPPUNIT_TEST(testHandleIQ_IncorrectOtherResourceSenderForServerQuery);
CPPUNIT_TEST(testHandleIQ_ServerRespondsWithDomain);
CPPUNIT_TEST(testHandleIQ_ServerRespondsWithBareJID);
CPPUNIT_TEST(testHandleIQ_ServerRespondsWithoutFrom);
@@ -243,6 +244,19 @@ class RequestTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(channel_->iqs_.size()));
}
+ void testHandleIQ_IncorrectOtherResourceSenderForServerQuery() {
+ 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/RabbitHole"), "test-id"));
+
+ CPPUNIT_ASSERT_EQUAL(0, responsesReceived_);
+ CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(receivedErrors.size()));
+ CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(channel_->iqs_.size()));
+ }
+
void testHandleIQ_ServerRespondsWithDomain() {
MyRequest testling(IQ::Get, JID(), payload_, router_);
router_->setJID("alice@wonderland.lit/TeaParty");