summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-04-01 17:23:49 (GMT)
committerTobias Markmann <tm@ayena.de>2016-04-04 08:28:23 (GMT)
commit741c45b74d5f634622eb5f757c49323274fb8937 (patch)
treeb9cfa6c2fe2e79e03cc8cb7c1ca1e9cf45aa5328 /Swiften/Serializer/PayloadSerializers/UnitTest
parenteddd92ed76ae68cb1e202602fd3ebd11b69191a2 (diff)
downloadswift-741c45b74d5f634622eb5f757c49323274fb8937.zip
swift-741c45b74d5f634622eb5f757c49323274fb8937.tar.bz2
Modernize code to use C++11 shared_ptr instead of Boost's
This change was done by applying the following 'gsed' replacement calls to all source files: 's/\#include <boost\/shared_ptr\.hpp>/\#include <memory>/g' 's/\#include <boost\/enable_shared_from_this\.hpp>/\#include <memory>/g' 's/\#include <boost\/smart_ptr\/make_shared\.hpp>/\#include <memory>/g' 's/\#include <boost\/make_shared\.hpp>/\#include <memory>/g' 's/\#include <boost\/weak_ptr\.hpp>/\#include <memory>/g' 's/boost::make_shared/std::make_shared/g' 's/boost::dynamic_pointer_cast/std::dynamic_pointer_cast/g' 's/boost::shared_ptr/std::shared_ptr/g' 's/boost::weak_ptr/std::weak_ptr/g' 's/boost::enable_shared_from_this/std::enable_shared_from_this/g' The remaining issues have been fixed manually. Test-Information: Code builds on OS X 10.11.4 and unit tests pass. Change-Id: Ia7ae34eab869fb9ad6387a1348426b71ae4acd5f
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers/UnitTest')
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/BlockSerializerTest.cpp6
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/CapsInfoSerializerTest.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/CarbonsSerializerTest.cpp22
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/ChatStateSerializerTest.cpp16
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/DeliveryReceiptSerializerTest.cpp11
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/DiscoInfoSerializerTest.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/ErrorSerializerTest.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/FormSerializerTest.cpp76
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/ForwardedSerializerTest.cpp26
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/IBBSerializerTest.cpp2
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/IdleSerializerTest.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/InBandRegistrationPayloadSerializerTest.cpp10
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/IsodeIQDelegationSerializerTest.cpp30
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/JingleSerializersTest.cpp53
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/MAMFinSerializerTest.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/MAMQuerySerializerTest.cpp12
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/MAMResultSerializerTest.cpp10
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/MUCAdminPayloadSerializerTest.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.h5
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/PrioritySerializerTest.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/PrivateStorageSerializerTest.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/PubSubItemSerializerTest.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/PubSubItemsSerializerTest.cpp14
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/ReplaceSerializerTest.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/ResourceBindSerializerTest.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/ResultSetSerializerTest.cpp12
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/RosterItemExchangeSerializerTest.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/RosterSerializerTest.cpp10
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/SearchPayloadSerializerTest.cpp30
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelSerializerTest.cpp6
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelsCatalogSerializerTest.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/SoftwareVersionSerializerTest.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/StatusSerializerTest.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/StatusShowSerializerTest.cpp14
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/StorageSerializerTest.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/StreamInitiationSerializerTest.cpp6
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/UserLocationSerializerTest.cpp6
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/UserTuneSerializerTest.cpp6
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/VCardSerializerTest.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/VCardUpdateSerializerTest.cpp4
41 files changed, 248 insertions, 239 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/BlockSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/BlockSerializerTest.cpp
index 1dc97f8..9b9e00d 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/BlockSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/BlockSerializerTest.cpp
@@ -34,7 +34,7 @@ class BlockSerializerTest : public CppUnit::TestFixture
void testExample4() {
BlockSerializer<BlockListPayload> testling("blocklist");
- boost::shared_ptr<BlockListPayload> blocklist = boost::make_shared<BlockListPayload>();
+ std::shared_ptr<BlockListPayload> blocklist = std::make_shared<BlockListPayload>();
blocklist->addItem(JID("romeo@montague.net"));
blocklist->addItem(JID("iago@shakespeare.lit"));
@@ -43,7 +43,7 @@ class BlockSerializerTest : public CppUnit::TestFixture
void testExample6() {
BlockSerializer<BlockPayload> testling("block");
- boost::shared_ptr<BlockPayload> block = boost::make_shared<BlockPayload>();
+ std::shared_ptr<BlockPayload> block = std::make_shared<BlockPayload>();
block->addItem(JID("romeo@montague.net"));
CPPUNIT_ASSERT_EQUAL(std::string("<block xmlns=\"urn:xmpp:blocking\"><item jid=\"romeo@montague.net\"/></block>"), testling.serialize(block));
@@ -51,7 +51,7 @@ class BlockSerializerTest : public CppUnit::TestFixture
void testExample10() {
BlockSerializer<UnblockPayload> testling("unblock");
- boost::shared_ptr<UnblockPayload> unblock = boost::make_shared<UnblockPayload>();
+ std::shared_ptr<UnblockPayload> unblock = std::make_shared<UnblockPayload>();
unblock->addItem(JID("romeo@montague.net"));
CPPUNIT_ASSERT_EQUAL(std::string("<unblock xmlns=\"urn:xmpp:blocking\"><item jid=\"romeo@montague.net\"/></unblock>"), testling.serialize(unblock));
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/CapsInfoSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/CapsInfoSerializerTest.cpp
index 517e98b..c4e3ad8 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/CapsInfoSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/CapsInfoSerializerTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -22,7 +22,7 @@ class CapsInfoSerializerTest : public CppUnit::TestFixture
void testSerialize() {
CapsInfoSerializer testling;
- boost::shared_ptr<CapsInfo> priority(new CapsInfo("http://swift.im", "myversion", "sha-1"));
+ std::shared_ptr<CapsInfo> priority(new CapsInfo("http://swift.im", "myversion", "sha-1"));
CPPUNIT_ASSERT_EQUAL(std::string("<c hash=\"sha-1\" node=\"http://swift.im\" ver=\"myversion\" xmlns=\"http://jabber.org/protocol/caps\"/>"), testling.serialize(priority));
}
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/CarbonsSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/CarbonsSerializerTest.cpp
index a0c49a6..9ac8416 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/CarbonsSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/CarbonsSerializerTest.cpp
@@ -43,7 +43,7 @@ class CarbonsSerializerTest : public CppUnit::TestFixture {
void testSerializeExample3() {
CarbonsEnableSerializer testling;
- CPPUNIT_ASSERT_EQUAL(std::string("<enable xmlns=\"urn:xmpp:carbons:2\"/>"), testling.serialize(boost::make_shared<CarbonsEnable>()));
+ CPPUNIT_ASSERT_EQUAL(std::string("<enable xmlns=\"urn:xmpp:carbons:2\"/>"), testling.serialize(std::make_shared<CarbonsEnable>()));
}
/*
@@ -52,7 +52,7 @@ class CarbonsSerializerTest : public CppUnit::TestFixture {
void testSerializeExample6() {
CarbonsDisableSerializer testling;
- CPPUNIT_ASSERT_EQUAL(std::string("<disable xmlns=\"urn:xmpp:carbons:2\"/>"), testling.serialize(boost::make_shared<CarbonsDisable>()));
+ CPPUNIT_ASSERT_EQUAL(std::string("<disable xmlns=\"urn:xmpp:carbons:2\"/>"), testling.serialize(std::make_shared<CarbonsDisable>()));
}
/*
@@ -61,15 +61,15 @@ class CarbonsSerializerTest : public CppUnit::TestFixture {
void testSerializeExample12() {
CarbonsReceivedSerializer testling(&serializers);
- CarbonsReceived::ref received = boost::make_shared<CarbonsReceived>();
+ CarbonsReceived::ref received = std::make_shared<CarbonsReceived>();
- boost::shared_ptr<Forwarded> forwarded = boost::make_shared<Forwarded>();
+ std::shared_ptr<Forwarded> forwarded = std::make_shared<Forwarded>();
- Message::ref message = boost::make_shared<Message>();
+ Message::ref message = std::make_shared<Message>();
message->setFrom(JID("juliet@capulet.example/balcony"));
message->setTo(JID("romeo@montague.example/garden"));
message->setBody("What man art thou that, thus bescreen'd in night, so stumblest on my counsel?");
- message->addPayload(boost::make_shared<Thread>("0e3141cd80894871a68e6fe6b1ec56fa"));
+ message->addPayload(std::make_shared<Thread>("0e3141cd80894871a68e6fe6b1ec56fa"));
forwarded->setStanza(message);
received->setForwarded(forwarded);
@@ -94,15 +94,15 @@ class CarbonsSerializerTest : public CppUnit::TestFixture {
void testSerializeExample14() {
CarbonsSentSerializer testling(&serializers);
- CarbonsSent::ref sent = boost::make_shared<CarbonsSent>();
+ CarbonsSent::ref sent = std::make_shared<CarbonsSent>();
- boost::shared_ptr<Forwarded> forwarded = boost::make_shared<Forwarded>();
+ std::shared_ptr<Forwarded> forwarded = std::make_shared<Forwarded>();
- Message::ref message = boost::make_shared<Message>();
+ Message::ref message = std::make_shared<Message>();
message->setTo(JID("juliet@capulet.example/balcony"));
message->setFrom(JID("romeo@montague.example/home"));
message->setBody("Neither, fair saint, if either thee dislike.");
- message->addPayload(boost::make_shared<Thread>("0e3141cd80894871a68e6fe6b1ec56fa"));
+ message->addPayload(std::make_shared<Thread>("0e3141cd80894871a68e6fe6b1ec56fa"));
forwarded->setStanza(message);
sent->setForwarded(forwarded);
@@ -127,7 +127,7 @@ class CarbonsSerializerTest : public CppUnit::TestFixture {
void testSerializeExample15() {
CarbonsPrivateSerializer testling;
- CPPUNIT_ASSERT_EQUAL(std::string("<private xmlns=\"urn:xmpp:carbons:2\"/>"), testling.serialize(boost::make_shared<CarbonsPrivate>()));
+ CPPUNIT_ASSERT_EQUAL(std::string("<private xmlns=\"urn:xmpp:carbons:2\"/>"), testling.serialize(std::make_shared<CarbonsPrivate>()));
}
private:
FullPayloadSerializerCollection serializers;
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/ChatStateSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/ChatStateSerializerTest.cpp
index 85b067f..018d2cc 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/ChatStateSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/ChatStateSerializerTest.cpp
@@ -4,6 +4,12 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -26,27 +32,27 @@ class ChatStateSerializerTest : public CppUnit::TestFixture
ChatStateSerializer testling;
void testSerialize_ActiveState() {
- boost::shared_ptr<ChatState> priority(new ChatState(ChatState::Active));
+ std::shared_ptr<ChatState> priority(new ChatState(ChatState::Active));
CPPUNIT_ASSERT_EQUAL(std::string("<active xmlns=\"http://jabber.org/protocol/chatstates\"/>"), testling.serialize(priority));
}
void testSerialize_GoneState() {
- boost::shared_ptr<ChatState> priority(new ChatState(ChatState::Gone));
+ std::shared_ptr<ChatState> priority(new ChatState(ChatState::Gone));
CPPUNIT_ASSERT_EQUAL(std::string("<gone xmlns=\"http://jabber.org/protocol/chatstates\"/>"), testling.serialize(priority));
}
void testSerialize_ComposingState() {
- boost::shared_ptr<ChatState> priority(new ChatState(ChatState::Composing));
+ std::shared_ptr<ChatState> priority(new ChatState(ChatState::Composing));
CPPUNIT_ASSERT_EQUAL(std::string("<composing xmlns=\"http://jabber.org/protocol/chatstates\"/>"), testling.serialize(priority));
}
void testSerialize_PausedState() {
- boost::shared_ptr<ChatState> priority(new ChatState(ChatState::Paused));
+ std::shared_ptr<ChatState> priority(new ChatState(ChatState::Paused));
CPPUNIT_ASSERT_EQUAL(std::string("<paused xmlns=\"http://jabber.org/protocol/chatstates\"/>"), testling.serialize(priority));
}
void testSerialize_InacativeState() {
- boost::shared_ptr<ChatState> priority(new ChatState(ChatState::Inactive));
+ std::shared_ptr<ChatState> priority(new ChatState(ChatState::Inactive));
CPPUNIT_ASSERT_EQUAL(std::string("<inactive xmlns=\"http://jabber.org/protocol/chatstates\"/>"), testling.serialize(priority));
}
};
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/DeliveryReceiptSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/DeliveryReceiptSerializerTest.cpp
index bda9ab7..7ed9421 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/DeliveryReceiptSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/DeliveryReceiptSerializerTest.cpp
@@ -10,8 +10,7 @@
* See the COPYING file for more information.
*/
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -31,18 +30,18 @@ class DeliveryReceiptSerializerTest : public CppUnit::TestFixture {
void testSerialize_XEP0184Example3() {
std::string expected = "<request xmlns=\"urn:xmpp:receipts\"/>";
- DeliveryReceiptRequest::ref receipt = boost::make_shared<DeliveryReceiptRequest>();
+ DeliveryReceiptRequest::ref receipt = std::make_shared<DeliveryReceiptRequest>();
- boost::shared_ptr<DeliveryReceiptRequestSerializer> serializer = boost::make_shared<DeliveryReceiptRequestSerializer>();
+ std::shared_ptr<DeliveryReceiptRequestSerializer> serializer = std::make_shared<DeliveryReceiptRequestSerializer>();
CPPUNIT_ASSERT_EQUAL(expected, serializer->serializePayload(receipt));
}
void testSerialize_XEP0184Example4() {
std::string expected = "<received id=\"richard2-4.1.247\" xmlns=\"urn:xmpp:receipts\"/>";
- DeliveryReceipt::ref receipt = boost::make_shared<DeliveryReceipt>("richard2-4.1.247");
+ DeliveryReceipt::ref receipt = std::make_shared<DeliveryReceipt>("richard2-4.1.247");
- boost::shared_ptr<DeliveryReceiptSerializer> serializer = boost::make_shared<DeliveryReceiptSerializer>();
+ std::shared_ptr<DeliveryReceiptSerializer> serializer = std::make_shared<DeliveryReceiptSerializer>();
CPPUNIT_ASSERT_EQUAL(expected, serializer->serializePayload(receipt));
}
};
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/DiscoInfoSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/DiscoInfoSerializerTest.cpp
index 14b1a34..318c3d7 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/DiscoInfoSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/DiscoInfoSerializerTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -23,7 +23,7 @@ class DiscoInfoSerializerTest : public CppUnit::TestFixture
void testSerialize() {
DiscoInfoSerializer testling;
- boost::shared_ptr<DiscoInfo> discoInfo(new DiscoInfo());
+ std::shared_ptr<DiscoInfo> discoInfo(new DiscoInfo());
discoInfo->addIdentity(DiscoInfo::Identity("Swift", "client", "pc"));
discoInfo->addIdentity(DiscoInfo::Identity("Vlug", "client", "pc", "nl"));
discoInfo->addFeature("http://jabber.org/protocol/caps");
@@ -43,10 +43,10 @@ class DiscoInfoSerializerTest : public CppUnit::TestFixture
void testSerialize_Form() {
DiscoInfoSerializer testling;
- boost::shared_ptr<DiscoInfo> discoInfo(new DiscoInfo());
+ std::shared_ptr<DiscoInfo> discoInfo(new DiscoInfo());
discoInfo->addFeature("http://jabber.org/protocol/caps");
discoInfo->addFeature("http://jabber.org/protocol/disco#info");
- boost::shared_ptr<Form> form(new Form(Form::FormType));
+ std::shared_ptr<Form> form(new Form(Form::FormType));
form->setTitle("Bot Configuration");
discoInfo->addExtension(form);
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/ErrorSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/ErrorSerializerTest.cpp
index 13d9e3c..68a72b8 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/ErrorSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/ErrorSerializerTest.cpp
@@ -4,7 +4,7 @@
* See the COPYING file for more information.
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -24,15 +24,15 @@ class ErrorSerializerTest : public CppUnit::TestFixture {
public:
void testSerialize() {
ErrorSerializer testling(&serializers);
- boost::shared_ptr<ErrorPayload> error(new ErrorPayload(ErrorPayload::BadRequest, ErrorPayload::Cancel, "My Error"));
+ std::shared_ptr<ErrorPayload> error(new ErrorPayload(ErrorPayload::BadRequest, ErrorPayload::Cancel, "My Error"));
CPPUNIT_ASSERT_EQUAL(std::string("<error type=\"cancel\"><bad-request xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\"/><text xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\">My Error</text></error>"), testling.serialize(error));
}
void testSerialize_Payload() {
ErrorSerializer testling(&serializers);
- boost::shared_ptr<ErrorPayload> error = boost::make_shared<ErrorPayload>();
- error->setPayload(boost::make_shared<Delay>());
+ std::shared_ptr<ErrorPayload> error = std::make_shared<ErrorPayload>();
+ error->setPayload(std::make_shared<Delay>());
CPPUNIT_ASSERT_EQUAL(std::string(
"<error type=\"cancel\"><undefined-condition xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\"/><delay stamp=\"not-a-date-timeZ\" xmlns=\"urn:xmpp:delay\"/></error>"
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/FormSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/FormSerializerTest.cpp
index 8bd16cd..6534dce 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/FormSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/FormSerializerTest.cpp
@@ -4,7 +4,7 @@
* See the COPYING file for more information.
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -22,7 +22,7 @@ class FormSerializerTest : public CppUnit::TestFixture {
public:
void testSerializeFormInformation() {
FormSerializer testling;
- boost::shared_ptr<Form> form(new Form(Form::FormType));
+ std::shared_ptr<Form> form(new Form(Form::FormType));
form->setTitle("Bot Configuration");
form->setInstructions("Hello!\nFill out this form to configure your new bot!");
@@ -36,39 +36,39 @@ class FormSerializerTest : public CppUnit::TestFixture {
void testSerializeLayout() {
FormSerializer testling;
- boost::shared_ptr<Form> form(new Form(Form::FormType));
+ std::shared_ptr<Form> form(new Form(Form::FormType));
- FormPage::page page = boost::make_shared<FormPage>();
+ FormPage::page page = std::make_shared<FormPage>();
page->setLabel("P1");
- FormReportedRef::ref reportedRef = boost::make_shared<FormReportedRef>();
+ FormReportedRef::ref reportedRef = std::make_shared<FormReportedRef>();
page->addReportedRef(reportedRef);
- FormText::text formText = boost::make_shared<FormText>();
+ FormText::text formText = std::make_shared<FormText>();
formText->setTextString("P1T1");
page->addTextElement(formText);
- FormField::ref field = boost::make_shared<FormField>(FormField::TextSingleType);
+ FormField::ref field = std::make_shared<FormField>(FormField::TextSingleType);
field->setName("P1F1");
field->setLabel("field one");
page->addField(field);
- FormSection::section section = boost::make_shared<FormSection>();
+ FormSection::section section = std::make_shared<FormSection>();
section->setLabel("P1S1");
- formText = boost::make_shared<FormText>();
+ formText = std::make_shared<FormText>();
formText->setTextString("P1S1T1");
section->addTextElement(formText);
- field = boost::make_shared<FormField>(FormField::TextSingleType);
+ field = std::make_shared<FormField>(FormField::TextSingleType);
field->setName("P1S1F1");
field->setLabel("field two");
section->addField(field);
page->addChildSection(section);
form->addPage(page);
- page = boost::make_shared<FormPage>();
+ page = std::make_shared<FormPage>();
page->setLabel("P2");
- section = boost::make_shared<FormSection>();
+ section = std::make_shared<FormSection>();
section->setLabel("P2S1");
- FormSection::section subSection = boost::make_shared<FormSection>();
+ FormSection::section subSection = std::make_shared<FormSection>();
subSection->setLabel("P2S2");
- FormSection::section subSection2 = boost::make_shared<FormSection>();
+ FormSection::section subSection2 = std::make_shared<FormSection>();
subSection2->setLabel("P2S3");
subSection->addChildSection(subSection2);
section->addChildSection(subSection);
@@ -101,37 +101,37 @@ class FormSerializerTest : public CppUnit::TestFixture {
void testSerializeFields() {
FormSerializer testling;
- boost::shared_ptr<Form> form(new Form(Form::FormType));
+ std::shared_ptr<Form> form(new Form(Form::FormType));
- FormField::ref field = boost::make_shared<FormField>(FormField::HiddenType, "jabber:bot");
+ FormField::ref field = std::make_shared<FormField>(FormField::HiddenType, "jabber:bot");
field->setName("FORM_TYPE");
form->addField(field);
- form->addField(boost::make_shared<FormField>(FormField::FixedType, "Section 1: Bot Info"));
+ form->addField(std::make_shared<FormField>(FormField::FixedType, "Section 1: Bot Info"));
- field = boost::make_shared<FormField>(FormField::TextSingleType);
+ field = std::make_shared<FormField>(FormField::TextSingleType);
field->setName("botname");
field->setLabel("The name of your bot");
form->addField(field);
- field = boost::make_shared<FormField>(FormField::TextMultiType);
+ field = std::make_shared<FormField>(FormField::TextMultiType);
field->setTextMultiValue("This is a bot.\nA quite good one actually");
field->setName("description");
field->setLabel("Helpful description of your bot");
form->addField(field);
- field = boost::make_shared<FormField>(FormField::BooleanType, "1");
+ field = std::make_shared<FormField>(FormField::BooleanType, "1");
field->setName("public");
field->setLabel("Public bot?");
field->setRequired(true);
form->addField(field);
- field = boost::make_shared<FormField>(FormField::TextPrivateType);
+ field = std::make_shared<FormField>(FormField::TextPrivateType);
field->setName("password");
field->setLabel("Password for special access");
form->addField(field);
- field = boost::make_shared<FormField>(FormField::ListMultiType);
+ field = std::make_shared<FormField>(FormField::ListMultiType);
field->addValue("news");
field->addValue("search");
field->setName("features");
@@ -143,7 +143,7 @@ class FormSerializerTest : public CppUnit::TestFixture {
field->addOption(FormField::Option("Search", "search"));
form->addField(field);
- field = boost::make_shared<FormField>(FormField::ListSingleType, "20");
+ field = std::make_shared<FormField>(FormField::ListSingleType, "20");
field->setName("maxsubs");
field->setLabel("Maximum number of subscribers");
field->addOption(FormField::Option("10", "10"));
@@ -155,7 +155,7 @@ class FormSerializerTest : public CppUnit::TestFixture {
form->addField(field);
std::vector<JID> jids;
- field = boost::make_shared<FormField>(FormField::JIDMultiType);
+ field = std::make_shared<FormField>(FormField::JIDMultiType);
field->addValue("foo@bar.com");
field->addValue("baz@fum.org");
field->setName("invitelist");
@@ -204,64 +204,64 @@ class FormSerializerTest : public CppUnit::TestFixture {
void testSerializeFormItems() {
FormSerializer testling;
- boost::shared_ptr<Form> form(new Form(Form::ResultType));
+ std::shared_ptr<Form> form(new Form(Form::ResultType));
- FormField::ref field = boost::make_shared<FormField>(FormField::HiddenType, "jabber:iq:search");
+ FormField::ref field = std::make_shared<FormField>(FormField::HiddenType, "jabber:iq:search");
field->setName("FORM_TYPE");
form->addField(field);
// reported fields
- field = boost::make_shared<FormField>(FormField::TextSingleType);
+ field = std::make_shared<FormField>(FormField::TextSingleType);
field->setName("first");
field->setLabel("Given Name");
form->addReportedField(field);
- field = boost::make_shared<FormField>(FormField::TextSingleType);
+ field = std::make_shared<FormField>(FormField::TextSingleType);
field->setName("last");
field->setLabel("Family Name");
form->addReportedField(field);
- field = boost::make_shared<FormField>(FormField::JIDSingleType);
+ field = std::make_shared<FormField>(FormField::JIDSingleType);
field->setName("jid");
field->setLabel("Jabber ID");
form->addReportedField(field);
- field = boost::make_shared<FormField>(FormField::ListSingleType);
+ field = std::make_shared<FormField>(FormField::ListSingleType);
field->setName("x-gender");
field->setLabel("Gender");
form->addReportedField(field);
Form::FormItem firstItem;
- field = boost::make_shared<FormField>(FormField::TextSingleType, "Benvolio");
+ field = std::make_shared<FormField>(FormField::TextSingleType, "Benvolio");
field->setName("first");
firstItem.push_back(field);
- field = boost::make_shared<FormField>(FormField::TextSingleType, "Montague");
+ field = std::make_shared<FormField>(FormField::TextSingleType, "Montague");
field->setName("last");
firstItem.push_back(field);
- field = boost::make_shared<FormField>(FormField::JIDSingleType, JID("benvolio@montague.net"));
+ field = std::make_shared<FormField>(FormField::JIDSingleType, JID("benvolio@montague.net"));
field->setName("jid");
firstItem.push_back(field);
- field = boost::make_shared<FormField>(FormField::ListSingleType, "male");
+ field = std::make_shared<FormField>(FormField::ListSingleType, "male");
field->setName("x-gender");
firstItem.push_back(field);
Form::FormItem secondItem;
- field = boost::make_shared<FormField>(FormField::TextSingleType, "Romeo");
+ field = std::make_shared<FormField>(FormField::TextSingleType, "Romeo");
field->setName("first");
secondItem.push_back(field);
- field = boost::make_shared<FormField>(FormField::TextSingleType, "Montague");
+ field = std::make_shared<FormField>(FormField::TextSingleType, "Montague");
field->setName("last");
secondItem.push_back(field);
- field = boost::make_shared<FormField>(FormField::JIDSingleType, JID("romeo@montague.net"));
+ field = std::make_shared<FormField>(FormField::JIDSingleType, JID("romeo@montague.net"));
field->setName("jid");
secondItem.push_back(field);
- field = boost::make_shared<FormField>(FormField::ListSingleType, "male");
+ field = std::make_shared<FormField>(FormField::ListSingleType, "male");
field->setName("x-gender");
secondItem.push_back(field);
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/ForwardedSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/ForwardedSerializerTest.cpp
index d7aed26..b0f41d4 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/ForwardedSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/ForwardedSerializerTest.cpp
@@ -1,10 +1,10 @@
/*
- * Copyright (c) 2014 Isode Limited.
+ * Copyright (c) 2014-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -32,11 +32,11 @@ class ForwardedSerializerTest : public CppUnit::TestFixture {
void testSerializeIQ() {
ForwardedSerializer serializer(&serializers);
- boost::shared_ptr<IQ> iq = IQ::createResult(JID("juliet@capulet.lit/balcony"), JID("romeo@montague.lit/orchard"), "id0");
+ std::shared_ptr<IQ> iq = IQ::createResult(JID("juliet@capulet.lit/balcony"), JID("romeo@montague.lit/orchard"), "id0");
- boost::shared_ptr<Forwarded> forwarded(boost::make_shared<Forwarded>());
+ std::shared_ptr<Forwarded> forwarded(std::make_shared<Forwarded>());
forwarded->setStanza(iq);
- forwarded->setDelay(boost::make_shared<Delay>(stringToDateTime(std::string("2010-07-10T23:08:25Z"))));
+ forwarded->setDelay(std::make_shared<Delay>(stringToDateTime(std::string("2010-07-10T23:08:25Z"))));
std::string expectedResult =
"<forwarded xmlns=\"urn:xmpp:forward:0\">"
@@ -50,15 +50,15 @@ class ForwardedSerializerTest : public CppUnit::TestFixture {
void testSerializeMessage() {
ForwardedSerializer serializer(&serializers);
- boost::shared_ptr<Message> message(boost::make_shared<Message>());
+ std::shared_ptr<Message> message(std::make_shared<Message>());
message->setType(Message::Chat);
message->setTo(JID("juliet@capulet.lit/balcony"));
message->setFrom(JID("romeo@montague.lit/orchard"));
message->setBody("Call me but love, and I'll be new baptized; Henceforth I never will be Romeo.");
- boost::shared_ptr<Forwarded> forwarded(boost::make_shared<Forwarded>());
+ std::shared_ptr<Forwarded> forwarded(std::make_shared<Forwarded>());
forwarded->setStanza(message);
- forwarded->setDelay(boost::make_shared<Delay>(stringToDateTime(std::string("2010-07-10T23:08:25Z"))));
+ forwarded->setDelay(std::make_shared<Delay>(stringToDateTime(std::string("2010-07-10T23:08:25Z"))));
std::string expectedResult =
"<forwarded xmlns=\"urn:xmpp:forward:0\">"
@@ -74,13 +74,13 @@ class ForwardedSerializerTest : public CppUnit::TestFixture {
void testSerializeMessageNoDelay() {
ForwardedSerializer serializer(&serializers);
- boost::shared_ptr<Message> message(boost::make_shared<Message>());
+ std::shared_ptr<Message> message(std::make_shared<Message>());
message->setType(Message::Chat);
message->setTo(JID("juliet@capulet.lit/balcony"));
message->setFrom(JID("romeo@montague.lit/orchard"));
message->setBody("Call me but love, and I'll be new baptized; Henceforth I never will be Romeo.");
- boost::shared_ptr<Forwarded> forwarded(boost::make_shared<Forwarded>());
+ std::shared_ptr<Forwarded> forwarded(std::make_shared<Forwarded>());
forwarded->setStanza(message);
std::string expectedResult =
@@ -96,12 +96,12 @@ class ForwardedSerializerTest : public CppUnit::TestFixture {
void testSerializePresence() {
ForwardedSerializer serializer(&serializers);
- boost::shared_ptr<Presence> presence(boost::make_shared<Presence>());
+ std::shared_ptr<Presence> presence(std::make_shared<Presence>());
presence->setType(Presence::Subscribe);
- boost::shared_ptr<Forwarded> forwarded(boost::make_shared<Forwarded>());
+ std::shared_ptr<Forwarded> forwarded(std::make_shared<Forwarded>());
forwarded->setStanza(presence);
- forwarded->setDelay(boost::make_shared<Delay>(stringToDateTime(std::string("2010-07-10T23:08:25Z"))));
+ forwarded->setDelay(std::make_shared<Delay>(stringToDateTime(std::string("2010-07-10T23:08:25Z"))));
std::string expectedResult =
"<forwarded xmlns=\"urn:xmpp:forward:0\">"
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/IBBSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/IBBSerializerTest.cpp
index 45badea..84412c9 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/IBBSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/IBBSerializerTest.cpp
@@ -30,7 +30,7 @@ class IBBSerializerTest : public CppUnit::TestFixture
void testSerialize_data() {
IBBSerializer testling;
- boost::shared_ptr<IBB> ibb = boost::make_shared<IBB>();
+ std::shared_ptr<IBB> ibb = std::make_shared<IBB>();
ibb->setAction(IBB::Data);
ibb->setData(createByteArray("abcdefgihjklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890\x0a"));
ibb->setSequenceNumber(4);
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/IdleSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/IdleSerializerTest.cpp
index 147c7be..46598da 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/IdleSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/IdleSerializerTest.cpp
@@ -10,7 +10,7 @@
* See the COPYING file for more information.
*/
-#include <boost/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -29,7 +29,7 @@ class IdleSerializerTest : public CppUnit::TestFixture {
void testSerialize() {
IdleSerializer testling;
- Idle::ref idle = boost::make_shared<Idle>(stringToDateTime("1969-07-21T02:56:15Z"));
+ Idle::ref idle = std::make_shared<Idle>(stringToDateTime("1969-07-21T02:56:15Z"));
CPPUNIT_ASSERT_EQUAL(std::string("<idle xmlns='urn:xmpp:idle:1' since='1969-07-21T02:56:15Z'/>"), testling.serialize(idle));
}
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/InBandRegistrationPayloadSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/InBandRegistrationPayloadSerializerTest.cpp
index b1b0c45..44ac7a1 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/InBandRegistrationPayloadSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/InBandRegistrationPayloadSerializerTest.cpp
@@ -4,7 +4,7 @@
* See the COPYING file for more information.
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -22,7 +22,7 @@ class InBandRegistrationPayloadSerializerTest : public CppUnit::TestFixture {
public:
void testSerialize() {
InBandRegistrationPayloadSerializer testling;
- boost::shared_ptr<InBandRegistrationPayload> registration(new InBandRegistrationPayload());
+ std::shared_ptr<InBandRegistrationPayload> registration(new InBandRegistrationPayload());
registration->setRegistered(true);
std::string expectedResult =
@@ -34,13 +34,13 @@ class InBandRegistrationPayloadSerializerTest : public CppUnit::TestFixture {
}
void testSerialize_Form() {
InBandRegistrationPayloadSerializer testling;
- boost::shared_ptr<InBandRegistrationPayload> registration(new InBandRegistrationPayload());
+ std::shared_ptr<InBandRegistrationPayload> registration(new InBandRegistrationPayload());
registration->setInstructions("Use the enclosed form to register.");
- boost::shared_ptr<Form> form(new Form(Form::FormType));
+ std::shared_ptr<Form> form(new Form(Form::FormType));
form->setTitle("Contest Registration");
- FormField::ref field = boost::make_shared<FormField>(FormField::HiddenType, "jabber:iq:register");
+ FormField::ref field = std::make_shared<FormField>(FormField::HiddenType, "jabber:iq:register");
field->setName("FORM_TYPE");
form->addField(field);
registration->setForm(form);
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/IsodeIQDelegationSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/IsodeIQDelegationSerializerTest.cpp
index 8f46ca8..4a466ba 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/IsodeIQDelegationSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/IsodeIQDelegationSerializerTest.cpp
@@ -41,13 +41,13 @@ class IsodeIQDelegationSerializerTest : public CppUnit::TestFixture
void testSerialize_Forwarded_IQ() {
IsodeIQDelegationSerializer testling(&serializers);
- boost::shared_ptr<IsodeIQDelegation> isodeIQDelegation = boost::make_shared<IsodeIQDelegation>();
+ std::shared_ptr<IsodeIQDelegation> isodeIQDelegation = std::make_shared<IsodeIQDelegation>();
- boost::shared_ptr<IQ> iq = IQ::createResult(JID("juliet@capulet.lit/balcony"), JID("romeo@montague.lit/orchard"), "id0", boost::make_shared<Subject>("text"));
+ std::shared_ptr<IQ> iq = IQ::createResult(JID("juliet@capulet.lit/balcony"), JID("romeo@montague.lit/orchard"), "id0", std::make_shared<Subject>("text"));
- boost::shared_ptr<Forwarded> forwarded(boost::make_shared<Forwarded>());
+ std::shared_ptr<Forwarded> forwarded(std::make_shared<Forwarded>());
forwarded->setStanza(iq);
- forwarded->setDelay(boost::make_shared<Delay>(stringToDateTime(std::string("2010-07-10T23:08:25Z"))));
+ forwarded->setDelay(std::make_shared<Delay>(stringToDateTime(std::string("2010-07-10T23:08:25Z"))));
isodeIQDelegation->setForward(forwarded);
CPPUNIT_ASSERT_EQUAL(std::string("<delegate xmlns=\"http://isode.com/iq_delegation\">"
@@ -60,17 +60,17 @@ class IsodeIQDelegationSerializerTest : public CppUnit::TestFixture
void testSerialize_Forwarded_Message() {
IsodeIQDelegationSerializer testling(&serializers);
- boost::shared_ptr<IsodeIQDelegation> isodeIQDelegation = boost::make_shared<IsodeIQDelegation>();
+ std::shared_ptr<IsodeIQDelegation> isodeIQDelegation = std::make_shared<IsodeIQDelegation>();
- boost::shared_ptr<Message> message(boost::make_shared<Message>());
+ std::shared_ptr<Message> message(std::make_shared<Message>());
message->setType(Message::Chat);
message->setTo(JID("juliet@capulet.lit/balcony"));
message->setFrom(JID("romeo@montague.lit/orchard"));
message->setBody("Call me but love, and I'll be new baptized; Henceforth I never will be Romeo.");
- boost::shared_ptr<Forwarded> forwarded(boost::make_shared<Forwarded>());
+ std::shared_ptr<Forwarded> forwarded(std::make_shared<Forwarded>());
forwarded->setStanza(message);
- forwarded->setDelay(boost::make_shared<Delay>(stringToDateTime(std::string("2010-07-10T23:08:25Z"))));
+ forwarded->setDelay(std::make_shared<Delay>(stringToDateTime(std::string("2010-07-10T23:08:25Z"))));
isodeIQDelegation->setForward(forwarded);
CPPUNIT_ASSERT_EQUAL(std::string("<delegate xmlns=\"http://isode.com/iq_delegation\">"
@@ -85,15 +85,15 @@ class IsodeIQDelegationSerializerTest : public CppUnit::TestFixture
void testSerialize_Forwarded_MessageNoDelay() {
IsodeIQDelegationSerializer testling(&serializers);
- boost::shared_ptr<IsodeIQDelegation> isodeIQDelegation = boost::make_shared<IsodeIQDelegation>();
+ std::shared_ptr<IsodeIQDelegation> isodeIQDelegation = std::make_shared<IsodeIQDelegation>();
- boost::shared_ptr<Message> message(boost::make_shared<Message>());
+ std::shared_ptr<Message> message(std::make_shared<Message>());
message->setType(Message::Chat);
message->setTo(JID("juliet@capulet.lit/balcony"));
message->setFrom(JID("romeo@montague.lit/orchard"));
message->setBody("Call me but love, and I'll be new baptized; Henceforth I never will be Romeo.");
- boost::shared_ptr<Forwarded> forwarded(boost::make_shared<Forwarded>());
+ std::shared_ptr<Forwarded> forwarded(std::make_shared<Forwarded>());
forwarded->setStanza(message);
isodeIQDelegation->setForward(forwarded);
@@ -108,14 +108,14 @@ class IsodeIQDelegationSerializerTest : public CppUnit::TestFixture
void testSerialize_Forwarded_Presence() {
IsodeIQDelegationSerializer testling(&serializers);
- boost::shared_ptr<IsodeIQDelegation> isodeIQDelegation = boost::make_shared<IsodeIQDelegation>();
+ std::shared_ptr<IsodeIQDelegation> isodeIQDelegation = std::make_shared<IsodeIQDelegation>();
- boost::shared_ptr<Presence> presence(boost::make_shared<Presence>());
+ std::shared_ptr<Presence> presence(std::make_shared<Presence>());
presence->setType(Presence::Subscribe);
- boost::shared_ptr<Forwarded> forwarded(boost::make_shared<Forwarded>());
+ std::shared_ptr<Forwarded> forwarded(std::make_shared<Forwarded>());
forwarded->setStanza(presence);
- forwarded->setDelay(boost::make_shared<Delay>(stringToDateTime(std::string("2010-07-10T23:08:25Z"))));
+ forwarded->setDelay(std::make_shared<Delay>(stringToDateTime(std::string("2010-07-10T23:08:25Z"))));
isodeIQDelegation->setForward(forwarded);
CPPUNIT_ASSERT_EQUAL(std::string("<delegate xmlns=\"http://isode.com/iq_delegation\">"
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/JingleSerializersTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/JingleSerializersTest.cpp
index ecb68cd..00d79b3 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/JingleSerializersTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/JingleSerializersTest.cpp
@@ -10,8 +10,7 @@
* See the COPYING file for more information.
*/
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -49,8 +48,8 @@ class JingleSerializersTest : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE_END();
- boost::shared_ptr<JinglePayloadSerializer> createTestling() {
- return boost::make_shared<JinglePayloadSerializer>(&collection);
+ std::shared_ptr<JinglePayloadSerializer> createTestling() {
+ return std::make_shared<JinglePayloadSerializer>(&collection);
}
@@ -66,7 +65,7 @@ class JingleSerializersTest : public CppUnit::TestFixture {
"<range/>"
"</file>";
- StreamInitiationFileInfo::ref fileInfo = boost::make_shared<StreamInitiationFileInfo>();
+ StreamInitiationFileInfo::ref fileInfo = std::make_shared<StreamInitiationFileInfo>();
fileInfo->setDate(stringToDateTime("1969-07-21T02:56:15Z"));
fileInfo->setHash("552da749930852c69ae5d2141d3766b1");
fileInfo->setSize(1022);
@@ -74,7 +73,7 @@ class JingleSerializersTest : public CppUnit::TestFixture {
fileInfo->setDescription("This is a test. If this were a real file...");
fileInfo->setSupportsRangeRequests(true);
- boost::shared_ptr<StreamInitiationFileInfoSerializer> serializer = boost::make_shared<StreamInitiationFileInfoSerializer>();
+ std::shared_ptr<StreamInitiationFileInfoSerializer> serializer = std::make_shared<StreamInitiationFileInfoSerializer>();
CPPUNIT_ASSERT_EQUAL(expected, serializer->serializePayload(fileInfo));
}
@@ -84,12 +83,12 @@ class JingleSerializersTest : public CppUnit::TestFixture {
"<range offset=\"270336\"/>"
"</file>";
- StreamInitiationFileInfo::ref fileInfo = boost::make_shared<StreamInitiationFileInfo>();
+ StreamInitiationFileInfo::ref fileInfo = std::make_shared<StreamInitiationFileInfo>();
fileInfo->setHash("552da749930852c69ae5d2141d3766b1");
fileInfo->setSupportsRangeRequests(true);
fileInfo->setRangeOffset(270336);
- boost::shared_ptr<StreamInitiationFileInfoSerializer> serializer = boost::make_shared<StreamInitiationFileInfoSerializer>();
+ std::shared_ptr<StreamInitiationFileInfoSerializer> serializer = std::make_shared<StreamInitiationFileInfoSerializer>();
CPPUNIT_ASSERT_EQUAL(expected, serializer->serializePayload(fileInfo));
}
@@ -110,16 +109,16 @@ class JingleSerializersTest : public CppUnit::TestFixture {
"</content>"
"</jingle>";
- JinglePayload::ref payload = boost::make_shared<JinglePayload>();
+ JinglePayload::ref payload = std::make_shared<JinglePayload>();
payload->setAction(JinglePayload::SessionInitiate);
payload->setSessionID("a73sjjvkla37jfea");
payload->setInitiator(JID("romeo@montague.lit/orchard"));
- JingleIBBTransportPayload::ref transport = boost::make_shared<JingleIBBTransportPayload>();
+ JingleIBBTransportPayload::ref transport = std::make_shared<JingleIBBTransportPayload>();
transport->setBlockSize(4096);
transport->setSessionID("ch3d9s71");
- JingleContentPayload::ref content = boost::make_shared<JingleContentPayload>();
+ JingleContentPayload::ref content = std::make_shared<JingleContentPayload>();
content->setCreator(JingleContentPayload::InitiatorCreator);
content->setName("ex");
content->addTransport(transport);
@@ -143,16 +142,16 @@ class JingleSerializersTest : public CppUnit::TestFixture {
"</content>"
"</jingle>";
- JinglePayload::ref payload = boost::make_shared<JinglePayload>();
+ JinglePayload::ref payload = std::make_shared<JinglePayload>();
payload->setAction(JinglePayload::TransportInfo);
payload->setInitiator(JID("romeo@montague.lit/orchard"));
payload->setSessionID("a73sjjvkla37jfea");
- JingleContentPayload::ref content = boost::make_shared<JingleContentPayload>();
+ JingleContentPayload::ref content = std::make_shared<JingleContentPayload>();
content->setCreator(JingleContentPayload::InitiatorCreator);
content->setName("ex");
- JingleIBBTransportPayload::ref transport = boost::make_shared<JingleIBBTransportPayload>();
+ JingleIBBTransportPayload::ref transport = std::make_shared<JingleIBBTransportPayload>();
transport->setBlockSize(2048);
transport->setSessionID("bt8a71h6");
@@ -172,7 +171,7 @@ class JingleSerializersTest : public CppUnit::TestFixture {
"<reason><success/></reason>"
"</jingle>";
- JinglePayload::ref payload = boost::make_shared<JinglePayload>();
+ JinglePayload::ref payload = std::make_shared<JinglePayload>();
payload->setAction(JinglePayload::SessionTerminate);
payload->setInitiator(JID("romeo@montague.lit/orchard"));
payload->setSessionID("a73sjjvkla37jfea");
@@ -193,7 +192,7 @@ class JingleSerializersTest : public CppUnit::TestFixture {
"<hash algo=\"sha-1\" xmlns=\"urn:xmpp:hashes:1\">VS2nSZMIUsaa5dIUHTdmsQ==</hash>"
"</file>"
"</description>";
- JingleFileTransferDescription::ref desc = boost::make_shared<JingleFileTransferDescription>();
+ JingleFileTransferDescription::ref desc = std::make_shared<JingleFileTransferDescription>();
JingleFileTransferFileInfo fileInfo;
fileInfo.setDate(stringToDateTime("1969-07-21T02:56:15Z"));
@@ -205,7 +204,7 @@ class JingleSerializersTest : public CppUnit::TestFixture {
desc->setFileInfo(fileInfo);
- CPPUNIT_ASSERT_EQUAL(expected, boost::make_shared<JingleFileTransferDescriptionSerializer>()->serialize(desc));
+ CPPUNIT_ASSERT_EQUAL(expected, std::make_shared<JingleFileTransferDescriptionSerializer>()->serialize(desc));
}
// http://xmpp.org/extensions/xep-0234.html#example-3
@@ -251,16 +250,16 @@ class JingleSerializersTest : public CppUnit::TestFixture {
"</content>"
"</jingle>";
- JinglePayload::ref payload = boost::make_shared<JinglePayload>();
+ JinglePayload::ref payload = std::make_shared<JinglePayload>();
payload->setAction(JinglePayload::SessionAccept);
payload->setInitiator(JID("romeo@montague.lit/orchard"));
payload->setSessionID("851ba2");
- JingleContentPayload::ref content = boost::make_shared<JingleContentPayload>();
+ JingleContentPayload::ref content = std::make_shared<JingleContentPayload>();
content->setCreator(JingleContentPayload::InitiatorCreator);
content->setName("a-file-offer");
- JingleFileTransferDescription::ref description = boost::make_shared<JingleFileTransferDescription>();
+ JingleFileTransferDescription::ref description = std::make_shared<JingleFileTransferDescription>();
JingleFileTransferFileInfo fileInfo;
fileInfo.setName("test.txt");
fileInfo.setSize(1022);
@@ -293,12 +292,12 @@ class JingleSerializersTest : public CppUnit::TestFixture {
//"</content>"
"</jingle>";
- JinglePayload::ref payload = boost::make_shared<JinglePayload>();
+ JinglePayload::ref payload = std::make_shared<JinglePayload>();
payload->setAction(JinglePayload::TransportInfo);
payload->setInitiator(JID("romeo@montague.lit/orchard"));
payload->setSessionID("a73sjjvkla37jfea");
- JingleContentPayload::ref content = boost::make_shared<JingleContentPayload>();
+ JingleContentPayload::ref content = std::make_shared<JingleContentPayload>();
content->setCreator(JingleContentPayload::InitiatorCreator);
content->setName("ex");
payload->addPayload(content);
@@ -321,12 +320,12 @@ class JingleSerializersTest : public CppUnit::TestFixture {
"</checksum>"
"</jingle>";
- JinglePayload::ref payload = boost::make_shared<JinglePayload>();
+ JinglePayload::ref payload = std::make_shared<JinglePayload>();
payload->setAction(JinglePayload::SessionInfo);
payload->setInitiator(JID("romeo@montague.lit/orchard"));
payload->setSessionID("a73sjjvkla37jfea");
- JingleFileTransferHash::ref hash = boost::make_shared<JingleFileTransferHash>();
+ JingleFileTransferHash::ref hash = std::make_shared<JingleFileTransferHash>();
hash->getFileInfo().addHash(HashElement("sha-1", Base64::decode("VS2nSZMIUsaa5dIUHTdmsQ==")));
payload->addPayload(hash);
@@ -364,16 +363,16 @@ class JingleSerializersTest : public CppUnit::TestFixture {
"</content>"
"</jingle>";
- JinglePayload::ref payload = boost::make_shared<JinglePayload>();
+ JinglePayload::ref payload = std::make_shared<JinglePayload>();
payload->setAction(JinglePayload::SessionInitiate);
payload->setInitiator(JID("romeo@montague.lit/orchard"));
payload->setSessionID("a73sjjvkla37jfea");
- JingleContentPayload::ref content = boost::make_shared<JingleContentPayload>();
+ JingleContentPayload::ref content = std::make_shared<JingleContentPayload>();
content->setCreator(JingleContentPayload::InitiatorCreator);
content->setName("ex");
- JingleS5BTransportPayload::ref transport = boost::make_shared<JingleS5BTransportPayload>();
+ JingleS5BTransportPayload::ref transport = std::make_shared<JingleS5BTransportPayload>();
transport->setMode(JingleS5BTransportPayload::TCPMode);
transport->setDstAddr("1a12fb7bc625e55f3ed5b29a53dbe0e4aa7d80ba");
transport->setSessionID("vj3hs98y");
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/MAMFinSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/MAMFinSerializerTest.cpp
index 0eda01c..198f73c 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/MAMFinSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/MAMFinSerializerTest.cpp
@@ -4,7 +4,7 @@
* See the COPYING file for more information.
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -24,7 +24,7 @@ class MAMFinSerializerTest : public CppUnit::TestFixture {
void testSerialize_XEP0313_Exmaple1() {
MAMFinSerializer serializer;
- boost::shared_ptr<MAMFin> fin = boost::make_shared<MAMFin>();
+ std::shared_ptr<MAMFin> fin = std::make_shared<MAMFin>();
fin->setQueryID("f27");
std::string expectedResult =
@@ -35,10 +35,10 @@ class MAMFinSerializerTest : public CppUnit::TestFixture {
void testSerialize_XEP0313_Exmaple9() {
MAMFinSerializer serializer;
- boost::shared_ptr<MAMFin> fin = boost::make_shared<MAMFin>();
+ std::shared_ptr<MAMFin> fin = std::make_shared<MAMFin>();
fin->setComplete(true);
- boost::shared_ptr<ResultSet> set = boost::make_shared<ResultSet>();
+ std::shared_ptr<ResultSet> set = std::make_shared<ResultSet>();
set->setFirstID(std::string("23452-4534-1"));
set->setFirstIDIndex(0);
set->setLastID(std::string("390-2342-22"));
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/MAMQuerySerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/MAMQuerySerializerTest.cpp
index faf788d..cc46ef9 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/MAMQuerySerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/MAMQuerySerializerTest.cpp
@@ -4,7 +4,7 @@
* See the COPYING file for more information.
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -27,22 +27,22 @@ class MAMQuerySerializerTest : public CppUnit::TestFixture {
void testSerialize() {
MAMQuerySerializer serializer;
- boost::shared_ptr<Form> parameters(boost::make_shared<Form>());
+ std::shared_ptr<Form> parameters(std::make_shared<Form>());
- boost::shared_ptr<FormField> fieldType = boost::make_shared<FormField>(FormField::TextSingleType);
+ std::shared_ptr<FormField> fieldType = std::make_shared<FormField>(FormField::TextSingleType);
fieldType->setName("FORM_TYPE");
fieldType->addValue("urn:xmpp:mam:0");
parameters->addField(fieldType);
- boost::shared_ptr<FormField> fieldStart = boost::make_shared<FormField>(FormField::TextSingleType);
+ std::shared_ptr<FormField> fieldStart = std::make_shared<FormField>(FormField::TextSingleType);
fieldStart->setName("start");
fieldStart->addValue("2010-08-07T00:00:00Z");
parameters->addField(fieldStart);
- boost::shared_ptr<ResultSet> set = boost::make_shared<ResultSet>();
+ std::shared_ptr<ResultSet> set = std::make_shared<ResultSet>();
set->setMaxItems(10);
- boost::shared_ptr<MAMQuery> query(boost::make_shared<MAMQuery>());
+ std::shared_ptr<MAMQuery> query(std::make_shared<MAMQuery>());
query->setQueryID(std::string("id0"));
query->setNode(std::string("node1"));
query->setForm(parameters);
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/MAMResultSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/MAMResultSerializerTest.cpp
index 40ca27d..09bec39 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/MAMResultSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/MAMResultSerializerTest.cpp
@@ -4,7 +4,7 @@
* See the COPYING file for more information.
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -27,17 +27,17 @@ class MAMResultSerializerTest : public CppUnit::TestFixture {
void testSerialize() {
MAMResultSerializer serializer(&serializers);
- boost::shared_ptr<Message> message(boost::make_shared<Message>());
+ std::shared_ptr<Message> message(std::make_shared<Message>());
message->setType(Message::Chat);
message->setTo(JID("juliet@capulet.lit/balcony"));
message->setFrom(JID("romeo@montague.lit/orchard"));
message->setBody("Call me but love, and I'll be new baptized; Henceforth I never will be Romeo.");
- boost::shared_ptr<Forwarded> forwarded(boost::make_shared<Forwarded>());
+ std::shared_ptr<Forwarded> forwarded(std::make_shared<Forwarded>());
forwarded->setStanza(message);
- forwarded->setDelay(boost::make_shared<Delay>(stringToDateTime(std::string("2010-07-10T23:08:25Z"))));
+ forwarded->setDelay(std::make_shared<Delay>(stringToDateTime(std::string("2010-07-10T23:08:25Z"))));
- boost::shared_ptr<MAMResult> result(boost::make_shared<MAMResult>());
+ std::shared_ptr<MAMResult> result(std::make_shared<MAMResult>());
result->setID("28482-98726-73623");
result->setQueryID(std::string("f27"));
result->setPayload(forwarded);
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/MUCAdminPayloadSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/MUCAdminPayloadSerializerTest.cpp
index fc6b346..5aeb9dd 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/MUCAdminPayloadSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/MUCAdminPayloadSerializerTest.cpp
@@ -4,7 +4,7 @@
* See the COPYING file for more information.
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -24,7 +24,7 @@ class MUCAdminPayloadSerializerTest : public CppUnit::TestFixture
void testSerialize() {
MUCAdminPayloadSerializer testling;
- boost::shared_ptr<MUCAdminPayload> admin = boost::make_shared<MUCAdminPayload>();
+ std::shared_ptr<MUCAdminPayload> admin = std::make_shared<MUCAdminPayload>();
MUCItem item;
item.affiliation = MUCOccupant::Owner;
item.role = MUCOccupant::Visitor;
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.cpp
index 223e7d9..d34ea38 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -12,7 +12,7 @@
namespace Swift {
-std::string PayloadsSerializer::serialize(boost::shared_ptr<Payload> payload) {
+std::string PayloadsSerializer::serialize(std::shared_ptr<Payload> payload) {
PayloadSerializer* serializer = serializers.getPayloadSerializer(payload);
if (serializer) {
return serializer->serialize(payload);
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.h b/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.h
index 827e9da..5e0f0c5 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.h
@@ -6,17 +6,16 @@
#pragma once
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Elements/Payload.h>
#include <Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.h>
namespace Swift {
class PayloadsSerializer {
public:
- std::string serialize(boost::shared_ptr<Payload> payload);
+ std::string serialize(std::shared_ptr<Payload> payload);
private:
FullPayloadSerializerCollection serializers;
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/PrioritySerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/PrioritySerializerTest.cpp
index 19971c2..87d7d0f 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/PrioritySerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/PrioritySerializerTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -22,7 +22,7 @@ class PrioritySerializerTest : public CppUnit::TestFixture
void testSerialize() {
PrioritySerializer testling;
- boost::shared_ptr<Priority> priority(new Priority(-113));
+ std::shared_ptr<Priority> priority(new Priority(-113));
CPPUNIT_ASSERT_EQUAL(std::string("<priority>-113</priority>"), testling.serialize(priority));
}
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/PrivateStorageSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/PrivateStorageSerializerTest.cpp
index 3b115b3..4e77e7d 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/PrivateStorageSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/PrivateStorageSerializerTest.cpp
@@ -24,8 +24,8 @@ class PrivateStorageSerializerTest : public CppUnit::TestFixture {
void testSerialize() {
PayloadsSerializer serializer;
- boost::shared_ptr<PrivateStorage> privateStorage(new PrivateStorage());
- boost::shared_ptr<Storage> storage(new Storage());
+ std::shared_ptr<PrivateStorage> privateStorage(new PrivateStorage());
+ std::shared_ptr<Storage> storage(new Storage());
Storage::Room room;
room.name = "Swift";
room.jid = JID("swift@rooms.swift.im");
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/PubSubItemSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/PubSubItemSerializerTest.cpp
index b835421..e8673b9 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/PubSubItemSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/PubSubItemSerializerTest.cpp
@@ -4,7 +4,7 @@
* See the COPYING file for more information.
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -26,10 +26,10 @@ class PubSubItemSerializerTest : public CppUnit::TestFixture {
void testSerialize() {
PubSubItemSerializer serializer(&serializers);
- boost::shared_ptr<RawXMLPayload> payload(boost::make_shared<RawXMLPayload>());
+ std::shared_ptr<RawXMLPayload> payload(std::make_shared<RawXMLPayload>());
payload->setRawXML("<payload xmlns=\"tmp\"/>");
- boost::shared_ptr<PubSubItem> item(boost::make_shared<PubSubItem>());
+ std::shared_ptr<PubSubItem> item(std::make_shared<PubSubItem>());
item->addData(payload);
item->setID("pubsub-item-1");
@@ -44,7 +44,7 @@ class PubSubItemSerializerTest : public CppUnit::TestFixture {
void testSerializeEmptyID() {
PubSubItemSerializer serializer(&serializers);
- boost::shared_ptr<PubSubItem> item(boost::make_shared<PubSubItem>());
+ std::shared_ptr<PubSubItem> item(std::make_shared<PubSubItem>());
std::string expectedResult =
"<item xmlns=\"http://jabber.org/protocol/pubsub\"/>";
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/PubSubItemsSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/PubSubItemsSerializerTest.cpp
index fa99202..0194553 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/PubSubItemsSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/PubSubItemsSerializerTest.cpp
@@ -4,7 +4,7 @@
* See the COPYING file for more information.
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -26,21 +26,21 @@ class PubSubItemsSerializerTest : public CppUnit::TestFixture {
void testSerialize() {
PubSubItemsSerializer serializer(&serializers);
- boost::shared_ptr<RawXMLPayload> payload1(boost::make_shared<RawXMLPayload>());
+ std::shared_ptr<RawXMLPayload> payload1(std::make_shared<RawXMLPayload>());
payload1->setRawXML("<payload xmlns=\"tmp\"/>");
- boost::shared_ptr<PubSubItem> item1(boost::make_shared<PubSubItem>());
+ std::shared_ptr<PubSubItem> item1(std::make_shared<PubSubItem>());
item1->addData(payload1);
item1->setID("pubsub-item-1");
- boost::shared_ptr<RawXMLPayload> payload2(boost::make_shared<RawXMLPayload>());
+ std::shared_ptr<RawXMLPayload> payload2(std::make_shared<RawXMLPayload>());
payload2->setRawXML("<payload xmlns=\"other-tmp\"/>");
- boost::shared_ptr<PubSubItem> item2(boost::make_shared<PubSubItem>());
+ std::shared_ptr<PubSubItem> item2(std::make_shared<PubSubItem>());
item2->addData(payload2);
item2->setID("pubsub-item-2");
- boost::shared_ptr<PubSubItems> items(boost::make_shared<PubSubItems>());
+ std::shared_ptr<PubSubItems> items(std::make_shared<PubSubItems>());
items->setNode("test-node");
items->setSubscriptionID(std::string("sub-id"));
items->addItem(item1);
@@ -62,7 +62,7 @@ class PubSubItemsSerializerTest : public CppUnit::TestFixture {
void testSerializeEmptyItems() {
PubSubItemsSerializer serializer(&serializers);
- boost::shared_ptr<PubSubItems> items(boost::make_shared<PubSubItems>());
+ std::shared_ptr<PubSubItems> items(std::make_shared<PubSubItems>());
std::string expectedResult =
"<items node=\"\" xmlns=\"http://jabber.org/protocol/pubsub\"/>";
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/ReplaceSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/ReplaceSerializerTest.cpp
index 1f40b26..4aab334 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/ReplaceSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/ReplaceSerializerTest.cpp
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (c) 2012 Isode Limited.
+ * Copyright (c) 2012-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -27,7 +27,7 @@ class ReplaceSerializerTest: public CppUnit::TestFixture {
void testSerialize() {
ReplaceSerializer testling;
- boost::shared_ptr<Replace> replace(new Replace());
+ std::shared_ptr<Replace> replace(new Replace());
replace->setID("bad1");
CPPUNIT_ASSERT_EQUAL(std::string("<replace id = 'bad1' xmlns='urn:xmpp:message-correct:0'/>"), testling.serialize(replace));
}
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/ResourceBindSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/ResourceBindSerializerTest.cpp
index 9bc637f..30cd6e7 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/ResourceBindSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/ResourceBindSerializerTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -24,7 +24,7 @@ class ResourceBindSerializerTest : public CppUnit::TestFixture
void testSerialize_JID() {
ResourceBindSerializer testling;
- boost::shared_ptr<ResourceBind> resourceBind(new ResourceBind());
+ std::shared_ptr<ResourceBind> resourceBind(new ResourceBind());
resourceBind->setJID(JID("somenode@example.com/someresource"));
CPPUNIT_ASSERT_EQUAL(std::string(
@@ -35,7 +35,7 @@ class ResourceBindSerializerTest : public CppUnit::TestFixture
void testSerialize_Resource() {
ResourceBindSerializer testling;
- boost::shared_ptr<ResourceBind> resourceBind(new ResourceBind());
+ std::shared_ptr<ResourceBind> resourceBind(new ResourceBind());
resourceBind->setResource("someresource");
CPPUNIT_ASSERT_EQUAL(std::string(
@@ -46,7 +46,7 @@ class ResourceBindSerializerTest : public CppUnit::TestFixture
void testSerialize_Empty() {
ResourceBindSerializer testling;
- boost::shared_ptr<ResourceBind> resourceBind(new ResourceBind());
+ std::shared_ptr<ResourceBind> resourceBind(new ResourceBind());
CPPUNIT_ASSERT_EQUAL(std::string("<bind xmlns=\"urn:ietf:params:xml:ns:xmpp-bind\"/>"), testling.serialize(resourceBind));
}
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/ResultSetSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/ResultSetSerializerTest.cpp
index 0b0163e..fecd3c5 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/ResultSetSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/ResultSetSerializerTest.cpp
@@ -4,7 +4,7 @@
* See the COPYING file for more information.
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -28,7 +28,7 @@ class ResultSetSerializerTest : public CppUnit::TestFixture {
void testSerializeFull() {
ResultSetSerializer serializer;
- boost::shared_ptr<ResultSet> resultSet(boost::make_shared<ResultSet>());
+ std::shared_ptr<ResultSet> resultSet(std::make_shared<ResultSet>());
resultSet->setMaxItems(100);
resultSet->setCount(800);
@@ -56,7 +56,7 @@ class ResultSetSerializerTest : public CppUnit::TestFixture {
void testSerializeMaxItems() {
ResultSetSerializer serializer;
- boost::shared_ptr<ResultSet> resultSet(boost::make_shared<ResultSet>());
+ std::shared_ptr<ResultSet> resultSet(std::make_shared<ResultSet>());
resultSet->setMaxItems(100);
@@ -71,7 +71,7 @@ class ResultSetSerializerTest : public CppUnit::TestFixture {
void testSerializeEmptyBefore() {
ResultSetSerializer serializer;
- boost::shared_ptr<ResultSet> resultSet(boost::make_shared<ResultSet>());
+ std::shared_ptr<ResultSet> resultSet(std::make_shared<ResultSet>());
resultSet->setBefore(std::string());
@@ -86,7 +86,7 @@ class ResultSetSerializerTest : public CppUnit::TestFixture {
void testSerializeFirst() {
ResultSetSerializer serializer;
- boost::shared_ptr<ResultSet> resultSet(boost::make_shared<ResultSet>());
+ std::shared_ptr<ResultSet> resultSet(std::make_shared<ResultSet>());
resultSet->setFirstID(std::string("stpeter@jabber.org"));
@@ -101,7 +101,7 @@ class ResultSetSerializerTest : public CppUnit::TestFixture {
void testSerializeFirstWithIndex() {
ResultSetSerializer serializer;
- boost::shared_ptr<ResultSet> resultSet(boost::make_shared<ResultSet>());
+ std::shared_ptr<ResultSet> resultSet(std::make_shared<ResultSet>());
resultSet->setFirstID(std::string("stpeter@jabber.org"));
resultSet->setFirstIDIndex(123);
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/RosterItemExchangeSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/RosterItemExchangeSerializerTest.cpp
index 65922f7..652becb 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/RosterItemExchangeSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/RosterItemExchangeSerializerTest.cpp
@@ -4,6 +4,12 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -22,7 +28,7 @@ class RosterItemExchangeSerializerTest : public CppUnit::TestFixture
void testSerialize() {
RosterItemExchangeSerializer testling;
- boost::shared_ptr<RosterItemExchangePayload> roster(new RosterItemExchangePayload());
+ std::shared_ptr<RosterItemExchangePayload> roster(new RosterItemExchangePayload());
RosterItemExchangePayload::Item item1;
item1.setJID("foo@bar.com");
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/RosterSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/RosterSerializerTest.cpp
index 6670bb8..0c576d2 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/RosterSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/RosterSerializerTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -22,7 +22,7 @@ class RosterSerializerTest : public CppUnit::TestFixture {
public:
void testSerialize() {
RosterSerializer testling;
- boost::shared_ptr<RosterPayload> roster(new RosterPayload());
+ std::shared_ptr<RosterPayload> roster(new RosterPayload());
RosterItemPayload item1;
item1.setJID(JID("foo@bar.com"));
@@ -52,7 +52,7 @@ class RosterSerializerTest : public CppUnit::TestFixture {
void testSerialize_ItemWithUnknownContent() {
RosterSerializer testling;
- boost::shared_ptr<RosterPayload> roster(new RosterPayload());
+ std::shared_ptr<RosterPayload> roster(new RosterPayload());
RosterItemPayload item;
item.setJID(JID("baz@blo.com"));
@@ -79,7 +79,7 @@ class RosterSerializerTest : public CppUnit::TestFixture {
void testSerialize_WithVersion() {
RosterSerializer testling;
- boost::shared_ptr<RosterPayload> roster(new RosterPayload());
+ std::shared_ptr<RosterPayload> roster(new RosterPayload());
roster->setVersion("ver20");
std::string expectedResult = "<query ver=\"ver20\" xmlns=\"jabber:iq:roster\"/>";
@@ -89,7 +89,7 @@ class RosterSerializerTest : public CppUnit::TestFixture {
void testSerialize_WithEmptyVersion() {
RosterSerializer testling;
- boost::shared_ptr<RosterPayload> roster(new RosterPayload());
+ std::shared_ptr<RosterPayload> roster(new RosterPayload());
roster->setVersion("");
std::string expectedResult = "<query ver=\"\" xmlns=\"jabber:iq:roster\"/>";
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/SearchPayloadSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/SearchPayloadSerializerTest.cpp
index 0dfe0b0..3deca11 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/SearchPayloadSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/SearchPayloadSerializerTest.cpp
@@ -4,7 +4,7 @@
* See the COPYING file for more information.
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -78,64 +78,64 @@ class SearchPayloadSerializerTest : public CppUnit::TestFixture {
SearchPayloadSerializer testling;
SearchPayload::ref payload(new SearchPayload());
- boost::shared_ptr<Form> form(new Form(Form::ResultType));
+ std::shared_ptr<Form> form(new Form(Form::ResultType));
- FormField::ref field = boost::make_shared<FormField>(FormField::HiddenType, "jabber:iq:search");
+ FormField::ref field = std::make_shared<FormField>(FormField::HiddenType, "jabber:iq:search");
field->setName("FORM_TYPE");
form->addField(field);
// reported fields
- field = boost::make_shared<FormField>(FormField::TextSingleType);
+ field = std::make_shared<FormField>(FormField::TextSingleType);
field->setName("first");
field->setLabel("Given Name");
form->addReportedField(field);
- field = boost::make_shared<FormField>(FormField::TextSingleType);
+ field = std::make_shared<FormField>(FormField::TextSingleType);
field->setName("last");
field->setLabel("Family Name");
form->addReportedField(field);
- field = boost::make_shared<FormField>(FormField::JIDSingleType);
+ field = std::make_shared<FormField>(FormField::JIDSingleType);
field->setName("jid");
field->setLabel("Jabber ID");
form->addReportedField(field);
- field = boost::make_shared<FormField>(FormField::ListSingleType);
+ field = std::make_shared<FormField>(FormField::ListSingleType);
field->setName("x-gender");
field->setLabel("Gender");
form->addReportedField(field);
Form::FormItem firstItem;
- field = boost::make_shared<FormField>(FormField::TextSingleType, "Benvolio");
+ field = std::make_shared<FormField>(FormField::TextSingleType, "Benvolio");
field->setName("first");
firstItem.push_back(field);
- field = boost::make_shared<FormField>(FormField::TextSingleType, "Montague");
+ field = std::make_shared<FormField>(FormField::TextSingleType, "Montague");
field->setName("last");
firstItem.push_back(field);
- field = boost::make_shared<FormField>(FormField::TextSingleType, "benvolio@montague.net");
+ field = std::make_shared<FormField>(FormField::TextSingleType, "benvolio@montague.net");
field->setName("jid");
firstItem.push_back(field);
- field = boost::make_shared<FormField>(FormField::ListSingleType, "male");
+ field = std::make_shared<FormField>(FormField::ListSingleType, "male");
field->setName("x-gender");
firstItem.push_back(field);
Form::FormItem secondItem;
- field = boost::make_shared<FormField>(FormField::TextSingleType, "Romeo");
+ field = std::make_shared<FormField>(FormField::TextSingleType, "Romeo");
field->setName("first");
secondItem.push_back(field);
- field = boost::make_shared<FormField>(FormField::TextSingleType, "Montague");
+ field = std::make_shared<FormField>(FormField::TextSingleType, "Montague");
field->setName("last");
secondItem.push_back(field);
- field = boost::make_shared<FormField>(FormField::TextSingleType, "romeo@montague.net");
+ field = std::make_shared<FormField>(FormField::TextSingleType, "romeo@montague.net");
field->setName("jid");
secondItem.push_back(field);
- field = boost::make_shared<FormField>(FormField::ListSingleType, "male");
+ field = std::make_shared<FormField>(FormField::ListSingleType, "male");
field->setName("x-gender");
secondItem.push_back(field);
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelSerializerTest.cpp
index db482ff..6b65fd4 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelSerializerTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -20,7 +20,7 @@ class SecurityLabelSerializerTest : public CppUnit::TestFixture {
public:
void testSerialize() {
SecurityLabelSerializer testling;
- boost::shared_ptr<SecurityLabel> securityLabel(new SecurityLabel());
+ std::shared_ptr<SecurityLabel> securityLabel(new SecurityLabel());
securityLabel->setDisplayMarking("SECRET");
securityLabel->setForegroundColor("black");
securityLabel->setBackgroundColor("red");
@@ -45,7 +45,7 @@ class SecurityLabelSerializerTest : public CppUnit::TestFixture {
void testSerialize_EmptyLabel() {
SecurityLabelSerializer testling;
- boost::shared_ptr<SecurityLabel> securityLabel(new SecurityLabel());
+ std::shared_ptr<SecurityLabel> securityLabel(new SecurityLabel());
securityLabel->setDisplayMarking("SECRET");
securityLabel->setLabel("");
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelsCatalogSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelsCatalogSerializerTest.cpp
index 51c98c1..c3a72a5 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelsCatalogSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelsCatalogSerializerTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -22,13 +22,13 @@ class SecurityLabelsCatalogSerializerTest : public CppUnit::TestFixture
void testSerialize() {
SecurityLabelsCatalogSerializer testling;
- boost::shared_ptr<SecurityLabelsCatalog> catalog(new SecurityLabelsCatalog());
+ std::shared_ptr<SecurityLabelsCatalog> catalog(new SecurityLabelsCatalog());
catalog->setTo(JID("example.com"));
catalog->setName("Default");
catalog->setDescription("an example set of labels");
SecurityLabelsCatalog::Item item1;
- boost::shared_ptr<SecurityLabel> securityLabel1(new SecurityLabel());
+ std::shared_ptr<SecurityLabel> securityLabel1(new SecurityLabel());
item1.setLabel(securityLabel1);
securityLabel1->setDisplayMarking("SECRET");
securityLabel1->setForegroundColor("black");
@@ -39,7 +39,7 @@ class SecurityLabelsCatalogSerializerTest : public CppUnit::TestFixture
catalog->addItem(item1);
SecurityLabelsCatalog::Item item2;
- boost::shared_ptr<SecurityLabel> securityLabel2(new SecurityLabel());
+ std::shared_ptr<SecurityLabel> securityLabel2(new SecurityLabel());
item2.setLabel(securityLabel2);
securityLabel2->setDisplayMarking("CONFIDENTIAL");
securityLabel2->setForegroundColor("black");
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/SoftwareVersionSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/SoftwareVersionSerializerTest.cpp
index 5643e1e..a20efb7 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/SoftwareVersionSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/SoftwareVersionSerializerTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -22,7 +22,7 @@ class SoftwareVersionSerializerTest : public CppUnit::TestFixture
void testSerialize() {
SoftwareVersionSerializer testling;
- boost::shared_ptr<SoftwareVersion> softwareVersion(new SoftwareVersion("Swift", "0.1", "Mac OS X"));
+ std::shared_ptr<SoftwareVersion> softwareVersion(new SoftwareVersion("Swift", "0.1", "Mac OS X"));
CPPUNIT_ASSERT_EQUAL(std::string("<query xmlns=\"jabber:iq:version\"><name>Swift</name><version>0.1</version><os>Mac OS X</os></query>"), testling.serialize(softwareVersion));
}
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/StatusSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/StatusSerializerTest.cpp
index c8c2156..03a3ef5 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/StatusSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/StatusSerializerTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -22,7 +22,7 @@ class StatusSerializerTest : public CppUnit::TestFixture
void testSerialize() {
StatusSerializer testling;
- boost::shared_ptr<Status> status(new Status("I am away"));
+ std::shared_ptr<Status> status(new Status("I am away"));
CPPUNIT_ASSERT_EQUAL(std::string("<status>I am away</status>"), testling.serialize(status));
}
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/StatusShowSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/StatusShowSerializerTest.cpp
index 9fda49e..eb3b221 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/StatusShowSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/StatusShowSerializerTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -26,37 +26,37 @@ class StatusShowSerializerTest : public CppUnit::TestFixture
void testSerialize_Online() {
StatusShowSerializer testling;
- boost::shared_ptr<StatusShow> statusShow(new StatusShow(StatusShow::Online));
+ std::shared_ptr<StatusShow> statusShow(new StatusShow(StatusShow::Online));
CPPUNIT_ASSERT_EQUAL(std::string(""), testling.serialize(statusShow));
}
void testSerialize_Away() {
StatusShowSerializer testling;
- boost::shared_ptr<StatusShow> statusShow(new StatusShow(StatusShow::Away));
+ std::shared_ptr<StatusShow> statusShow(new StatusShow(StatusShow::Away));
CPPUNIT_ASSERT_EQUAL(std::string("<show>away</show>"), testling.serialize(statusShow));
}
void testSerialize_FFC() {
StatusShowSerializer testling;
- boost::shared_ptr<StatusShow> statusShow(new StatusShow(StatusShow::FFC));
+ std::shared_ptr<StatusShow> statusShow(new StatusShow(StatusShow::FFC));
CPPUNIT_ASSERT_EQUAL(std::string("<show>chat</show>"), testling.serialize(statusShow));
}
void testSerialize_XA() {
StatusShowSerializer testling;
- boost::shared_ptr<StatusShow> statusShow(new StatusShow(StatusShow::XA));
+ std::shared_ptr<StatusShow> statusShow(new StatusShow(StatusShow::XA));
CPPUNIT_ASSERT_EQUAL(std::string("<show>xa</show>"), testling.serialize(statusShow));
}
void testSerialize_DND() {
StatusShowSerializer testling;
- boost::shared_ptr<StatusShow> statusShow(new StatusShow(StatusShow::DND));
+ std::shared_ptr<StatusShow> statusShow(new StatusShow(StatusShow::DND));
CPPUNIT_ASSERT_EQUAL(std::string("<show>dnd</show>"), testling.serialize(statusShow));
}
void testSerialize_None() {
StatusShowSerializer testling;
- boost::shared_ptr<StatusShow> statusShow(new StatusShow(StatusShow::None));
+ std::shared_ptr<StatusShow> statusShow(new StatusShow(StatusShow::None));
CPPUNIT_ASSERT_EQUAL(std::string(""), testling.serialize(statusShow));
}
};
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/StorageSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/StorageSerializerTest.cpp
index e98ee3a..33c63cb 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/StorageSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/StorageSerializerTest.cpp
@@ -23,7 +23,7 @@ class StorageSerializerTest : public CppUnit::TestFixture {
void testSerialize() {
PayloadsSerializer serializer;
- boost::shared_ptr<Storage> storage(new Storage());
+ std::shared_ptr<Storage> storage(new Storage());
Storage::Room room;
room.name = "Council of Oberon";
room.autoJoin = true;
@@ -51,7 +51,7 @@ class StorageSerializerTest : public CppUnit::TestFixture {
void testSerialize_NoNickOrPassword() {
PayloadsSerializer serializer;
- boost::shared_ptr<Storage> storage(new Storage());
+ std::shared_ptr<Storage> storage(new Storage());
Storage::Room room;
room.name = "Council of Oberon";
room.autoJoin = true;
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/StreamInitiationSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/StreamInitiationSerializerTest.cpp
index ada65a9..a38295c 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/StreamInitiationSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/StreamInitiationSerializerTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -20,7 +20,7 @@ class StreamInitiationSerializerTest : public CppUnit::TestFixture{
public:
void testSerialize_Request() {
StreamInitiationSerializer testling;
- boost::shared_ptr<StreamInitiation> streamInitiation(new StreamInitiation());
+ std::shared_ptr<StreamInitiation> streamInitiation(new StreamInitiation());
StreamInitiationFileInfo fileInfo("test.txt", "This is info about the file.", 1022);
streamInitiation->setID("a0");
streamInitiation->setFileInfo(fileInfo);
@@ -48,7 +48,7 @@ class StreamInitiationSerializerTest : public CppUnit::TestFixture{
void testSerialize_Response() {
StreamInitiationSerializer testling;
- boost::shared_ptr<StreamInitiation> streamInitiation(new StreamInitiation());
+ std::shared_ptr<StreamInitiation> streamInitiation(new StreamInitiation());
streamInitiation->setRequestedMethod("http://jabber.org/protocol/bytestreams");
CPPUNIT_ASSERT_EQUAL(std::string(
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/UserLocationSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/UserLocationSerializerTest.cpp
index 3aed450..4c2121f 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/UserLocationSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/UserLocationSerializerTest.cpp
@@ -10,7 +10,7 @@
* See the COPYING file for more information.
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -31,7 +31,7 @@ class UserLocationSerializerTest : public CppUnit::TestFixture {
public:
void testSerialize_withAllVariablesSet() {
UserLocationSerializer testling(&serializers);
- boost::shared_ptr<UserLocation> userLocation(new UserLocation());
+ std::shared_ptr<UserLocation> userLocation(new UserLocation());
userLocation->setArea(boost::optional<std::string>("Barbaric"));
userLocation->setAltitude(5.75F);
userLocation->setLocality(boost::optional<std::string>("Near"));
@@ -70,7 +70,7 @@ class UserLocationSerializerTest : public CppUnit::TestFixture {
void testSerialize_withSomeVariablesSet() {
UserLocationSerializer testling(&serializers);
- boost::shared_ptr<UserLocation> userLocation(new UserLocation());
+ std::shared_ptr<UserLocation> userLocation(new UserLocation());
userLocation->setArea(boost::optional<std::string>("Barbaric"));
userLocation->setAltitude(5.75F);
userLocation->setLocality(boost::optional<std::string>("Near"));
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/UserTuneSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/UserTuneSerializerTest.cpp
index 50f2a54..df79f0d 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/UserTuneSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/UserTuneSerializerTest.cpp
@@ -10,7 +10,7 @@
* See the COPYING file for more information.
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -31,7 +31,7 @@ class UserTuneSerializerTest : public CppUnit::TestFixture {
public:
void testSerialize_withAllVariablesSet() {
UserTuneSerializer testling(&serializers);
- boost::shared_ptr<UserTune> userTune(new UserTune());
+ std::shared_ptr<UserTune> userTune(new UserTune());
userTune->setRating(5);
userTune->setTitle(boost::optional<std::string>("Minion"));
userTune->setTrack(boost::optional<std::string>("Yellow"));
@@ -49,7 +49,7 @@ class UserTuneSerializerTest : public CppUnit::TestFixture {
void testSerialize_withSomeVariablesSet() {
UserTuneSerializer testling(&serializers);
- boost::shared_ptr<UserTune> userTune(new UserTune());
+ std::shared_ptr<UserTune> userTune(new UserTune());
userTune->setTitle(boost::optional<std::string>("Minion"));
userTune->setTrack(boost::optional<std::string>("Yellow"));
userTune->setArtist(boost::optional<std::string>("Ice"));
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/VCardSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/VCardSerializerTest.cpp
index c4a8156..49402ec 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/VCardSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/VCardSerializerTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -20,7 +20,7 @@ class VCardSerializerTest : public CppUnit::TestFixture
public:
void testSerialize() {
VCardSerializer testling;
- boost::shared_ptr<VCard> vcard(new VCard());
+ std::shared_ptr<VCard> vcard(new VCard());
vcard->setVersion("2.0");
vcard->setFullName("Alice In Wonderland");
vcard->setPrefix("Mrs");
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/VCardUpdateSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/VCardUpdateSerializerTest.cpp
index ed0500a..e3fc5ff 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/VCardUpdateSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/VCardUpdateSerializerTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -22,7 +22,7 @@ class VCardUpdateSerializerTest : public CppUnit::TestFixture
void testSerialize() {
VCardUpdateSerializer testling;
- boost::shared_ptr<VCardUpdate> update(new VCardUpdate());
+ std::shared_ptr<VCardUpdate> update(new VCardUpdate());
update->setPhotoHash("sha1-hash-of-image");
std::string expectedResult =