summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-05-02 18:17:19 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-05-02 18:24:14 (GMT)
commit81443e9863763187a4d6e40a5b7c75be6ad39809 (patch)
treec75225e9826b96d1d83c0702dbfa9b3bf1924a15
parent2d84b0e551a2661c03bdb96f575effb47b22d678 (diff)
downloadswift-contrib-81443e9863763187a4d6e40a5b7c75be6ad39809.zip
swift-contrib-81443e9863763187a4d6e40a5b7c75be6ad39809.tar.bz2
Replace auto_ptr by shared_ptr.
-rw-r--r--Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp30
-rw-r--r--Swift/Controllers/UnitTest/PresenceNotifierTest.cpp42
-rw-r--r--Swiften/Avatars/UnitTest/CombinedAvatarProviderTest.cpp28
-rw-r--r--Swiften/Avatars/UnitTest/VCardAvatarManagerTest.cpp14
-rw-r--r--Swiften/Avatars/UnitTest/VCardUpdateAvatarManagerTest.cpp18
-rw-r--r--Swiften/Disco/UnitTest/CapsManagerTest.cpp36
-rw-r--r--Swiften/Disco/UnitTest/EntityCapsManagerTest.cpp18
-rw-r--r--Swiften/Entity/PayloadPersister.cpp2
-rw-r--r--Swiften/FileTransfer/UnitTest/IBBReceiveSessionTest.cpp16
-rw-r--r--Swiften/FileTransfer/UnitTest/IBBSendSessionTest.cpp18
-rw-r--r--Swiften/FileTransfer/UnitTest/SOCKS5BytestreamServerSessionTest.cpp12
-rw-r--r--Swiften/History/UnitTest/SQLiteHistoryManagerTest.cpp16
-rw-r--r--Swiften/Parser/PayloadParsers/PrivateStorageParser.h2
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h2
-rw-r--r--Swiften/Parser/StanzaParser.h8
-rw-r--r--Swiften/Presence/UnitTest/DirectedPresenceSenderTest.cpp16
-rw-r--r--Swiften/Presence/UnitTest/PayloadAddingPresenceSenderTest.cpp16
-rw-r--r--Swiften/QA/StorageTest/FileReadBytestreamTest.cpp8
-rw-r--r--Swiften/QA/StorageTest/VCardFileStorageTest.cpp6
-rw-r--r--Swiften/Roster/UnitTest/XMPPRosterControllerTest.cpp16
-rw-r--r--Swiften/Serializer/UnitTest/XMPPSerializerTest.cpp6
-rw-r--r--Swiften/StreamManagement/UnitTest/StanzaAckRequesterTest.cpp16
-rw-r--r--Swiften/StreamManagement/UnitTest/StanzaAckResponderTest.cpp8
-rw-r--r--Swiften/StreamStack/UnitTest/StreamStackTest.cpp14
-rw-r--r--Swiften/VCards/UnitTest/VCardManagerTest.cpp24
25 files changed, 195 insertions, 197 deletions
diff --git a/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp b/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp
index 1f41c55..e45861b 100644
--- a/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp
+++ b/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp
@@ -56,14 +56,14 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
void testConstructor() {
addService("alice@wonderland");
addService("rabbit@teaparty");
- std::auto_ptr<LinkLocalPresenceManager> testling(createTestling());
+ boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(testling->getRoster()->getItems().size()));
CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(testling->getAllPresence().size()));
}
void testServiceAdded() {
- std::auto_ptr<LinkLocalPresenceManager> testling(createTestling());
+ boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland", "Alice");
@@ -79,7 +79,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
void testServiceRemoved() {
- std::auto_ptr<LinkLocalPresenceManager> testling(createTestling());
+ boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland");
removeService("alice@wonderland");
@@ -92,7 +92,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
void testServiceChanged() {
- std::auto_ptr<LinkLocalPresenceManager> testling(createTestling());
+ boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland");
updateServicePresence("alice@wonderland", LinkLocalServiceInfo::Away, "I'm Away");
@@ -105,7 +105,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
void testGetAllPresence() {
- std::auto_ptr<LinkLocalPresenceManager> testling(createTestling());
+ boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland");
addService("rabbit@teaparty");
@@ -121,7 +121,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
void testGetRoster() {
- std::auto_ptr<LinkLocalPresenceManager> testling(createTestling());
+ boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland", "Alice");
addService("rabbit@teaparty", "Rabbit");
@@ -140,7 +140,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
void testGetRoster_InfoWithNick() {
- std::auto_ptr<LinkLocalPresenceManager> testling(createTestling());
+ boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland", "Alice", "Alice In", "Wonderland");
@@ -149,7 +149,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
void testGetRoster_InfoWithFirstName() {
- std::auto_ptr<LinkLocalPresenceManager> testling(createTestling());
+ boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland", "", "Alice In", "");
@@ -158,7 +158,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
void testGetRoster_InfoWithLastName() {
- std::auto_ptr<LinkLocalPresenceManager> testling(createTestling());
+ boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland", "", "", "Wonderland");
@@ -167,7 +167,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
void testGetRoster_InfoWithFirstAndLastName() {
- std::auto_ptr<LinkLocalPresenceManager> testling(createTestling());
+ boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland", "", "Alice In", "Wonderland");
@@ -176,7 +176,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
void testGetRoster_NoInfo() {
- std::auto_ptr<LinkLocalPresenceManager> testling(createTestling());
+ boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland");
@@ -185,7 +185,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
void testGetServiceForJID() {
- std::auto_ptr<LinkLocalPresenceManager> testling(createTestling());
+ boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland");
addService("rabbit@teaparty");
@@ -197,7 +197,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
void testGetServiceForJID_NoMatch() {
- std::auto_ptr<LinkLocalPresenceManager> testling(createTestling());
+ boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland");
addService("queen@garden");
@@ -206,8 +206,8 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
private:
- std::auto_ptr<LinkLocalPresenceManager> createTestling() {
- std::auto_ptr<LinkLocalPresenceManager> testling(
+ boost::shared_ptr<LinkLocalPresenceManager> createTestling() {
+ boost::shared_ptr<LinkLocalPresenceManager> testling(
new LinkLocalPresenceManager(browser));
testling->onRosterChanged.connect(boost::bind(
&LinkLocalPresenceManagerTest::handleRosterChanged, this, _1));
diff --git a/Swift/Controllers/UnitTest/PresenceNotifierTest.cpp b/Swift/Controllers/UnitTest/PresenceNotifierTest.cpp
index 42cfc5f..d1c5bbe 100644
--- a/Swift/Controllers/UnitTest/PresenceNotifierTest.cpp
+++ b/Swift/Controllers/UnitTest/PresenceNotifierTest.cpp
@@ -70,7 +70,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testReceiveFirstPresenceCreatesAvailableNotification() {
- std::auto_ptr<PresenceNotifier> testling = createNotifier();
+ boost::shared_ptr<PresenceNotifier> testling = createNotifier();
sendPresence(user1, StatusShow::Online);
@@ -79,7 +79,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testReceiveSecondPresenceCreatesStatusChangeNotification() {
- std::auto_ptr<PresenceNotifier> testling = createNotifier();
+ boost::shared_ptr<PresenceNotifier> testling = createNotifier();
sendPresence(user1, StatusShow::Away);
notifier->notifications.clear();
@@ -90,7 +90,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testReceiveUnavailablePresenceAfterAvailablePresenceCreatesUnavailableNotification() {
- std::auto_ptr<PresenceNotifier> testling = createNotifier();
+ boost::shared_ptr<PresenceNotifier> testling = createNotifier();
sendPresence(user1, StatusShow::Away);
notifier->notifications.clear();
@@ -101,7 +101,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testReceiveUnavailablePresenceWithoutAvailableDoesNotCreateNotification() {
- std::auto_ptr<PresenceNotifier> testling = createNotifier();
+ boost::shared_ptr<PresenceNotifier> testling = createNotifier();
sendUnavailablePresence(user1);
@@ -109,7 +109,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testReceiveAvailablePresenceAfterUnavailableCreatesAvailableNotification() {
- std::auto_ptr<PresenceNotifier> testling = createNotifier();
+ boost::shared_ptr<PresenceNotifier> testling = createNotifier();
sendPresence(user1, StatusShow::Away);
sendUnavailablePresence(user1);
notifier->notifications.clear();
@@ -121,7 +121,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testReceiveAvailablePresenceAfterReconnectCreatesAvailableNotification() {
- std::auto_ptr<PresenceNotifier> testling = createNotifier();
+ boost::shared_ptr<PresenceNotifier> testling = createNotifier();
sendPresence(user1, StatusShow::Away);
stanzaChannel->setAvailable(false);
stanzaChannel->setAvailable(true);
@@ -134,7 +134,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testReceiveAvailablePresenceFromMUCDoesNotCreateNotification() {
- std::auto_ptr<PresenceNotifier> testling = createNotifier();
+ boost::shared_ptr<PresenceNotifier> testling = createNotifier();
mucRegistry->addMUC(JID("teaparty@wonderland.lit"));
sendPresence(JID("teaparty@wonderland.lit/Alice"), StatusShow::Away);
@@ -143,7 +143,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testNotificationPicture() {
- std::auto_ptr<PresenceNotifier> testling = createNotifier();
+ boost::shared_ptr<PresenceNotifier> testling = createNotifier();
avatarManager->avatars[user1] = ByteArray("abcdef");
sendPresence(user1, StatusShow::Online);
@@ -153,7 +153,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testNotificationActivationEmitsSignal() {
- std::auto_ptr<PresenceNotifier> testling = createNotifier();
+ boost::shared_ptr<PresenceNotifier> testling = createNotifier();
sendPresence(user1, StatusShow::Online);
CPPUNIT_ASSERT(notifier->notifications[0].callback);
@@ -164,7 +164,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testNotificationSubjectContainsNameForJIDInRoster() {
- std::auto_ptr<PresenceNotifier> testling = createNotifier();
+ boost::shared_ptr<PresenceNotifier> testling = createNotifier();
roster->addContact(user1.toBare(), "User 1", std::vector<std::string>(), RosterItemPayload::Both);
sendPresence(user1, StatusShow::Online);
@@ -175,7 +175,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testNotificationSubjectContainsJIDForJIDNotInRoster() {
- std::auto_ptr<PresenceNotifier> testling = createNotifier();
+ boost::shared_ptr<PresenceNotifier> testling = createNotifier();
sendPresence(user1, StatusShow::Online);
@@ -185,7 +185,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testNotificationSubjectContainsStatus() {
- std::auto_ptr<PresenceNotifier> testling = createNotifier();
+ boost::shared_ptr<PresenceNotifier> testling = createNotifier();
sendPresence(user1, StatusShow::Away);
@@ -195,7 +195,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testNotificationMessageContainsStatusMessage() {
- std::auto_ptr<PresenceNotifier> testling = createNotifier();
+ boost::shared_ptr<PresenceNotifier> testling = createNotifier();
sendPresence(user1, StatusShow::Away);
@@ -204,7 +204,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testReceiveFirstPresenceWithQuietPeriodDoesNotNotify() {
- std::auto_ptr<PresenceNotifier> testling = createNotifier();
+ boost::shared_ptr<PresenceNotifier> testling = createNotifier();
testling->setInitialQuietPeriodMS(10);
sendPresence(user1, StatusShow::Online);
@@ -213,7 +213,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testReceivePresenceDuringQuietPeriodDoesNotNotify() {
- std::auto_ptr<PresenceNotifier> testling = createNotifier();
+ boost::shared_ptr<PresenceNotifier> testling = createNotifier();
testling->setInitialQuietPeriodMS(10);
sendPresence(user1, StatusShow::Online);
@@ -224,7 +224,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testReceivePresenceDuringQuietPeriodResetsTimer() {
- std::auto_ptr<PresenceNotifier> testling = createNotifier();
+ boost::shared_ptr<PresenceNotifier> testling = createNotifier();
testling->setInitialQuietPeriodMS(10);
sendPresence(user1, StatusShow::Online);
@@ -237,7 +237,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testReceivePresenceAfterQuietPeriodNotifies() {
- std::auto_ptr<PresenceNotifier> testling = createNotifier();
+ boost::shared_ptr<PresenceNotifier> testling = createNotifier();
testling->setInitialQuietPeriodMS(10);
sendPresence(user1, StatusShow::Online);
@@ -248,7 +248,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testReceiveFirstPresenceWithQuietPeriodDoesNotCountAsQuietPeriod() {
- std::auto_ptr<PresenceNotifier> testling = createNotifier();
+ boost::shared_ptr<PresenceNotifier> testling = createNotifier();
testling->setInitialQuietPeriodMS(10);
timerFactory->setTime(11);
@@ -258,7 +258,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testReceiveFirstPresenceAfterReconnectWithQuietPeriodDoesNotNotify() {
- std::auto_ptr<PresenceNotifier> testling = createNotifier();
+ boost::shared_ptr<PresenceNotifier> testling = createNotifier();
testling->setInitialQuietPeriodMS(10);
sendPresence(user1, StatusShow::Online);
timerFactory->setTime(15);
@@ -275,8 +275,8 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
private:
- std::auto_ptr<PresenceNotifier> createNotifier() {
- std::auto_ptr<PresenceNotifier> result(new PresenceNotifier(stanzaChannel, notifier, mucRegistry, avatarManager, nickResolver, presenceOracle, timerFactory));
+ boost::shared_ptr<PresenceNotifier> createNotifier() {
+ boost::shared_ptr<PresenceNotifier> result(new PresenceNotifier(stanzaChannel, notifier, mucRegistry, avatarManager, nickResolver, presenceOracle, timerFactory));
result->onNotificationActivated.connect(boost::bind(&PresenceNotifierTest::handleNotificationActivated, this, _1));
result->setInitialQuietPeriodMS(0);
return result;
diff --git a/Swiften/Avatars/UnitTest/CombinedAvatarProviderTest.cpp b/Swiften/Avatars/UnitTest/CombinedAvatarProviderTest.cpp
index 422610d..50b0adb 100644
--- a/Swiften/Avatars/UnitTest/CombinedAvatarProviderTest.cpp
+++ b/Swiften/Avatars/UnitTest/CombinedAvatarProviderTest.cpp
@@ -47,13 +47,13 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture {
}
void testGetAvatarWithNoAvatarProviderReturnsEmpty() {
- std::auto_ptr<CombinedAvatarProvider> testling(createProvider());
+ boost::shared_ptr<CombinedAvatarProvider> testling(createProvider());
CPPUNIT_ASSERT(testling->getAvatarHash(user1).empty());
}
void testGetAvatarWithSingleAvatarProvider() {
- std::auto_ptr<CombinedAvatarProvider> testling(createProvider());
+ boost::shared_ptr<CombinedAvatarProvider> testling(createProvider());
avatarProvider1->avatars[user1] = avatarHash1;
testling->addProvider(avatarProvider1);
@@ -61,7 +61,7 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture {
}
void testGetAvatarWithMultipleAvatarProviderReturnsFirstAvatar() {
- std::auto_ptr<CombinedAvatarProvider> testling(createProvider());
+ boost::shared_ptr<CombinedAvatarProvider> testling(createProvider());
avatarProvider1->avatars[user1] = avatarHash1;
avatarProvider2->avatars[user1] = avatarHash2;
testling->addProvider(avatarProvider1);
@@ -71,7 +71,7 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture {
}
void testGetAvatarWithMultipleAvatarProviderAndFailingFirstProviderReturnsSecondAvatar() {
- std::auto_ptr<CombinedAvatarProvider> testling(createProvider());
+ boost::shared_ptr<CombinedAvatarProvider> testling(createProvider());
avatarProvider2->avatars[user1] = avatarHash2;
testling->addProvider(avatarProvider1);
testling->addProvider(avatarProvider2);
@@ -80,7 +80,7 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture {
}
void testProviderUpdateTriggersChange() {
- std::auto_ptr<CombinedAvatarProvider> testling(createProvider());
+ boost::shared_ptr<CombinedAvatarProvider> testling(createProvider());
testling->addProvider(avatarProvider1);
avatarProvider1->avatars[user1] = avatarHash1;
avatarProvider1->onAvatarChanged(user1);
@@ -90,7 +90,7 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture {
}
void testProviderUpdateWithoutChangeDoesNotTriggerChange() {
- std::auto_ptr<CombinedAvatarProvider> testling(createProvider());
+ boost::shared_ptr<CombinedAvatarProvider> testling(createProvider());
testling->addProvider(avatarProvider1);
testling->addProvider(avatarProvider2);
avatarProvider1->avatars[user1] = avatarHash1;
@@ -104,7 +104,7 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture {
}
void testProviderSecondUpdateTriggersChange() {
- std::auto_ptr<CombinedAvatarProvider> testling(createProvider());
+ boost::shared_ptr<CombinedAvatarProvider> testling(createProvider());
testling->addProvider(avatarProvider1);
avatarProvider1->avatars[user1] = avatarHash1;
avatarProvider1->onAvatarChanged(user1);
@@ -118,7 +118,7 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture {
void testProviderUpdateWithAvatarDisappearingTriggersChange() {
- std::auto_ptr<CombinedAvatarProvider> testling(createProvider());
+ boost::shared_ptr<CombinedAvatarProvider> testling(createProvider());
testling->addProvider(avatarProvider1);
avatarProvider1->avatars[user1] = avatarHash1;
avatarProvider1->onAvatarChanged(user1);
@@ -131,7 +131,7 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture {
}
void testProviderUpdateAfterAvatarDisappearedTriggersChange() {
- std::auto_ptr<CombinedAvatarProvider> testling(createProvider());
+ boost::shared_ptr<CombinedAvatarProvider> testling(createProvider());
testling->addProvider(avatarProvider1);
avatarProvider1->avatars[user1] = avatarHash1;
avatarProvider1->onAvatarChanged(user1);
@@ -147,7 +147,7 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture {
void testProviderUpdateAfterGetDoesNotTriggerChange() {
- std::auto_ptr<CombinedAvatarProvider> testling(createProvider());
+ boost::shared_ptr<CombinedAvatarProvider> testling(createProvider());
testling->addProvider(avatarProvider1);
avatarProvider1->avatars[user1] = avatarHash1;
@@ -158,7 +158,7 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture {
}
void testRemoveProviderDisconnectsUpdates() {
- std::auto_ptr<CombinedAvatarProvider> testling(createProvider());
+ boost::shared_ptr<CombinedAvatarProvider> testling(createProvider());
testling->addProvider(avatarProvider1);
testling->addProvider(avatarProvider2);
testling->removeProvider(avatarProvider1);
@@ -170,7 +170,7 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture {
}
void testProviderUpdateBareJIDAfterGetFullJID() {
- std::auto_ptr<CombinedAvatarProvider> testling(createProvider());
+ boost::shared_ptr<CombinedAvatarProvider> testling(createProvider());
avatarProvider1->useBare = true;
testling->addProvider(avatarProvider1);
@@ -183,8 +183,8 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture {
}
private:
- std::auto_ptr<CombinedAvatarProvider> createProvider() {
- std::auto_ptr<CombinedAvatarProvider> result(new CombinedAvatarProvider());
+ boost::shared_ptr<CombinedAvatarProvider> createProvider() {
+ boost::shared_ptr<CombinedAvatarProvider> result(new CombinedAvatarProvider());
result->onAvatarChanged.connect(boost::bind(&CombinedAvatarProviderTest::handleAvatarChanged, this, _1));
return result;
}
diff --git a/Swiften/Avatars/UnitTest/VCardAvatarManagerTest.cpp b/Swiften/Avatars/UnitTest/VCardAvatarManagerTest.cpp
index 6e7bdca..23b4169 100644
--- a/Swiften/Avatars/UnitTest/VCardAvatarManagerTest.cpp
+++ b/Swiften/Avatars/UnitTest/VCardAvatarManagerTest.cpp
@@ -58,7 +58,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 +68,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 +77,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 +88,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 +96,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 +104,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;
}
diff --git a/Swiften/Avatars/UnitTest/VCardUpdateAvatarManagerTest.cpp b/Swiften/Avatars/UnitTest/VCardUpdateAvatarManagerTest.cpp
index 23c70e5..2a3b3fd 100644
--- a/Swiften/Avatars/UnitTest/VCardUpdateAvatarManagerTest.cpp
+++ b/Swiften/Avatars/UnitTest/VCardUpdateAvatarManagerTest.cpp
@@ -60,7 +60,7 @@ class VCardUpdateAvatarManagerTest : public CppUnit::TestFixture {
}
void testUpdate_NewHashNewVCardRequestsVCard() {
- std::auto_ptr<VCardUpdateAvatarManager> testling = createManager();
+ boost::shared_ptr<VCardUpdateAvatarManager> testling = createManager();
stanzaChannel->onPresenceReceived(createPresenceWithPhotoHash(user1, avatar1Hash));
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(stanzaChannel->sentStanzas.size()));
@@ -68,7 +68,7 @@ class VCardUpdateAvatarManagerTest : public CppUnit::TestFixture {
}
void testUpdate_NewHashStoresAvatarAndEmitsNotificationOnVCardReceive() {
- std::auto_ptr<VCardUpdateAvatarManager> testling = createManager();
+ boost::shared_ptr<VCardUpdateAvatarManager> testling = createManager();
stanzaChannel->onPresenceReceived(createPresenceWithPhotoHash(user1, avatar1Hash));
stanzaChannel->onIQReceived(createVCardResult(avatar1));
@@ -80,7 +80,7 @@ class VCardUpdateAvatarManagerTest : public CppUnit::TestFixture {
}
void testUpdate_KnownHash() {
- std::auto_ptr<VCardUpdateAvatarManager> testling = createManager();
+ boost::shared_ptr<VCardUpdateAvatarManager> testling = createManager();
stanzaChannel->onPresenceReceived(createPresenceWithPhotoHash(user1, avatar1Hash));
stanzaChannel->onIQReceived(createVCardResult(avatar1));
changes.clear();
@@ -93,7 +93,7 @@ class VCardUpdateAvatarManagerTest : public CppUnit::TestFixture {
}
void testUpdate_KnownHashFromDifferentUserDoesNotRequestVCardButTriggersNotification() {
- std::auto_ptr<VCardUpdateAvatarManager> testling = createManager();
+ boost::shared_ptr<VCardUpdateAvatarManager> testling = createManager();
stanzaChannel->onPresenceReceived(createPresenceWithPhotoHash(user1, avatar1Hash));
stanzaChannel->onIQReceived(createVCardResult(avatar1));
changes.clear();
@@ -108,7 +108,7 @@ class VCardUpdateAvatarManagerTest : public CppUnit::TestFixture {
}
void testVCardWithEmptyPhoto() {
- std::auto_ptr<VCardUpdateAvatarManager> testling = createManager();
+ boost::shared_ptr<VCardUpdateAvatarManager> testling = createManager();
vcardManager->requestVCard(JID("foo@bar.com"));
stanzaChannel->onIQReceived(createVCardResult(ByteArray()));
@@ -117,7 +117,7 @@ class VCardUpdateAvatarManagerTest : public CppUnit::TestFixture {
}
void testStanzaChannelReset_ClearsHash() {
- std::auto_ptr<VCardUpdateAvatarManager> testling = createManager();
+ boost::shared_ptr<VCardUpdateAvatarManager> testling = createManager();
stanzaChannel->onPresenceReceived(createPresenceWithPhotoHash(user1, avatar1Hash));
stanzaChannel->onIQReceived(createVCardResult(avatar1));
changes.clear();
@@ -132,7 +132,7 @@ class VCardUpdateAvatarManagerTest : public CppUnit::TestFixture {
}
void testStanzaChannelReset_ReceiveHashAfterResetUpdatesHash() {
- std::auto_ptr<VCardUpdateAvatarManager> testling = createManager();
+ boost::shared_ptr<VCardUpdateAvatarManager> testling = createManager();
stanzaChannel->onPresenceReceived(createPresenceWithPhotoHash(user1, avatar1Hash));
stanzaChannel->onIQReceived(createVCardResult(avatar1));
changes.clear();
@@ -148,8 +148,8 @@ class VCardUpdateAvatarManagerTest : public CppUnit::TestFixture {
}
private:
- std::auto_ptr<VCardUpdateAvatarManager> createManager() {
- std::auto_ptr<VCardUpdateAvatarManager> result(new VCardUpdateAvatarManager(vcardManager, stanzaChannel, avatarStorage, mucRegistry));
+ boost::shared_ptr<VCardUpdateAvatarManager> createManager() {
+ boost::shared_ptr<VCardUpdateAvatarManager> result(new VCardUpdateAvatarManager(vcardManager, stanzaChannel, avatarStorage, mucRegistry));
result->onAvatarChanged.connect(boost::bind(&VCardUpdateAvatarManagerTest::handleAvatarChanged, this, _1));
return result;
}
diff --git a/Swiften/Disco/UnitTest/CapsManagerTest.cpp b/Swiften/Disco/UnitTest/CapsManagerTest.cpp
index c1d6312..6d4be30 100644
--- a/Swiften/Disco/UnitTest/CapsManagerTest.cpp
+++ b/Swiften/Disco/UnitTest/CapsManagerTest.cpp
@@ -63,7 +63,7 @@ class CapsManagerTest : public CppUnit::TestFixture {
}
void testReceiveNewHashRequestsDisco() {
- std::auto_ptr<CapsManager> testling = createManager();
+ boost::shared_ptr<CapsManager> testling = createManager();
sendPresenceWithCaps(user1, capsInfo1);
CPPUNIT_ASSERT(stanzaChannel->isRequestAtIndex<DiscoInfo>(0, user1, IQ::Get));
@@ -73,7 +73,7 @@ class CapsManagerTest : public CppUnit::TestFixture {
}
void testReceiveSameHashDoesNotRequestDisco() {
- std::auto_ptr<CapsManager> testling = createManager();
+ boost::shared_ptr<CapsManager> testling = createManager();
sendPresenceWithCaps(user1, capsInfo1);
stanzaChannel->sentStanzas.clear();
sendPresenceWithCaps(user1, capsInfo1);
@@ -82,14 +82,14 @@ class CapsManagerTest : public CppUnit::TestFixture {
}
void testReceiveLegacyCapsDoesNotRequestDisco() {
- std::auto_ptr<CapsManager> testling = createManager();
+ boost::shared_ptr<CapsManager> testling = createManager();
sendPresenceWithCaps(user1, legacyCapsInfo);
CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(stanzaChannel->sentStanzas.size()));
}
void testReceiveSameHashAfterSuccesfulDiscoDoesNotRequestDisco() {
- std::auto_ptr<CapsManager> testling = createManager();
+ boost::shared_ptr<CapsManager> testling = createManager();
sendPresenceWithCaps(user1, capsInfo1);
sendDiscoInfoResult(discoInfo1);
@@ -100,7 +100,7 @@ class CapsManagerTest : public CppUnit::TestFixture {
}
void testReceiveSameHashFromSameUserAfterFailedDiscoDoesNotRequestDisco() {
- std::auto_ptr<CapsManager> testling = createManager();
+ boost::shared_ptr<CapsManager> testling = createManager();
sendPresenceWithCaps(user1, capsInfo1);
stanzaChannel->onIQReceived(IQ::createError(JID("baz@fum.com/foo"), stanzaChannel->sentStanzas[0]->getID()));
@@ -111,7 +111,7 @@ class CapsManagerTest : public CppUnit::TestFixture {
}
void testReceiveSameHashFromSameUserAfterIncorrectVerificationDoesNotRequestDisco() {
- std::auto_ptr<CapsManager> testling = createManager();
+ boost::shared_ptr<CapsManager> testling = createManager();
sendPresenceWithCaps(user1, capsInfo1);
sendDiscoInfoResult(discoInfo2);
@@ -122,7 +122,7 @@ class CapsManagerTest : public CppUnit::TestFixture {
}
void testReceiveSameHashFromDifferentUserAfterFailedDiscoRequestsDisco() {
- std::auto_ptr<CapsManager> testling = createManager();
+ boost::shared_ptr<CapsManager> testling = createManager();
sendPresenceWithCaps(user1, capsInfo1);
stanzaChannel->onIQReceived(IQ::createError(JID("baz@fum.com/foo"), stanzaChannel->sentStanzas[0]->getID()));
@@ -132,7 +132,7 @@ class CapsManagerTest : public CppUnit::TestFixture {
}
void testReceiveSameHashFromDifferentUserAfterIncorrectVerificationRequestsDisco() {
- std::auto_ptr<CapsManager> testling = createManager();
+ boost::shared_ptr<CapsManager> testling = createManager();
sendPresenceWithCaps(user1, capsInfo1);
sendDiscoInfoResult(discoInfo2);
@@ -142,7 +142,7 @@ class CapsManagerTest : public CppUnit::TestFixture {
}
void testReceiveDifferentHashFromSameUserAfterFailedDiscoDoesNotRequestDisco() {
- std::auto_ptr<CapsManager> testling = createManager();
+ boost::shared_ptr<CapsManager> testling = createManager();
sendPresenceWithCaps(user1, capsInfo1);
stanzaChannel->onIQReceived(IQ::createError(JID("baz@fum.com/foo"), stanzaChannel->sentStanzas[0]->getID()));
@@ -153,7 +153,7 @@ class CapsManagerTest : public CppUnit::TestFixture {
}
void testReceiveSuccesfulDiscoStoresCaps() {
- std::auto_ptr<CapsManager> testling = createManager();
+ boost::shared_ptr<CapsManager> testling = createManager();
sendPresenceWithCaps(user1, capsInfo1);
sendDiscoInfoResult(discoInfo1);
@@ -163,7 +163,7 @@ class CapsManagerTest : public CppUnit::TestFixture {
}
void testReceiveIncorrectVerificationDiscoDoesNotStoreCaps() {
- std::auto_ptr<CapsManager> testling = createManager();
+ boost::shared_ptr<CapsManager> testling = createManager();
sendPresenceWithCaps(user1, capsInfo1);
sendDiscoInfoResult(discoInfo2);
@@ -172,7 +172,7 @@ class CapsManagerTest : public CppUnit::TestFixture {
}
void testReceiveFailingDiscoFallsBack() {
- std::auto_ptr<CapsManager> testling = createManager();
+ boost::shared_ptr<CapsManager> testling = createManager();
sendPresenceWithCaps(user1, capsInfo1);
sendPresenceWithCaps(user2, capsInfo1alt);
stanzaChannel->onIQReceived(IQ::createError(JID("baz@fum.com/foo"), stanzaChannel->sentStanzas[0]->getID()));
@@ -184,7 +184,7 @@ class CapsManagerTest : public CppUnit::TestFixture {
}
void testReceiveFailingFallbackDiscoFallsBack() {
- std::auto_ptr<CapsManager> testling = createManager();
+ boost::shared_ptr<CapsManager> testling = createManager();
sendPresenceWithCaps(user1, capsInfo1);
sendPresenceWithCaps(user2, capsInfo1alt);
sendPresenceWithCaps(user3, capsInfo1);
@@ -195,7 +195,7 @@ class CapsManagerTest : public CppUnit::TestFixture {
}
void testReceiveSameHashFromFailingUserAfterReconnectRequestsDisco() {
- std::auto_ptr<CapsManager> testling = createManager();
+ boost::shared_ptr<CapsManager> testling = createManager();
sendPresenceWithCaps(user1, capsInfo1);
stanzaChannel->onIQReceived(IQ::createError(JID("baz@fum.com/foo"), stanzaChannel->sentStanzas[0]->getID()));
stanzaChannel->setAvailable(false);
@@ -208,7 +208,7 @@ class CapsManagerTest : public CppUnit::TestFixture {
}
void testReconnectResetsFallback() {
- std::auto_ptr<CapsManager> testling = createManager();
+ boost::shared_ptr<CapsManager> testling = createManager();
sendPresenceWithCaps(user1, capsInfo1);
sendPresenceWithCaps(user2, capsInfo1alt);
stanzaChannel->setAvailable(false);
@@ -221,7 +221,7 @@ class CapsManagerTest : public CppUnit::TestFixture {
}
void testReconnectResetsRequests() {
- std::auto_ptr<CapsManager> testling = createManager();
+ boost::shared_ptr<CapsManager> testling = createManager();
sendPresenceWithCaps(user1, capsInfo1);
stanzaChannel->sentStanzas.clear();
stanzaChannel->setAvailable(false);
@@ -232,8 +232,8 @@ class CapsManagerTest : public CppUnit::TestFixture {
}
private:
- std::auto_ptr<CapsManager> createManager() {
- std::auto_ptr<CapsManager> manager(new CapsManager(storage, stanzaChannel, iqRouter));
+ boost::shared_ptr<CapsManager> createManager() {
+ boost::shared_ptr<CapsManager> manager(new CapsManager(storage, stanzaChannel, iqRouter));
manager->setWarnOnInvalidHash(false);
//manager->onCapsChanged.connect(boost::bind(&CapsManagerTest::handleCapsChanged, this, _1));
return manager;
diff --git a/Swiften/Disco/UnitTest/EntityCapsManagerTest.cpp b/Swiften/Disco/UnitTest/EntityCapsManagerTest.cpp
index 6c99a2e..7b61cb5 100644
--- a/Swiften/Disco/UnitTest/EntityCapsManagerTest.cpp
+++ b/Swiften/Disco/UnitTest/EntityCapsManagerTest.cpp
@@ -52,7 +52,7 @@ class EntityCapsManagerTest : public CppUnit::TestFixture {
}
void testReceiveKnownHash() {
- std::auto_ptr<EntityCapsManager> testling = createManager();
+ boost::shared_ptr<EntityCapsManager> testling = createManager();
capsProvider->caps[capsInfo1->getVersion()] = discoInfo1;
sendPresenceWithCaps(user1, capsInfo1);
@@ -62,7 +62,7 @@ class EntityCapsManagerTest : public CppUnit::TestFixture {
}
void testReceiveKnownHashTwiceDoesNotTriggerChange() {
- std::auto_ptr<EntityCapsManager> testling = createManager();
+ boost::shared_ptr<EntityCapsManager> testling = createManager();
capsProvider->caps[capsInfo1->getVersion()] = discoInfo1;
sendPresenceWithCaps(user1, capsInfo1);
changes.clear();
@@ -73,14 +73,14 @@ class EntityCapsManagerTest : public CppUnit::TestFixture {
}
void testReceiveUnknownHashDoesNotTriggerChange() {
- std::auto_ptr<EntityCapsManager> testling = createManager();
+ boost::shared_ptr<EntityCapsManager> testling = createManager();
sendPresenceWithCaps(user1, capsInfo1);
CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(changes.size()));
}
void testHashAvailable() {
- std::auto_ptr<EntityCapsManager> testling = createManager();
+ boost::shared_ptr<EntityCapsManager> testling = createManager();
sendPresenceWithCaps(user1, capsInfo1);
capsProvider->caps[capsInfo1->getVersion()] = discoInfo1;
@@ -92,7 +92,7 @@ class EntityCapsManagerTest : public CppUnit::TestFixture {
}
void testReceiveUnknownHashAfterKnownHashTriggersChangeAndClearsCaps() {
- std::auto_ptr<EntityCapsManager> testling = createManager();
+ boost::shared_ptr<EntityCapsManager> testling = createManager();
capsProvider->caps[capsInfo1->getVersion()] = discoInfo1;
sendPresenceWithCaps(user1, capsInfo1);
changes.clear();
@@ -104,7 +104,7 @@ class EntityCapsManagerTest : public CppUnit::TestFixture {
}
void testReceiveUnavailablePresenceAfterKnownHashTriggersChangeAndClearsCaps() {
- std::auto_ptr<EntityCapsManager> testling = createManager();
+ boost::shared_ptr<EntityCapsManager> testling = createManager();
capsProvider->caps[capsInfo1->getVersion()] = discoInfo1;
sendPresenceWithCaps(user1, capsInfo1);
changes.clear();
@@ -116,7 +116,7 @@ class EntityCapsManagerTest : public CppUnit::TestFixture {
}
void testReconnectTriggersChangeAndClearsCaps() {
- std::auto_ptr<EntityCapsManager> testling = createManager();
+ boost::shared_ptr<EntityCapsManager> testling = createManager();
capsProvider->caps[capsInfo1->getVersion()] = discoInfo1;
capsProvider->caps[capsInfo2->getVersion()] = discoInfo2;
sendPresenceWithCaps(user1, capsInfo1);
@@ -133,8 +133,8 @@ class EntityCapsManagerTest : public CppUnit::TestFixture {
}
private:
- std::auto_ptr<EntityCapsManager> createManager() {
- std::auto_ptr<EntityCapsManager> manager(new EntityCapsManager(capsProvider, stanzaChannel));
+ boost::shared_ptr<EntityCapsManager> createManager() {
+ boost::shared_ptr<EntityCapsManager> manager(new EntityCapsManager(capsProvider, stanzaChannel));
manager->onCapsChanged.connect(boost::bind(&EntityCapsManagerTest::handleCapsChanged, this, _1));
return manager;
}
diff --git a/Swiften/Entity/PayloadPersister.cpp b/Swiften/Entity/PayloadPersister.cpp
index f7278cc..ac5a578 100644
--- a/Swiften/Entity/PayloadPersister.cpp
+++ b/Swiften/Entity/PayloadPersister.cpp
@@ -42,7 +42,7 @@ boost::shared_ptr<Payload> PayloadPersister::loadPayload(const boost::filesystem
if (boost::filesystem::exists(path)) {
ByteArray data;
data.readFromFile(path.string());
- std::auto_ptr<PayloadParser> parser(createParser());
+ boost::shared_ptr<PayloadParser> parser(createParser());
PayloadParserTester tester(parser.get());
tester.parse(data.toString());
return parser->getPayload();
diff --git a/Swiften/FileTransfer/UnitTest/IBBReceiveSessionTest.cpp b/Swiften/FileTransfer/UnitTest/IBBReceiveSessionTest.cpp
index 01f1355..e022a5d 100644
--- a/Swiften/FileTransfer/UnitTest/IBBReceiveSessionTest.cpp
+++ b/Swiften/FileTransfer/UnitTest/IBBReceiveSessionTest.cpp
@@ -43,7 +43,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture {
}
void testOpen() {
- std::auto_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
+ boost::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
testling->start();
stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open"));
@@ -54,7 +54,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture {
}
void testReceiveData() {
- std::auto_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
+ boost::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
testling->start();
stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open"));
@@ -68,7 +68,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture {
}
void testReceiveMultipleData() {
- std::auto_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
+ boost::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
testling->start();
stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open"));
@@ -83,7 +83,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture {
}
void testReceiveDataForOtherSession() {
- std::auto_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
+ boost::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
testling->start();
stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open"));
@@ -95,7 +95,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture {
}
void testReceiveDataOutOfOrder() {
- std::auto_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
+ boost::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
testling->start();
stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open"));
@@ -110,7 +110,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture {
}
void testReceiveLastData() {
- std::auto_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession", 6));
+ boost::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession", 6));
testling->start();
stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open"));
@@ -126,7 +126,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture {
}
void testReceiveClose() {
- std::auto_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
+ boost::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
testling->start();
stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open"));
@@ -139,7 +139,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture {
}
void testStopWhileActive() {
- std::auto_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
+ boost::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
testling->start();
stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open"));
diff --git a/Swiften/FileTransfer/UnitTest/IBBSendSessionTest.cpp b/Swiften/FileTransfer/UnitTest/IBBSendSessionTest.cpp
index 5c23887..f84c3bb 100644
--- a/Swiften/FileTransfer/UnitTest/IBBSendSessionTest.cpp
+++ b/Swiften/FileTransfer/UnitTest/IBBSendSessionTest.cpp
@@ -41,7 +41,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
}
void testStart() {
- std::auto_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
+ boost::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
testling->setBlockSize(1234);
testling->start();
@@ -55,7 +55,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
}
void testStart_ResponseStartsSending() {
- std::auto_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
+ boost::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
testling->setBlockSize(3);
testling->start();
@@ -71,7 +71,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
}
void testResponseContinuesSending() {
- std::auto_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
+ boost::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
testling->setBlockSize(3);
testling->start();
stanzaChannel->onIQReceived(createIBBResult());
@@ -87,7 +87,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
}
void testRespondToAllFinishes() {
- std::auto_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
+ boost::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
testling->setBlockSize(3);
testling->start();
stanzaChannel->onIQReceived(createIBBResult());
@@ -100,7 +100,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
}
void testErrorResponseFinishesWithError() {
- std::auto_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
+ boost::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
testling->setBlockSize(3);
testling->start();
stanzaChannel->onIQReceived(IQ::createError(JID("baz@fum.com/foo"), stanzaChannel->sentStanzas[0]->getID()));
@@ -110,7 +110,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
}
void testStopDuringSessionCloses() {
- std::auto_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
+ boost::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
testling->setBlockSize(3);
testling->start();
testling->stop();
@@ -125,7 +125,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
}
void testStopAfterFinishedDoesNotClose() {
- std::auto_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
+ boost::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
testling->setBlockSize(16);
testling->start();
stanzaChannel->onIQReceived(createIBBResult());
@@ -143,8 +143,8 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
}
private:
- std::auto_ptr<IBBSendSession> createSession(const std::string& to) {
- std::auto_ptr<IBBSendSession> session(new IBBSendSession("myid", JID(to), bytestream, iqRouter));
+ boost::shared_ptr<IBBSendSession> createSession(const std::string& to) {
+ boost::shared_ptr<IBBSendSession> session(new IBBSendSession("myid", JID(to), bytestream, iqRouter));
session->onFinished.connect(boost::bind(&IBBSendSessionTest::handleFinished, this, _1));
return session;
}
diff --git a/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamServerSessionTest.cpp b/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamServerSessionTest.cpp
index 9f3088c..d1f7000 100644
--- a/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamServerSessionTest.cpp
+++ b/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamServerSessionTest.cpp
@@ -44,7 +44,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
}
void testAuthenticate() {
- std::auto_ptr<SOCKS5BytestreamServerSession> testling(createSession());
+ boost::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
StartStopper<SOCKS5BytestreamServerSession> stopper(testling.get());
receive(ByteArray::create("\x05\x02\x01\x02"));
@@ -53,7 +53,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
}
void testAuthenticate_Chunked() {
- std::auto_ptr<SOCKS5BytestreamServerSession> testling(createSession());
+ boost::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
StartStopper<SOCKS5BytestreamServerSession> stopper(testling.get());
receive(ByteArray::create("\x05\x02\x01"));
@@ -64,7 +64,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
}
void testRequest() {
- std::auto_ptr<SOCKS5BytestreamServerSession> testling(createSession());
+ boost::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
StartStopper<SOCKS5BytestreamServerSession> stopper(testling.get());
bytestreams.addBytestream("abcdef", stream1);
authenticate();
@@ -75,7 +75,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
}
void testRequest_UnknownBytestream() {
- std::auto_ptr<SOCKS5BytestreamServerSession> testling(createSession());
+ boost::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
StartStopper<SOCKS5BytestreamServerSession> stopper(testling.get());
authenticate();
@@ -85,7 +85,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
}
void testReceiveData() {
- std::auto_ptr<SOCKS5BytestreamServerSession> testling(createSession());
+ boost::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
StartStopper<SOCKS5BytestreamServerSession> stopper(testling.get());
bytestreams.addBytestream("abcdef", stream1);
authenticate();
@@ -98,7 +98,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
}
void testReceiveData_Chunked() {
- std::auto_ptr<SOCKS5BytestreamServerSession> testling(createSession());
+ boost::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
testling->setChunkSize(3);
StartStopper<SOCKS5BytestreamServerSession> stopper(testling.get());
bytestreams.addBytestream("abcdef", stream1);
diff --git a/Swiften/History/UnitTest/SQLiteHistoryManagerTest.cpp b/Swiften/History/UnitTest/SQLiteHistoryManagerTest.cpp
index fe3fd7e..4123008 100644
--- a/Swiften/History/UnitTest/SQLiteHistoryManagerTest.cpp
+++ b/Swiften/History/UnitTest/SQLiteHistoryManagerTest.cpp
@@ -34,7 +34,7 @@ class SQLiteHistoryManagerTest : public CppUnit::TestFixture {
}
void testAddMessage() {
- std::auto_ptr<SQLiteHistoryManager> testling(createHistoryManager());
+ boost::shared_ptr<SQLiteHistoryManager> testling(createHistoryManager());
HistoryMessage testMessage("Test", JID("foo@bar.com"), JID("fum@baz.org"), boost::posix_time::time_from_string("1980-01-21 22:03"));
testling->addMessage(testMessage);
@@ -44,7 +44,7 @@ class SQLiteHistoryManagerTest : public CppUnit::TestFixture {
}
void testAddMessage_TwoMessages() {
- std::auto_ptr<SQLiteHistoryManager> testling(createHistoryManager());
+ boost::shared_ptr<SQLiteHistoryManager> testling(createHistoryManager());
HistoryMessage testMessage1("Test1", JID("foo@bar.com"), JID("fum@baz.org"), boost::posix_time::time_from_string("1980-01-21 22:03"));
testling->addMessage(testMessage1);
HistoryMessage testMessage2("Test2", JID("fum@baz.org"), JID("foo@bar.com"), boost::posix_time::time_from_string("1975-03-09 22:04"));
@@ -57,7 +57,7 @@ class SQLiteHistoryManagerTest : public CppUnit::TestFixture {
}
void testGetIDForJID_SameJID() {
- std::auto_ptr<SQLiteHistoryManager> testling(createHistoryManager());
+ boost::shared_ptr<SQLiteHistoryManager> testling(createHistoryManager());
int id1 = testling->getIDForJID(JID("foo@bar.com"));
int id2 = testling->getIDForJID(JID("foo@bar.com"));
@@ -65,7 +65,7 @@ class SQLiteHistoryManagerTest : public CppUnit::TestFixture {
}
void testGetIDForJID_DifferentJIDs() {
- std::auto_ptr<SQLiteHistoryManager> testling(createHistoryManager());
+ boost::shared_ptr<SQLiteHistoryManager> testling(createHistoryManager());
int id1 = testling->getIDForJID(JID("foo@bar.com"));
int id2 = testling->getIDForJID(JID("foo@baz.com"));
@@ -73,7 +73,7 @@ class SQLiteHistoryManagerTest : public CppUnit::TestFixture {
}
void getJIDFromID() {
- std::auto_ptr<SQLiteHistoryManager> testling(createHistoryManager());
+ boost::shared_ptr<SQLiteHistoryManager> testling(createHistoryManager());
int id = testling->addJID(JID("foo@bar.com"));
boost::optional<JID> result(testling->getJIDFromID(id));
@@ -82,7 +82,7 @@ class SQLiteHistoryManagerTest : public CppUnit::TestFixture {
}
void getJIDFromID_UnexistingID() {
- std::auto_ptr<SQLiteHistoryManager> testling(createHistoryManager());
+ boost::shared_ptr<SQLiteHistoryManager> testling(createHistoryManager());
boost::optional<JID> result(testling->getJIDFromID(1));
@@ -90,7 +90,7 @@ class SQLiteHistoryManagerTest : public CppUnit::TestFixture {
}
void getIDFromJID() {
- std::auto_ptr<SQLiteHistoryManager> testling(createHistoryManager());
+ boost::shared_ptr<SQLiteHistoryManager> testling(createHistoryManager());
int id = testling->addJID(JID("foo@bar.com"));
boost::optional<int> result(testling->getIDFromJID(JID("foo@bar.com")));
@@ -99,7 +99,7 @@ class SQLiteHistoryManagerTest : public CppUnit::TestFixture {
}
void getIDFromJID_UnexistingJID() {
- std::auto_ptr<SQLiteHistoryManager> testling(createHistoryManager());
+ boost::shared_ptr<SQLiteHistoryManager> testling(createHistoryManager());
boost::optional<int> result(testling->getIDFromJID(JID("foo@bar.com")));
diff --git a/Swiften/Parser/PayloadParsers/PrivateStorageParser.h b/Swiften/Parser/PayloadParsers/PrivateStorageParser.h
index 2f9e003..d350593 100644
--- a/Swiften/Parser/PayloadParsers/PrivateStorageParser.h
+++ b/Swiften/Parser/PayloadParsers/PrivateStorageParser.h
@@ -26,6 +26,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* factories;
int level;
- std::auto_ptr<PayloadParser> currentPayloadParser;
+ boost::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h b/Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h
index 2825857..213cd06 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h
+++ b/Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h
@@ -62,7 +62,7 @@ namespace Swift {
private:
XMLParser* xmlParser;
FullPayloadParserFactoryCollection factories;
- std::auto_ptr<PayloadParser> payloadParser;
+ boost::shared_ptr<PayloadParser> payloadParser;
int level;
};
}
diff --git a/Swiften/Parser/StanzaParser.h b/Swiften/Parser/StanzaParser.h
index a35215e..6887981 100644
--- a/Swiften/Parser/StanzaParser.h
+++ b/Swiften/Parser/StanzaParser.h
@@ -4,10 +4,10 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#ifndef SWIFTEN_StanzaParser_H
-#define SWIFTEN_StanzaParser_H
+#pragma once
#include <boost/noncopyable.hpp>
+#include <boost/shared_ptr.hpp>
#include <string>
#include <Swiften/Elements/Stanza.h>
@@ -47,8 +47,6 @@ namespace Swift {
private:
int currentDepth_;
PayloadParserFactoryCollection* factories_;
- std::auto_ptr<PayloadParser> currentPayloadParser_;
+ boost::shared_ptr<PayloadParser> currentPayloadParser_;
};
}
-
-#endif
diff --git a/Swiften/Presence/UnitTest/DirectedPresenceSenderTest.cpp b/Swiften/Presence/UnitTest/DirectedPresenceSenderTest.cpp
index a6910a1..5b385c2 100644
--- a/Swiften/Presence/UnitTest/DirectedPresenceSenderTest.cpp
+++ b/Swiften/Presence/UnitTest/DirectedPresenceSenderTest.cpp
@@ -41,7 +41,7 @@ class DirectedPresenceSenderTest : public CppUnit::TestFixture {
}
void testSendPresence() {
- std::auto_ptr<DirectedPresenceSender> testling(createPresenceSender());
+ boost::shared_ptr<DirectedPresenceSender> testling(createPresenceSender());
testling->sendPresence(testPresence);
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(channel->sentStanzas.size()));
@@ -50,7 +50,7 @@ class DirectedPresenceSenderTest : public CppUnit::TestFixture {
}
void testSendPresence_UndirectedPresenceWithDirectedPresenceReceivers() {
- std::auto_ptr<DirectedPresenceSender> testling(createPresenceSender());
+ boost::shared_ptr<DirectedPresenceSender> testling(createPresenceSender());
testling->addDirectedPresenceReceiver(JID("alice@wonderland.lit/teaparty"), DirectedPresenceSender::AndSendPresence);
testling->sendPresence(testPresence);
@@ -64,7 +64,7 @@ class DirectedPresenceSenderTest : public CppUnit::TestFixture {
}
void testSendPresence_DirectedPresenceWithDirectedPresenceReceivers() {
- std::auto_ptr<DirectedPresenceSender> testling(createPresenceSender());
+ boost::shared_ptr<DirectedPresenceSender> testling(createPresenceSender());
testling->addDirectedPresenceReceiver(JID("alice@wonderland.lit/teaparty"), DirectedPresenceSender::AndSendPresence);
channel->sentStanzas.clear();
@@ -77,7 +77,7 @@ class DirectedPresenceSenderTest : public CppUnit::TestFixture {
}
void testAddDirectedPresenceReceiver() {
- std::auto_ptr<DirectedPresenceSender> testling(createPresenceSender());
+ boost::shared_ptr<DirectedPresenceSender> testling(createPresenceSender());
testling->sendPresence(testPresence);
channel->sentStanzas.clear();
@@ -90,7 +90,7 @@ class DirectedPresenceSenderTest : public CppUnit::TestFixture {
}
void testAddDirectedPresenceReceiver_WithoutSendingPresence() {
- std::auto_ptr<DirectedPresenceSender> testling(createPresenceSender());
+ boost::shared_ptr<DirectedPresenceSender> testling(createPresenceSender());
testling->sendPresence(testPresence);
channel->sentStanzas.clear();
@@ -100,7 +100,7 @@ class DirectedPresenceSenderTest : public CppUnit::TestFixture {
}
void testAddDirectedPresenceReceiver_AfterSendingDirectedPresence() {
- std::auto_ptr<DirectedPresenceSender> testling(createPresenceSender());
+ boost::shared_ptr<DirectedPresenceSender> testling(createPresenceSender());
testling->sendPresence(testPresence);
secondTestPresence->setTo(JID("foo@bar.com"));
testling->sendPresence(secondTestPresence);
@@ -115,7 +115,7 @@ class DirectedPresenceSenderTest : public CppUnit::TestFixture {
}
void testRemoveDirectedPresenceReceiver() {
- std::auto_ptr<DirectedPresenceSender> testling(createPresenceSender());
+ boost::shared_ptr<DirectedPresenceSender> testling(createPresenceSender());
testling->addDirectedPresenceReceiver(JID("alice@wonderland.lit/teaparty"), DirectedPresenceSender::DontSendPresence);
testling->removeDirectedPresenceReceiver(JID("alice@wonderland.lit/teaparty"), DirectedPresenceSender::AndSendPresence);
@@ -127,7 +127,7 @@ class DirectedPresenceSenderTest : public CppUnit::TestFixture {
}
void testRemoveDirectedPresenceReceiver_WithoutSendingPresence() {
- std::auto_ptr<DirectedPresenceSender> testling(createPresenceSender());
+ boost::shared_ptr<DirectedPresenceSender> testling(createPresenceSender());
testling->addDirectedPresenceReceiver(JID("alice@wonderland.lit/teaparty"), DirectedPresenceSender::AndSendPresence);
channel->sentStanzas.clear();
diff --git a/Swiften/Presence/UnitTest/PayloadAddingPresenceSenderTest.cpp b/Swiften/Presence/UnitTest/PayloadAddingPresenceSenderTest.cpp
index bfdc8c4..0dd6f74 100644
--- a/Swiften/Presence/UnitTest/PayloadAddingPresenceSenderTest.cpp
+++ b/Swiften/Presence/UnitTest/PayloadAddingPresenceSenderTest.cpp
@@ -38,7 +38,7 @@ class PayloadAddingPresenceSenderTest : public CppUnit::TestFixture {
}
void testSetPayloadAddsPayloadOnPresenceSend() {
- std::auto_ptr<PayloadAddingPresenceSender> testling(createSender());
+ boost::shared_ptr<PayloadAddingPresenceSender> testling(createSender());
testling->setPayload(MyPayload::create("foo"));
testling->sendPresence(Presence::create("bar"));
@@ -49,7 +49,7 @@ class PayloadAddingPresenceSenderTest : public CppUnit::TestFixture {
}
void testSetNullPayloadDoesNotAddPayloadOnPresenceSend() {
- std::auto_ptr<PayloadAddingPresenceSender> testling(createSender());
+ boost::shared_ptr<PayloadAddingPresenceSender> testling(createSender());
testling->setPayload(MyPayload::ref());
testling->sendPresence(Presence::create("bar"));
@@ -60,7 +60,7 @@ class PayloadAddingPresenceSenderTest : public CppUnit::TestFixture {
}
void testSendPresenceDoesNotAlterOriginalPayload() {
- std::auto_ptr<PayloadAddingPresenceSender> testling(createSender());
+ boost::shared_ptr<PayloadAddingPresenceSender> testling(createSender());
testling->setPayload(MyPayload::create("foo"));
Presence::ref presence(Presence::create("bar"));
@@ -70,7 +70,7 @@ class PayloadAddingPresenceSenderTest : public CppUnit::TestFixture {
}
void testSetPayloadAfterInitialPresenceResendsPresence() {
- std::auto_ptr<PayloadAddingPresenceSender> testling(createSender());
+ boost::shared_ptr<PayloadAddingPresenceSender> testling(createSender());
testling->sendPresence(Presence::create("bar"));
testling->setPayload(MyPayload::create("foo"));
@@ -81,7 +81,7 @@ class PayloadAddingPresenceSenderTest : public CppUnit::TestFixture {
}
void testSetPayloadAfterUnavailablePresenceDoesNotResendPresence() {
- std::auto_ptr<PayloadAddingPresenceSender> testling(createSender());
+ boost::shared_ptr<PayloadAddingPresenceSender> testling(createSender());
Presence::ref presence = Presence::create("bar");
presence->setType(Presence::Unavailable);
@@ -93,7 +93,7 @@ class PayloadAddingPresenceSenderTest : public CppUnit::TestFixture {
}
void testSendDirectedPresenceIsNotResent() {
- std::auto_ptr<PayloadAddingPresenceSender> testling(createSender());
+ boost::shared_ptr<PayloadAddingPresenceSender> testling(createSender());
testling->sendPresence(Presence::create("bar"));
Presence::ref directedPresence = Presence::create("baz");
@@ -106,8 +106,8 @@ class PayloadAddingPresenceSenderTest : public CppUnit::TestFixture {
}
private:
- std::auto_ptr<PayloadAddingPresenceSender> createSender() {
- std::auto_ptr<PayloadAddingPresenceSender> sender(new PayloadAddingPresenceSender(presenceSender));
+ boost::shared_ptr<PayloadAddingPresenceSender> createSender() {
+ boost::shared_ptr<PayloadAddingPresenceSender> sender(new PayloadAddingPresenceSender(presenceSender));
return sender;
}
diff --git a/Swiften/QA/StorageTest/FileReadBytestreamTest.cpp b/Swiften/QA/StorageTest/FileReadBytestreamTest.cpp
index 10a8d0d..e090c6c 100644
--- a/Swiften/QA/StorageTest/FileReadBytestreamTest.cpp
+++ b/Swiften/QA/StorageTest/FileReadBytestreamTest.cpp
@@ -31,7 +31,7 @@ class FileReadBytestreamTest : public CppUnit::TestFixture {
}
void testRead() {
- std::auto_ptr<FileReadBytestream> testling(createTestling());
+ boost::shared_ptr<FileReadBytestream> testling(createTestling());
std::vector<unsigned char> result = testling->read(10);
@@ -39,7 +39,7 @@ class FileReadBytestreamTest : public CppUnit::TestFixture {
}
void testRead_Twice() {
- std::auto_ptr<FileReadBytestream> testling(createTestling());
+ boost::shared_ptr<FileReadBytestream> testling(createTestling());
testling->read(10);
ByteArray result(testling->read(10));
@@ -48,7 +48,7 @@ class FileReadBytestreamTest : public CppUnit::TestFixture {
}
void testIsFinished_NotFinished() {
- std::auto_ptr<FileReadBytestream> testling(createTestling());
+ boost::shared_ptr<FileReadBytestream> testling(createTestling());
testling->read(10);
@@ -56,7 +56,7 @@ class FileReadBytestreamTest : public CppUnit::TestFixture {
}
void testIsFinished_IsFinished() {
- std::auto_ptr<FileReadBytestream> testling(createTestling());
+ boost::shared_ptr<FileReadBytestream> testling(createTestling());
testling->read(4096);
diff --git a/Swiften/QA/StorageTest/VCardFileStorageTest.cpp b/Swiften/QA/StorageTest/VCardFileStorageTest.cpp
index 0a3c6d2..45a04ba 100644
--- a/Swiften/QA/StorageTest/VCardFileStorageTest.cpp
+++ b/Swiften/QA/StorageTest/VCardFileStorageTest.cpp
@@ -35,7 +35,7 @@ class VCardFileStorageTest : public CppUnit::TestFixture {
}
void testSetVCard() {
- std::auto_ptr<VCardFileStorage> testling(createTestling());
+ boost::shared_ptr<VCardFileStorage> testling(createTestling());
VCard::ref vcard(new VCard());
vcard->setFullName("Alice In Wonderland");
@@ -49,7 +49,7 @@ class VCardFileStorageTest : public CppUnit::TestFixture {
}
void testGetVCard() {
- std::auto_ptr<VCardFileStorage> testling(createTestling());
+ boost::shared_ptr<VCardFileStorage> testling(createTestling());
VCard::ref vcard(new VCard());
vcard->setFullName("Alice In Wonderland");
testling->setVCard(JID("alice@wonderland.lit"), vcard);
@@ -59,7 +59,7 @@ class VCardFileStorageTest : public CppUnit::TestFixture {
}
void testGetVCard_FileDoesNotExist() {
- std::auto_ptr<VCardFileStorage> testling(createTestling());
+ boost::shared_ptr<VCardFileStorage> testling(createTestling());
VCard::ref result = testling->getVCard(JID("alice@wonderland.lit"));
CPPUNIT_ASSERT(!result);
}
diff --git a/Swiften/Roster/UnitTest/XMPPRosterControllerTest.cpp b/Swiften/Roster/UnitTest/XMPPRosterControllerTest.cpp
index e0f2859..cb9f46f 100644
--- a/Swiften/Roster/UnitTest/XMPPRosterControllerTest.cpp
+++ b/Swiften/Roster/UnitTest/XMPPRosterControllerTest.cpp
@@ -58,7 +58,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture {
}
void testGet_Response() {
- std::auto_ptr<XMPPRosterController> testling(createController());
+ boost::shared_ptr<XMPPRosterController> testling(createController());
testling->requestRoster();
boost::shared_ptr<RosterPayload> payload = boost::make_shared<RosterPayload>();
@@ -94,7 +94,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture {
}
void testGet_NoRosterInStorage() {
- std::auto_ptr<XMPPRosterController> testling(createController());
+ boost::shared_ptr<XMPPRosterController> testling(createController());
testling->setUseVersioning(true);
testling->requestRoster();
@@ -105,7 +105,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture {
}
void testGet_NoVersionInStorage() {
- std::auto_ptr<XMPPRosterController> testling(createController());
+ boost::shared_ptr<XMPPRosterController> testling(createController());
testling->setUseVersioning(true);
rosterStorage_->setRoster(boost::make_shared<RosterPayload>());
@@ -117,7 +117,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture {
}
void testGet_VersionInStorage() {
- std::auto_ptr<XMPPRosterController> testling(createController());
+ boost::shared_ptr<XMPPRosterController> testling(createController());
testling->setUseVersioning(true);
boost::shared_ptr<RosterPayload> payload(new RosterPayload());
payload->setVersion("foover");
@@ -131,7 +131,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture {
}
void testGet_ServerDoesNotSupportVersion() {
- std::auto_ptr<XMPPRosterController> testling(createController());
+ boost::shared_ptr<XMPPRosterController> testling(createController());
boost::shared_ptr<RosterPayload> payload(new RosterPayload());
payload->setVersion("foover");
rosterStorage_->setRoster(payload);
@@ -143,7 +143,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture {
}
void testGet_ResponseWithoutNewVersion() {
- std::auto_ptr<XMPPRosterController> testling(createController());
+ boost::shared_ptr<XMPPRosterController> testling(createController());
testling->setUseVersioning(true);
boost::shared_ptr<RosterPayload> storedRoster(new RosterPayload());
storedRoster->setVersion("version10");
@@ -167,7 +167,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture {
}
void testGet_ResponseWithNewVersion() {
- std::auto_ptr<XMPPRosterController> testling(createController());
+ boost::shared_ptr<XMPPRosterController> testling(createController());
testling->setUseVersioning(true);
boost::shared_ptr<RosterPayload> storedRoster(new RosterPayload());
storedRoster->setVersion("version10");
@@ -240,7 +240,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture {
}
void testRemove_RosterStorageUpdated() {
- std::auto_ptr<XMPPRosterController> testling(createController());
+ boost::shared_ptr<XMPPRosterController> testling(createController());
testling->setUseVersioning(true);
boost::shared_ptr<RosterPayload> storedRoster(new RosterPayload());
storedRoster->setVersion("version10");
diff --git a/Swiften/Serializer/UnitTest/XMPPSerializerTest.cpp b/Swiften/Serializer/UnitTest/XMPPSerializerTest.cpp
index 2956875..c0ab841 100644
--- a/Swiften/Serializer/UnitTest/XMPPSerializerTest.cpp
+++ b/Swiften/Serializer/UnitTest/XMPPSerializerTest.cpp
@@ -31,7 +31,7 @@ class XMPPSerializerTest : public CppUnit::TestFixture {
}
void testSerializeHeader_Client() {
- std::auto_ptr<XMPPSerializer> testling(createSerializer(ClientStreamType));
+ boost::shared_ptr<XMPPSerializer> testling(createSerializer(ClientStreamType));
ProtocolHeader protocolHeader;
protocolHeader.setFrom("bla@foo.com");
protocolHeader.setTo("foo.com");
@@ -42,7 +42,7 @@ class XMPPSerializerTest : public CppUnit::TestFixture {
}
void testSerializeHeader_Component() {
- std::auto_ptr<XMPPSerializer> testling(createSerializer(ComponentStreamType));
+ boost::shared_ptr<XMPPSerializer> testling(createSerializer(ComponentStreamType));
ProtocolHeader protocolHeader;
protocolHeader.setFrom("bla@foo.com");
protocolHeader.setTo("foo.com");
@@ -53,7 +53,7 @@ class XMPPSerializerTest : public CppUnit::TestFixture {
}
void testSerializeHeader_Server() {
- std::auto_ptr<XMPPSerializer> testling(createSerializer(ServerStreamType));
+ boost::shared_ptr<XMPPSerializer> testling(createSerializer(ServerStreamType));
ProtocolHeader protocolHeader;
protocolHeader.setFrom("bla@foo.com");
protocolHeader.setTo("foo.com");
diff --git a/Swiften/StreamManagement/UnitTest/StanzaAckRequesterTest.cpp b/Swiften/StreamManagement/UnitTest/StanzaAckRequesterTest.cpp
index 3f75017..baccc41 100644
--- a/Swiften/StreamManagement/UnitTest/StanzaAckRequesterTest.cpp
+++ b/Swiften/StreamManagement/UnitTest/StanzaAckRequesterTest.cpp
@@ -36,28 +36,28 @@ class StanzaAckRequesterTest : public CppUnit::TestFixture {
}
void testHandleStanzaSent_MessageRequestsAck() {
- std::auto_ptr<StanzaAckRequester> testling(createRequester());
+ boost::shared_ptr<StanzaAckRequester> testling(createRequester());
testling->handleStanzaSent(createMessage("m1"));
CPPUNIT_ASSERT_EQUAL(1, acksRequested);
}
void testHandleStanzaSent_IQDoesNotRequestAck() {
- std::auto_ptr<StanzaAckRequester> testling(createRequester());
+ boost::shared_ptr<StanzaAckRequester> testling(createRequester());
testling->handleStanzaSent(createIQ("iq1"));
CPPUNIT_ASSERT_EQUAL(0, acksRequested);
}
void testHandleStanzaSent_PresenceDoesNotRequestAck() {
- std::auto_ptr<StanzaAckRequester> testling(createRequester());
+ boost::shared_ptr<StanzaAckRequester> testling(createRequester());
testling->handleStanzaSent(createPresence("p1"));
CPPUNIT_ASSERT_EQUAL(0, acksRequested);
}
void testHandleAckReceived_AcksStanza() {
- std::auto_ptr<StanzaAckRequester> testling(createRequester());
+ boost::shared_ptr<StanzaAckRequester> testling(createRequester());
testling->handleStanzaSent(createMessage("m1"));
testling->handleAckReceived(1);
@@ -67,7 +67,7 @@ class StanzaAckRequesterTest : public CppUnit::TestFixture {
}
void testHandleAckReceived_AcksMultipleMessages() {
- std::auto_ptr<StanzaAckRequester> testling(createRequester());
+ boost::shared_ptr<StanzaAckRequester> testling(createRequester());
testling->handleStanzaSent(createMessage("m1"));
testling->handleStanzaSent(createMessage("m2"));
@@ -79,7 +79,7 @@ class StanzaAckRequesterTest : public CppUnit::TestFixture {
}
void testHandleAckReceived_AcksMultipleStanzas() {
- std::auto_ptr<StanzaAckRequester> testling(createRequester());
+ boost::shared_ptr<StanzaAckRequester> testling(createRequester());
testling->handleStanzaSent(createIQ("iq1"));
testling->handleStanzaSent(createPresence("p1"));
testling->handleStanzaSent(createMessage("m1"));
@@ -93,7 +93,7 @@ class StanzaAckRequesterTest : public CppUnit::TestFixture {
}
void testHandleAckReceived_MultipleAcks() {
- std::auto_ptr<StanzaAckRequester> testling(createRequester());
+ boost::shared_ptr<StanzaAckRequester> testling(createRequester());
testling->handleStanzaSent(createMessage("m1"));
testling->handleAckReceived(1);
@@ -109,7 +109,7 @@ class StanzaAckRequesterTest : public CppUnit::TestFixture {
// Handle stanza ack count wrapping, as per the XEP
void testHandleAckReceived_WrapAround() {
- std::auto_ptr<StanzaAckRequester> testling(createRequester());
+ boost::shared_ptr<StanzaAckRequester> testling(createRequester());
testling->lastHandledStanzasCount = boost::numeric_cast<unsigned int>((1ULL<<32) - 1);
testling->handleStanzaSent(createMessage("m1"));
testling->handleStanzaSent(createMessage("m2"));
diff --git a/Swiften/StreamManagement/UnitTest/StanzaAckResponderTest.cpp b/Swiften/StreamManagement/UnitTest/StanzaAckResponderTest.cpp
index 37833bc..71a7f94 100644
--- a/Swiften/StreamManagement/UnitTest/StanzaAckResponderTest.cpp
+++ b/Swiften/StreamManagement/UnitTest/StanzaAckResponderTest.cpp
@@ -26,7 +26,7 @@ class StanzaAckResponderTest : public CppUnit::TestFixture {
public:
void testHandleAckRequestReceived_AcksStanza() {
- std::auto_ptr<StanzaAckResponder> testling(createResponder());
+ boost::shared_ptr<StanzaAckResponder> testling(createResponder());
testling->handleStanzaReceived();
testling->handleAckRequestReceived();
@@ -36,7 +36,7 @@ class StanzaAckResponderTest : public CppUnit::TestFixture {
}
void testHandleAckRequestReceived_AcksMultipleStanzas() {
- std::auto_ptr<StanzaAckResponder> testling(createResponder());
+ boost::shared_ptr<StanzaAckResponder> testling(createResponder());
testling->handleStanzaReceived();
testling->handleStanzaReceived();
@@ -47,7 +47,7 @@ class StanzaAckResponderTest : public CppUnit::TestFixture {
}
void testHandleAckRequestReceived_MultipleAcks() {
- std::auto_ptr<StanzaAckResponder> testling(createResponder());
+ boost::shared_ptr<StanzaAckResponder> testling(createResponder());
testling->handleStanzaReceived();
testling->handleAckRequestReceived();
@@ -61,7 +61,7 @@ class StanzaAckResponderTest : public CppUnit::TestFixture {
// Handle stanza ack count wrapping, as per the XEP
void testHandleAckRequestReceived_WrapAround() {
- std::auto_ptr<StanzaAckResponder> testling(createResponder());
+ boost::shared_ptr<StanzaAckResponder> testling(createResponder());
testling->handledStanzasCount = boost::numeric_cast<unsigned int>((1ULL<<32) - 1);
testling->handleStanzaReceived();
testling->handleStanzaReceived();
diff --git a/Swiften/StreamStack/UnitTest/StreamStackTest.cpp b/Swiften/StreamStack/UnitTest/StreamStackTest.cpp
index 8b2e85c..97d29c9 100644
--- a/Swiften/StreamStack/UnitTest/StreamStackTest.cpp
+++ b/Swiften/StreamStack/UnitTest/StreamStackTest.cpp
@@ -57,7 +57,7 @@ class StreamStackTest : public CppUnit::TestFixture {
void testWriteData_OneIntermediateStream() {
StreamStack testling(xmppStream_, physicalStream_);
- std::auto_ptr<MyStreamLayer> xStream(new MyStreamLayer("X"));
+ boost::shared_ptr<MyStreamLayer> xStream(new MyStreamLayer("X"));
testling.addLayer(xStream.get());
xmppStream_->writeData("foo");
@@ -68,8 +68,8 @@ class StreamStackTest : public CppUnit::TestFixture {
void testWriteData_TwoIntermediateStreamStack() {
StreamStack testling(xmppStream_, physicalStream_);
- std::auto_ptr<MyStreamLayer> xStream(new MyStreamLayer("X"));
- std::auto_ptr<MyStreamLayer> yStream(new MyStreamLayer("Y"));
+ boost::shared_ptr<MyStreamLayer> xStream(new MyStreamLayer("X"));
+ boost::shared_ptr<MyStreamLayer> yStream(new MyStreamLayer("Y"));
testling.addLayer(xStream.get());
testling.addLayer(yStream.get());
@@ -91,7 +91,7 @@ class StreamStackTest : public CppUnit::TestFixture {
void testReadData_OneIntermediateStream() {
StreamStack testling(xmppStream_, physicalStream_);
xmppStream_->onElement.connect(boost::bind(&StreamStackTest::handleElement, this, _1));
- std::auto_ptr<MyStreamLayer> xStream(new MyStreamLayer("<"));
+ boost::shared_ptr<MyStreamLayer> xStream(new MyStreamLayer("<"));
testling.addLayer(xStream.get());
physicalStream_->onDataRead(ByteArray("stream:stream xmlns:stream='http://etherx.jabber.org/streams'><presence/>"));
@@ -102,8 +102,8 @@ class StreamStackTest : public CppUnit::TestFixture {
void testReadData_TwoIntermediateStreamStack() {
StreamStack testling(xmppStream_, physicalStream_);
xmppStream_->onElement.connect(boost::bind(&StreamStackTest::handleElement, this, _1));
- std::auto_ptr<MyStreamLayer> xStream(new MyStreamLayer("s"));
- std::auto_ptr<MyStreamLayer> yStream(new MyStreamLayer("<"));
+ boost::shared_ptr<MyStreamLayer> xStream(new MyStreamLayer("s"));
+ boost::shared_ptr<MyStreamLayer> yStream(new MyStreamLayer("<"));
testling.addLayer(xStream.get());
testling.addLayer(yStream.get());
@@ -115,7 +115,7 @@ class StreamStackTest : public CppUnit::TestFixture {
void testAddLayer_ExistingOnWriteDataSlot() {
StreamStack testling(xmppStream_, physicalStream_);
xmppStream_->onWriteData.connect(boost::bind(&StreamStackTest::handleWriteData, this, _1));
- std::auto_ptr<MyStreamLayer> xStream(new MyStreamLayer("X"));
+ boost::shared_ptr<MyStreamLayer> xStream(new MyStreamLayer("X"));
testling.addLayer(xStream.get());
xmppStream_->writeData("foo");
diff --git a/Swiften/VCards/UnitTest/VCardManagerTest.cpp b/Swiften/VCards/UnitTest/VCardManagerTest.cpp
index 687442b..bea93eb 100644
--- a/Swiften/VCards/UnitTest/VCardManagerTest.cpp
+++ b/Swiften/VCards/UnitTest/VCardManagerTest.cpp
@@ -48,7 +48,7 @@ class VCardManagerTest : public CppUnit::TestFixture {
}
void testGet_NewVCardRequestsVCard() {
- std::auto_ptr<VCardManager> testling = createManager();
+ boost::shared_ptr<VCardManager> testling = createManager();
VCard::ref result = testling->getVCardAndRequestWhenNeeded(JID("foo@bar.com/baz"));
CPPUNIT_ASSERT(!result);
@@ -57,7 +57,7 @@ class VCardManagerTest : public CppUnit::TestFixture {
}
void testGet_ExistingVCard() {
- std::auto_ptr<VCardManager> testling = createManager();
+ boost::shared_ptr<VCardManager> testling = createManager();
VCard::ref vcard(new VCard());
vcard->setFullName("Foo Bar");
vcardStorage->setVCard(JID("foo@bar.com/baz"), vcard);
@@ -69,7 +69,7 @@ class VCardManagerTest : public CppUnit::TestFixture {
}
void testRequest_RequestsVCard() {
- std::auto_ptr<VCardManager> testling = createManager();
+ boost::shared_ptr<VCardManager> testling = createManager();
testling->requestVCard(JID("foo@bar.com/baz"));
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(stanzaChannel->sentStanzas.size()));
@@ -77,7 +77,7 @@ class VCardManagerTest : public CppUnit::TestFixture {
}
void testRequest_ReceiveEmitsNotification() {
- std::auto_ptr<VCardManager> testling = createManager();
+ boost::shared_ptr<VCardManager> testling = createManager();
testling->requestVCard(JID("foo@bar.com/baz"));
stanzaChannel->onIQReceived(createVCardResult());
@@ -90,7 +90,7 @@ class VCardManagerTest : public CppUnit::TestFixture {
}
void testRequest_Error() {
- std::auto_ptr<VCardManager> testling = createManager();
+ boost::shared_ptr<VCardManager> testling = createManager();
testling->requestVCard(JID("foo@bar.com/baz"));
stanzaChannel->onIQReceived(IQ::createError(JID("baz@fum.com/foo"), stanzaChannel->sentStanzas[0]->getID()));
@@ -101,7 +101,7 @@ class VCardManagerTest : public CppUnit::TestFixture {
}
void testRequest_VCardAlreadyRequested() {
- std::auto_ptr<VCardManager> testling = createManager();
+ boost::shared_ptr<VCardManager> testling = createManager();
testling->requestVCard(JID("foo@bar.com/baz"));
VCard::ref result = testling->getVCardAndRequestWhenNeeded(JID("foo@bar.com/baz"));
@@ -110,7 +110,7 @@ class VCardManagerTest : public CppUnit::TestFixture {
}
void testRequest_AfterPreviousRequest() {
- std::auto_ptr<VCardManager> testling = createManager();
+ boost::shared_ptr<VCardManager> testling = createManager();
testling->requestVCard(JID("foo@bar.com/baz"));
stanzaChannel->onIQReceived(createVCardResult());
testling->requestVCard(JID("foo@bar.com/baz"));
@@ -120,7 +120,7 @@ class VCardManagerTest : public CppUnit::TestFixture {
}
void testRequestOwnVCard() {
- std::auto_ptr<VCardManager> testling = createManager();
+ boost::shared_ptr<VCardManager> testling = createManager();
testling->requestVCard(ownJID);
stanzaChannel->onIQReceived(createOwnVCardResult());
@@ -136,7 +136,7 @@ class VCardManagerTest : public CppUnit::TestFixture {
}
void testCreateSetVCardRequest() {
- std::auto_ptr<VCardManager> testling = createManager();
+ boost::shared_ptr<VCardManager> testling = createManager();
VCard::ref vcard = boost::make_shared<VCard>();
vcard->setFullName("New Name");
SetVCardRequest::ref request = testling->createSetVCardRequest(vcard);
@@ -150,7 +150,7 @@ class VCardManagerTest : public CppUnit::TestFixture {
}
void testCreateSetVCardRequest_Error() {
- std::auto_ptr<VCardManager> testling = createManager();
+ boost::shared_ptr<VCardManager> testling = createManager();
VCard::ref vcard = boost::make_shared<VCard>();
vcard->setFullName("New Name");
SetVCardRequest::ref request = testling->createSetVCardRequest(vcard);
@@ -162,8 +162,8 @@ class VCardManagerTest : public CppUnit::TestFixture {
}
private:
- std::auto_ptr<VCardManager> createManager() {
- std::auto_ptr<VCardManager> manager(new VCardManager(ownJID, iqRouter, vcardStorage));
+ boost::shared_ptr<VCardManager> createManager() {
+ boost::shared_ptr<VCardManager> manager(new VCardManager(ownJID, iqRouter, vcardStorage));
manager->onVCardChanged.connect(boost::bind(&VCardManagerTest::handleVCardChanged, this, _1, _2));
manager->onOwnVCardChanged.connect(boost::bind(&VCardManagerTest::handleOwnVCardChanged, this, _1));
return manager;