From ff700194d1d6e8e347a50912de9320f9c3d463bb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Remko=20Tron=C3=A7on?= <git@el-tramo.be>
Date: Mon, 27 Dec 2010 13:38:47 +0100
Subject: Stop eventloop in ClientTest disconnect signal.


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();
 
-- 
cgit v0.10.2-6-g49f6