summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Client/UnitTest')
-rw-r--r--Swiften/Client/UnitTest/ClientSessionTest.cpp6
-rw-r--r--Swiften/Client/UnitTest/NickResolverTest.cpp13
2 files changed, 16 insertions, 3 deletions
diff --git a/Swiften/Client/UnitTest/ClientSessionTest.cpp b/Swiften/Client/UnitTest/ClientSessionTest.cpp
index 63c922c..4ef6727 100644
--- a/Swiften/Client/UnitTest/ClientSessionTest.cpp
+++ b/Swiften/Client/UnitTest/ClientSessionTest.cpp
@@ -33,6 +33,8 @@
#include <Swiften/Elements/ResourceBind.h>
#include <Swiften/TLS/SimpleCertificate.h>
#include <Swiften/TLS/BlindCertificateTrustChecker.h>
+#include <Swiften/Crypto/CryptoProvider.h>
+#include <Swiften/Crypto/PlatformCryptoProvider.h>
using namespace Swift;
@@ -71,6 +73,7 @@ class ClientSessionTest : public CppUnit::TestFixture {
public:
void setUp() {
+ crypto = boost::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
idnConverter = boost::shared_ptr<IDNConverter>(PlatformIDNConverter::create());
server = boost::make_shared<MockSessionStream>();
sessionFinishedReceived = false;
@@ -342,7 +345,7 @@ class ClientSessionTest : public CppUnit::TestFixture {
private:
boost::shared_ptr<ClientSession> createSession() {
- boost::shared_ptr<ClientSession> session = ClientSession::create(JID("me@foo.com"), server, idnConverter.get());
+ boost::shared_ptr<ClientSession> session = ClientSession::create(JID("me@foo.com"), server, idnConverter.get(), crypto.get());
session->onFinished.connect(boost::bind(&ClientSessionTest::handleSessionFinished, this, _1));
session->onNeedCredentials.connect(boost::bind(&ClientSessionTest::handleSessionNeedCredentials, this));
session->setAllowPLAINOverNonTLS(true);
@@ -625,6 +628,7 @@ class ClientSessionTest : public CppUnit::TestFixture {
bool needCredentials;
boost::shared_ptr<Error> sessionFinishedError;
BlindCertificateTrustChecker* blindCertificateTrustChecker;
+ boost::shared_ptr<CryptoProvider> crypto;
};
CPPUNIT_TEST_SUITE_REGISTRATION(ClientSessionTest);
diff --git a/Swiften/Client/UnitTest/NickResolverTest.cpp b/Swiften/Client/UnitTest/NickResolverTest.cpp
index dfc90fe..a8b011c 100644
--- a/Swiften/Client/UnitTest/NickResolverTest.cpp
+++ b/Swiften/Client/UnitTest/NickResolverTest.cpp
@@ -4,6 +4,12 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
+/*
+ * Copyright (c) 2013 Remko Tronçon
+ * Licensed under the GNU General Public License.
+ * See the COPYING file for more information.
+ */
+
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -14,6 +20,8 @@
#include <Swiften/VCards/VCardMemoryStorage.h>
#include <Swiften/Queries/IQRouter.h>
#include <Swiften/Client/DummyStanzaChannel.h>
+#include <Swiften/Crypto/CryptoProvider.h>
+#include <Swiften/Crypto/PlatformCryptoProvider.h>
using namespace Swift;
@@ -34,11 +42,12 @@ class NickResolverTest : public CppUnit::TestFixture {
public:
void setUp() {
+ crypto = boost::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
ownJID_ = JID("kev@wonderland.lit");
xmppRoster_ = new XMPPRosterImpl();
stanzaChannel_ = new DummyStanzaChannel();
iqRouter_ = new IQRouter(stanzaChannel_);
- vCardStorage_ = new VCardMemoryStorage();
+ vCardStorage_ = new VCardMemoryStorage(crypto.get());
vCardManager_ = new VCardManager(ownJID_, iqRouter_, vCardStorage_);
registry_ = new MUCRegistry();
resolver_ = new NickResolver(ownJID_, xmppRoster_, vCardManager_, registry_);
@@ -144,7 +153,7 @@ class NickResolverTest : public CppUnit::TestFixture {
MUCRegistry* registry_;
NickResolver* resolver_;
JID ownJID_;
-
+ boost::shared_ptr<CryptoProvider> crypto;
};
CPPUNIT_TEST_SUITE_REGISTRATION(NickResolverTest);