summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-03-22 16:08:32 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-03-22 16:08:32 (GMT)
commit6581ec0c0881263bea671c6122b546483ad6f2e8 (patch)
treeca413b51ccd3b27479954b460232ebf99ad05c6c /Swift
parentf5c2750f56c78d115bb9e8a7c5d50316da98b6d5 (diff)
downloadswift-6581ec0c0881263bea671c6122b546483ad6f2e8.zip
swift-6581ec0c0881263bea671c6122b546483ad6f2e8.tar.bz2
Updating unit tests to work again
Diffstat (limited to 'Swift')
-rw-r--r--Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp6
-rw-r--r--Swift/Controllers/EventWindowController.cpp1
-rw-r--r--Swift/Controllers/UnitTest/MockMainWindowFactory.h2
-rw-r--r--Swift/Controllers/UnitTest/RosterControllerTest.cpp8
4 files changed, 12 insertions, 5 deletions
diff --git a/Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp b/Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp
index ab1c03b..2bab1df 100644
--- a/Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp
+++ b/Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp
@@ -19,6 +19,7 @@
#include "Swiften/Client/DummyStanzaChannel.h"
#include "Swiften/Queries/DummyIQChannel.h"
#include "Swiften/Presence/PresenceOracle.h"
+#include "Swift/Controllers/UIEvents/UIEventStream.h"
using namespace Swift;
@@ -52,7 +53,8 @@ public:
presenceOracle_ = new PresenceOracle(stanzaChannel_);
serverDiscoInfo_ = boost::shared_ptr<DiscoInfo>(new DiscoInfo());
presenceSender_ = NULL;
- manager_ = new ChatsManager(jid_, stanzaChannel_, iqRouter_, eventController_, chatWindowFactory_, treeWidgetFactory_, nickResolver_, presenceOracle_, serverDiscoInfo_, presenceSender_);
+ uiEventStream_ = new UIEventStream();
+ manager_ = new ChatsManager(jid_, stanzaChannel_, iqRouter_, eventController_, chatWindowFactory_, treeWidgetFactory_, nickResolver_, presenceOracle_, serverDiscoInfo_, presenceSender_, uiEventStream_);
avatarManager_ = new MockAvatarManager();
manager_->setAvatarManager(avatarManager_);
};
@@ -68,6 +70,7 @@ public:
delete iqChannel_;
delete iqRouter_;
delete mocks_;
+ delete uiEventStream_;
}
void testFirstOpenWindowIncoming() {
@@ -263,6 +266,7 @@ private:
boost::shared_ptr<XMPPRoster> xmppRoster_;
PresenceSender* presenceSender_;
MockRepository* mocks_;
+ UIEventStream* uiEventStream_;
};
CPPUNIT_TEST_SUITE_REGISTRATION(ChatsManagerTest);
diff --git a/Swift/Controllers/EventWindowController.cpp b/Swift/Controllers/EventWindowController.cpp
index 0f91db7..1d18287 100644
--- a/Swift/Controllers/EventWindowController.cpp
+++ b/Swift/Controllers/EventWindowController.cpp
@@ -17,7 +17,6 @@ EventWindowController::~EventWindowController() {
void EventWindowController::handleEventQueueEventAdded(boost::shared_ptr<StanzaEvent> event) {
event->onConclusion.connect(boost::bind(&EventWindowController::handleEventConcluded, this, event));
- fprintf(stderr, "Adding to ewc\n");
window_->addEvent(event, true);
}
diff --git a/Swift/Controllers/UnitTest/MockMainWindowFactory.h b/Swift/Controllers/UnitTest/MockMainWindowFactory.h
index c67df72..a80663d 100644
--- a/Swift/Controllers/UnitTest/MockMainWindowFactory.h
+++ b/Swift/Controllers/UnitTest/MockMainWindowFactory.h
@@ -13,7 +13,7 @@ namespace Swift {
/**
* Transfers ownership of result.
*/
- virtual MainWindow* createMainWindow() {return new MockMainWindow(factory_->createTreeWidget());};
+ virtual MainWindow* createMainWindow(UIEventStream*) {return new MockMainWindow(factory_->createTreeWidget());};
private:
TreeWidgetFactory* factory_;
};
diff --git a/Swift/Controllers/UnitTest/RosterControllerTest.cpp b/Swift/Controllers/UnitTest/RosterControllerTest.cpp
index 67884d0..bfd98ac 100644
--- a/Swift/Controllers/UnitTest/RosterControllerTest.cpp
+++ b/Swift/Controllers/UnitTest/RosterControllerTest.cpp
@@ -1,3 +1,4 @@
+
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -14,6 +15,7 @@
#include "Swift/Controllers/EventController.h"
#include "Swiften/Presence/PresenceOracle.h"
#include "Swift/Controllers/NickResolver.h"
+#include "Swift/Controllers/UIEvents/UIEventStream.h"
using namespace Swift;
@@ -38,7 +40,8 @@ class RosterControllerTest : public CppUnit::TestFixture
stanzaChannel_ = new DummyStanzaChannel();
presenceOracle_ = new PresenceOracle(stanzaChannel_);
eventController_ = new EventController();
- rosterController_ = new RosterController(jid_, xmppRoster_, avatarManager_, mainWindowFactory_, treeWidgetFactory_, nickResolver_, presenceOracle_, eventController_);
+ uiEventStream_ = new UIEventStream();
+ rosterController_ = new RosterController(jid_, xmppRoster_, avatarManager_, mainWindowFactory_, treeWidgetFactory_, nickResolver_, presenceOracle_, eventController_, uiEventStream_);
};
@@ -54,6 +57,7 @@ class RosterControllerTest : public CppUnit::TestFixture
delete eventController_;
delete presenceOracle_;
delete stanzaChannel_;
+ delete uiEventStream_;
};
void testAdd() {
@@ -79,5 +83,5 @@ class RosterControllerTest : public CppUnit::TestFixture
IQRouter* router_;
PresenceOracle* presenceOracle_;
EventController* eventController_;
-
+ UIEventStream* uiEventStream_;
};