summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/QA')
-rw-r--r--Swiften/QA/NetworkTest/BoostConnectionServerTest.cpp6
-rw-r--r--Swiften/QA/NetworkTest/BoostConnectionTest.cpp9
2 files changed, 9 insertions, 6 deletions
diff --git a/Swiften/QA/NetworkTest/BoostConnectionServerTest.cpp b/Swiften/QA/NetworkTest/BoostConnectionServerTest.cpp
index 1b21042..7488d50 100644
--- a/Swiften/QA/NetworkTest/BoostConnectionServerTest.cpp
+++ b/Swiften/QA/NetworkTest/BoostConnectionServerTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2015 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -24,18 +24,18 @@ class BoostConnectionServerTest : public CppUnit::TestFixture {
public:
void setUp() {
- boostIOServiceThread_ = new BoostIOServiceThread();
eventLoop_ = new DummyEventLoop();
+ boostIOServiceThread_ = new BoostIOServiceThread();
stopped = false;
stoppedError.reset();
}
void tearDown() {
+ delete boostIOServiceThread_;
while (eventLoop_->hasEvents()) {
eventLoop_->processEvents();
}
delete eventLoop_;
- delete boostIOServiceThread_;
}
void testConstructor_TwoServersOnSamePort() {
diff --git a/Swiften/QA/NetworkTest/BoostConnectionTest.cpp b/Swiften/QA/NetworkTest/BoostConnectionTest.cpp
index ff9ab0a..0cb38c3 100644
--- a/Swiften/QA/NetworkTest/BoostConnectionTest.cpp
+++ b/Swiften/QA/NetworkTest/BoostConnectionTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2013 Isode Limited.
+ * Copyright (c) 2010-2015 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -35,16 +35,19 @@ class BoostConnectionTest : public CppUnit::TestFixture {
public:
void setUp() {
+ eventLoop_ = new DummyEventLoop();
boostIOServiceThread_ = new BoostIOServiceThread();
boostIOService = boost::make_shared<boost::asio::io_service>();
- eventLoop_ = new DummyEventLoop();
disconnected = false;
connectFinished = false;
}
void tearDown() {
- delete eventLoop_;
delete boostIOServiceThread_;
+ while (eventLoop_->hasEvents()) {
+ eventLoop_->processEvents();
+ }
+ delete eventLoop_;
}
void testDestructor() {