diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-12-27 12:38:47 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-12-27 12:38:47 (GMT) |
commit | ff700194d1d6e8e347a50912de9320f9c3d463bb (patch) | |
tree | be23df76e81f0b010c0516489e6fe7f4329d1858 /Swiften/QA | |
parent | 8531a4d2afb73d67ba064e2d38864208082e7c15 (diff) | |
download | swift-contrib-ff700194d1d6e8e347a50912de9320f9c3d463bb.zip swift-contrib-ff700194d1d6e8e347a50912de9320f9c3d463bb.tar.bz2 |
Stop eventloop in ClientTest disconnect signal.
Diffstat (limited to 'Swiften/QA')
-rw-r--r-- | Swiften/QA/ClientTest/ClientTest.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Swiften/QA/ClientTest/ClientTest.cpp b/Swiften/QA/ClientTest/ClientTest.cpp index 511deb4..f5ea43f 100644 --- a/Swiften/QA/ClientTest/ClientTest.cpp +++ b/Swiften/QA/ClientTest/ClientTest.cpp @@ -24,11 +24,15 @@ Client* client = 0; bool reconnected = false; bool rosterReceived = false; +void handleDisconnected(boost::optional<ClientError>) { + eventLoop.stop(); +} + void handleRosterReceived(boost::shared_ptr<Payload>) { if (reconnected) { rosterReceived = true; + client->onDisconnected.connect(boost::bind(&handleDisconnected, _1)); client->disconnect(); - eventLoop.stop(); } else { reconnected = true; @@ -62,7 +66,7 @@ int main(int, char**) { client->connect(); { - Timer::ref timer = networkFactories.getTimerFactory()->createTimer(30000); + Timer::ref timer = networkFactories.getTimerFactory()->createTimer(60000); timer->onTick.connect(boost::bind(&SimpleEventLoop::stop, &eventLoop)); timer->start(); |