diff options
author | Remko Tronçon <git@el-tramo.be> | 2013-04-26 20:07:58 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2013-04-27 11:02:06 (GMT) |
commit | 5d8c328e236f57d7390d32f9ea7bd17a31e1e740 (patch) | |
tree | bebe606707a6b835fe3fd15e694d629b5e420947 /Swiften/Client/UnitTest | |
parent | aa131405927fc7f597ed06aff71abb0a30b59926 (diff) | |
download | swift-5d8c328e236f57d7390d32f9ea7bd17a31e1e740.zip swift-5d8c328e236f57d7390d32f9ea7bd17a31e1e740.tar.bz2 |
Removing third-party hash implementations.
Using library/platform implementation instead.
Change-Id: I2457c2dad80e6fdda023a7f31c3906ff10fe09ed
Diffstat (limited to 'Swiften/Client/UnitTest')
-rw-r--r-- | Swiften/Client/UnitTest/ClientSessionTest.cpp | 6 | ||||
-rw-r--r-- | Swiften/Client/UnitTest/NickResolverTest.cpp | 13 |
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); |