summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-10-27 19:06:56 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-10-27 19:07:55 (GMT)
commit6810a2896f27e7ee07aee847f5e8dbccd1f6ec89 (patch)
treef7ea87f030e57cb4494a4f897506fb18fc3d2241 /Swiften/QA
parenta7da393cfc807048d320ddba8a1c7d24ef23a46e (diff)
downloadswift-contrib-6810a2896f27e7ee07aee847f5e8dbccd1f6ec89.zip
swift-contrib-6810a2896f27e7ee07aee847f5e8dbccd1f6ec89.tar.bz2
Remove MainEventLoop singleton.
The event loop now needs to be explicitly passed to clients using it.
Diffstat (limited to 'Swiften/QA')
-rw-r--r--Swiften/QA/ClientTest/ClientTest.cpp6
-rw-r--r--Swiften/QA/NetworkTest/BoostConnectionServerTest.cpp12
-rw-r--r--Swiften/QA/NetworkTest/BoostConnectionTest.cpp6
-rw-r--r--Swiften/QA/NetworkTest/DomainNameResolverTest.cpp2
-rw-r--r--Swiften/QA/ReconnectTest/ReconnectTest.cpp2
5 files changed, 14 insertions, 14 deletions
diff --git a/Swiften/QA/ClientTest/ClientTest.cpp b/Swiften/QA/ClientTest/ClientTest.cpp
index f504d2c..4e48339 100644
--- a/Swiften/QA/ClientTest/ClientTest.cpp
+++ b/Swiften/QA/ClientTest/ClientTest.cpp
@@ -9,7 +9,7 @@
#include "Swiften/Client/Client.h"
#include "Swiften/Network/BoostTimer.h"
-#include "Swiften/EventLoop/MainEventLoop.h"
+#include "Swiften/EventLoop/EventLoop.h"
#include "Swiften/EventLoop/SimpleEventLoop.h"
#include "Swiften/Roster/GetRosterRequest.h"
#include "Swiften/Client/ClientXMLTracer.h"
@@ -55,13 +55,13 @@ int main(int, char**) {
return -1;
}
- client = new Swift::Client(JID(jid), String(pass));
+ client = new Swift::Client(&eventLoop, JID(jid), String(pass));
ClientXMLTracer* tracer = new ClientXMLTracer(client);
client->onConnected.connect(&handleConnected);
client->connect();
{
- boost::shared_ptr<BoostTimer> timer(BoostTimer::create(30000, &MainBoostIOServiceThread::getInstance().getIOService()));
+ boost::shared_ptr<BoostTimer> timer(BoostTimer::create(30000, &MainBoostIOServiceThread::getInstance().getIOService(), &eventLoop));
timer->onTick.connect(boost::bind(&SimpleEventLoop::stop, &eventLoop));
timer->start();
diff --git a/Swiften/QA/NetworkTest/BoostConnectionServerTest.cpp b/Swiften/QA/NetworkTest/BoostConnectionServerTest.cpp
index 543e085..4c38576 100644
--- a/Swiften/QA/NetworkTest/BoostConnectionServerTest.cpp
+++ b/Swiften/QA/NetworkTest/BoostConnectionServerTest.cpp
@@ -39,15 +39,15 @@ class BoostConnectionServerTest : public CppUnit::TestFixture {
}
void testConstructor_TwoServersOnSamePort() {
- BoostConnectionServer::ref testling(BoostConnectionServer::create(9999, &boostIOServiceThread_->getIOService()));
- BoostConnectionServer::ref testling2(BoostConnectionServer::create(9999, &boostIOServiceThread_->getIOService()));
+ BoostConnectionServer::ref testling(BoostConnectionServer::create(9999, &boostIOServiceThread_->getIOService(), eventLoop_));
+ BoostConnectionServer::ref testling2(BoostConnectionServer::create(9999, &boostIOServiceThread_->getIOService(), eventLoop_));
}
void testStart_Conflict() {
- BoostConnectionServer::ref testling(BoostConnectionServer::create(9999, &boostIOServiceThread_->getIOService()));
+ BoostConnectionServer::ref testling(BoostConnectionServer::create(9999, &boostIOServiceThread_->getIOService(), eventLoop_));
testling->start();
- BoostConnectionServer::ref testling2(BoostConnectionServer::create(9999, &boostIOServiceThread_->getIOService()));
+ BoostConnectionServer::ref testling2(BoostConnectionServer::create(9999, &boostIOServiceThread_->getIOService(), eventLoop_));
testling2->onStopped.connect(
boost::bind(&BoostConnectionServerTest::handleStopped, this, _1));
@@ -55,12 +55,12 @@ class BoostConnectionServerTest : public CppUnit::TestFixture {
}
void testStop() {
- BoostConnectionServer::ref testling(BoostConnectionServer::create(9999, &boostIOServiceThread_->getIOService()));
+ BoostConnectionServer::ref testling(BoostConnectionServer::create(9999, &boostIOServiceThread_->getIOService(), eventLoop_));
testling->start();
testling->stop();
- BoostConnectionServer::ref testling2(BoostConnectionServer::create(9999, &boostIOServiceThread_->getIOService()));
+ BoostConnectionServer::ref testling2(BoostConnectionServer::create(9999, &boostIOServiceThread_->getIOService(), eventLoop_));
testling2->start();
testling2->stop();
diff --git a/Swiften/QA/NetworkTest/BoostConnectionTest.cpp b/Swiften/QA/NetworkTest/BoostConnectionTest.cpp
index 913f7c0..6d6fddf 100644
--- a/Swiften/QA/NetworkTest/BoostConnectionTest.cpp
+++ b/Swiften/QA/NetworkTest/BoostConnectionTest.cpp
@@ -43,14 +43,14 @@ class BoostConnectionTest : public CppUnit::TestFixture {
void testDestructor() {
{
- BoostConnection::ref testling(BoostConnection::create(&boostIOServiceThread_->getIOService()));
+ BoostConnection::ref testling(BoostConnection::create(&boostIOServiceThread_->getIOService(), eventLoop_));
testling->connect(HostAddressPort(HostAddress(address, 4), 5222));
}
}
void testDestructor_PendingEvents() {
{
- BoostConnection::ref testling(BoostConnection::create(&boostIOServiceThread_->getIOService()));
+ BoostConnection::ref testling(BoostConnection::create(&boostIOServiceThread_->getIOService(), eventLoop_));
testling->connect(HostAddressPort(HostAddress(address, 4), 5222));
while (!eventLoop_->hasEvents()) {
Swift::sleep(10);
@@ -60,7 +60,7 @@ class BoostConnectionTest : public CppUnit::TestFixture {
}
void testWrite() {
- BoostConnection::ref testling(BoostConnection::create(&boostIOServiceThread_->getIOService()));
+ BoostConnection::ref testling(BoostConnection::create(&boostIOServiceThread_->getIOService(), eventLoop_));
testling->onConnectFinished.connect(boost::bind(&BoostConnectionTest::doWrite, this, testling.get()));
testling->onDataRead.connect(boost::bind(&BoostConnectionTest::handleDataRead, this, _1));
testling->onDisconnected.connect(boost::bind(&BoostConnectionTest::handleDisconnected, this));
diff --git a/Swiften/QA/NetworkTest/DomainNameResolverTest.cpp b/Swiften/QA/NetworkTest/DomainNameResolverTest.cpp
index 309e617..c853d68 100644
--- a/Swiften/QA/NetworkTest/DomainNameResolverTest.cpp
+++ b/Swiften/QA/NetworkTest/DomainNameResolverTest.cpp
@@ -43,7 +43,7 @@ class DomainNameResolverTest : public CppUnit::TestFixture {
void setUp() {
eventLoop = new DummyEventLoop();
- resolver = new PlatformDomainNameResolver();
+ resolver = new PlatformDomainNameResolver(eventLoop);
resultsAvailable = false;
}
diff --git a/Swiften/QA/ReconnectTest/ReconnectTest.cpp b/Swiften/QA/ReconnectTest/ReconnectTest.cpp
index c4e34ac..e74ae27 100644
--- a/Swiften/QA/ReconnectTest/ReconnectTest.cpp
+++ b/Swiften/QA/ReconnectTest/ReconnectTest.cpp
@@ -9,7 +9,7 @@
#include "Swiften/Client/Client.h"
#include "Swiften/Network/BoostTimer.h"
-#include "Swiften/EventLoop/MainEventLoop.h"
+#include "Swiften/EventLoop/EventLoop.h"
#include "Swiften/EventLoop/SimpleEventLoop.h"
#include "Swiften/Roster/GetRosterRequest.h"
#include "Swiften/Client/ClientXMLTracer.h"