summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/QA/ClientTest/ClientTest.cpp')
-rw-r--r--Swiften/QA/ClientTest/ClientTest.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/Swiften/QA/ClientTest/ClientTest.cpp b/Swiften/QA/ClientTest/ClientTest.cpp
index b50a0bf..cf1c161 100644
--- a/Swiften/QA/ClientTest/ClientTest.cpp
+++ b/Swiften/QA/ClientTest/ClientTest.cpp
@@ -15,12 +15,20 @@ using namespace Swift;
SimpleEventLoop eventLoop;
Client* client = 0;
+bool reconnected = false;
bool rosterReceived = false;
void handleRosterReceived(boost::shared_ptr<Payload>) {
- rosterReceived = true;
- client->disconnect();
- eventLoop.stop();
+ if (reconnected) {
+ rosterReceived = true;
+ client->disconnect();
+ eventLoop.stop();
+ }
+ else {
+ reconnected = true;
+ client->disconnect();
+ client->connect();
+ }
}
void handleConnected() {