summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-09-11 13:46:08 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-09-11 14:02:39 (GMT)
commit1b47266d6b955fb533b4c272b4bcc58693078a1a (patch)
treedd52b86408a03308c84c33674989d2d75af58893 /Swiften/Client/UnitTest
parent5e235d01612b2544fe02cc34816cd6e925ed564f (diff)
downloadswift-contrib-1b47266d6b955fb533b4c272b4bcc58693078a1a.zip
swift-contrib-1b47266d6b955fb533b4c272b4bcc58693078a1a.tar.bz2
Disable WhitespacePingLayer on disconnect + Timer refactoring.
Timer now no longer runs in its own thread, but in the main Boost IOService thread.
Diffstat (limited to 'Swiften/Client/UnitTest')
-rw-r--r--Swiften/Client/UnitTest/ClientSessionTest.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/Swiften/Client/UnitTest/ClientSessionTest.cpp b/Swiften/Client/UnitTest/ClientSessionTest.cpp
index bb10cfd..cbf20d2 100644
--- a/Swiften/Client/UnitTest/ClientSessionTest.cpp
+++ b/Swiften/Client/UnitTest/ClientSessionTest.cpp
@@ -39,6 +39,7 @@ using namespace Swift;
class ClientSessionTest : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(ClientSessionTest);
CPPUNIT_TEST(testConstructor);
+ CPPUNIT_TEST(testDisconnect);
/*
CPPUNIT_TEST(testStart_Error);
CPPUNIT_TEST(testStart_XMLError);
@@ -84,6 +85,21 @@ class ClientSessionTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(ClientSession::Initial, session->getState());
}
+ void testDisconnect() {
+ boost::shared_ptr<MockSession> session(createSession("me@foo.com/Bar"));
+
+ /*
+ session->startSession();
+ processEvents();
+ session->finishSession();
+ processEvents();
+
+ boost::shared_ptr<WhitespacePingLayer> whitespacePingLayer = session->getWhitespacePingLayer();
+ CPPUNIT_ASSERT(whitespacePingLayer);
+ */
+ //CPPUNIT_ASSERT(!whitespacePingLayer->isActive());
+ }
+
/*
void testStart_Error() {
boost::shared_ptr<MockSession> session(createSession("me@foo.com/Bar"));
@@ -650,6 +666,12 @@ class ClientSessionTest : public CppUnit::TestFixture {
*/
private:
+ void processEvents() {
+ eventLoop_->processEvents();
+ }
+
+
+ private:
struct MockConnection : public Connection, public XMPPParserClient {
MockConnection() :
resetParser_(false),