summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Avatars/UnitTest/VCardAvatarManagerTest.cpp')
-rw-r--r--Swiften/Avatars/UnitTest/VCardAvatarManagerTest.cpp39
1 files changed, 20 insertions, 19 deletions
diff --git a/Swiften/Avatars/UnitTest/VCardAvatarManagerTest.cpp b/Swiften/Avatars/UnitTest/VCardAvatarManagerTest.cpp
index e91e402..bd96b2d 100644
--- a/Swiften/Avatars/UnitTest/VCardAvatarManagerTest.cpp
+++ b/Swiften/Avatars/UnitTest/VCardAvatarManagerTest.cpp
@@ -4,22 +4,23 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/Base/ByteArray.h"
+#include <Swiften/Base/ByteArray.h>
+#include <QA/Checker/IO.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <boost/bind.hpp>
-#include "Swiften/Elements/VCard.h"
-#include "Swiften/Avatars/VCardAvatarManager.h"
-#include "Swiften/Avatars/AvatarMemoryStorage.h"
-#include "Swiften/VCards/VCardMemoryStorage.h"
-#include "Swiften/VCards/VCardManager.h"
-#include "Swiften/MUC/MUCRegistry.h"
-#include "Swiften/Queries/IQRouter.h"
-#include "Swiften/Client/DummyStanzaChannel.h"
-#include "Swiften/StringCodecs/SHA1.h"
-#include "Swiften/StringCodecs/Hexify.h"
+#include <Swiften/Elements/VCard.h>
+#include <Swiften/Avatars/VCardAvatarManager.h>
+#include <Swiften/Avatars/AvatarMemoryStorage.h>
+#include <Swiften/VCards/VCardMemoryStorage.h>
+#include <Swiften/VCards/VCardManager.h>
+#include <Swiften/MUC/MUCRegistry.h>
+#include <Swiften/Queries/IQRouter.h>
+#include <Swiften/Client/DummyStanzaChannel.h>
+#include <Swiften/StringCodecs/SHA1.h>
+#include <Swiften/StringCodecs/Hexify.h>
using namespace Swift;
@@ -42,7 +43,7 @@ class VCardAvatarManagerTest : public CppUnit::TestFixture {
avatarStorage = new AvatarMemoryStorage();
vcardStorage = new VCardMemoryStorage();
vcardManager = new VCardManager(ownJID, iqRouter, vcardStorage);
- avatar1 = ByteArray("abcdefg");
+ avatar1 = createByteArray("abcdefg");
avatar1Hash = Hexify::hexify(SHA1::getHash(avatar1));
user1 = JID("user1@bar.com/bla");
user2 = JID("user2@foo.com/baz");
@@ -58,7 +59,7 @@ class VCardAvatarManagerTest : public CppUnit::TestFixture {
}
void testGetAvatarHashKnownAvatar() {
- std::auto_ptr<VCardAvatarManager> testling = createManager();
+ boost::shared_ptr<VCardAvatarManager> testling = createManager();
storeVCardWithPhoto(user1.toBare(), avatar1);
avatarStorage->addAvatar(avatar1Hash, avatar1);
@@ -68,7 +69,7 @@ class VCardAvatarManagerTest : public CppUnit::TestFixture {
}
void testGetAvatarHashEmptyAvatar() {
- std::auto_ptr<VCardAvatarManager> testling = createManager();
+ boost::shared_ptr<VCardAvatarManager> testling = createManager();
storeEmptyVCard(user1.toBare());
std::string result = testling->getAvatarHash(user1);
@@ -77,7 +78,7 @@ class VCardAvatarManagerTest : public CppUnit::TestFixture {
}
void testGetAvatarHashUnknownAvatarKnownVCardStoresAvatar() {
- std::auto_ptr<VCardAvatarManager> testling = createManager();
+ boost::shared_ptr<VCardAvatarManager> testling = createManager();
storeVCardWithPhoto(user1.toBare(), avatar1);
std::string result = testling->getAvatarHash(user1);
@@ -88,7 +89,7 @@ class VCardAvatarManagerTest : public CppUnit::TestFixture {
}
void testGetAvatarHashUnknownAvatarUnknownVCard() {
- std::auto_ptr<VCardAvatarManager> testling = createManager();
+ boost::shared_ptr<VCardAvatarManager> testling = createManager();
std::string result = testling->getAvatarHash(user1);
@@ -96,7 +97,7 @@ class VCardAvatarManagerTest : public CppUnit::TestFixture {
}
void testVCardUpdateTriggersUpdate() {
- std::auto_ptr<VCardAvatarManager> testling = createManager();
+ boost::shared_ptr<VCardAvatarManager> testling = createManager();
vcardManager->requestVCard(user1);
sendVCardResult();
@@ -104,8 +105,8 @@ class VCardAvatarManagerTest : public CppUnit::TestFixture {
}
private:
- std::auto_ptr<VCardAvatarManager> createManager() {
- std::auto_ptr<VCardAvatarManager> result(new VCardAvatarManager(vcardManager, avatarStorage, mucRegistry));
+ boost::shared_ptr<VCardAvatarManager> createManager() {
+ boost::shared_ptr<VCardAvatarManager> result(new VCardAvatarManager(vcardManager, avatarStorage, mucRegistry));
result->onAvatarChanged.connect(boost::bind(&VCardAvatarManagerTest::handleAvatarChanged, this, _1));
return result;
}