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 /Swift/Controllers/Chat/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 'Swift/Controllers/Chat/UnitTest')
-rw-r--r--Swift/Controllers/Chat/UnitTest/ChatMessageParserTest.cpp28
-rw-r--r--Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp126
-rw-r--r--Swift/Controllers/Chat/UnitTest/MUCControllerTest.cpp84
3 files changed, 119 insertions, 119 deletions
diff --git a/Swift/Controllers/Chat/UnitTest/ChatMessageParserTest.cpp b/Swift/Controllers/Chat/UnitTest/ChatMessageParserTest.cpp
index 9ed8bf4..bc72b33 100644
--- a/Swift/Controllers/Chat/UnitTest/ChatMessageParserTest.cpp
+++ b/Swift/Controllers/Chat/UnitTest/ChatMessageParserTest.cpp
@@ -38,12 +38,12 @@ public:
}
void assertText(const ChatWindow::ChatMessage& result, size_t index, const std::string& text) {
- boost::shared_ptr<ChatWindow::ChatTextMessagePart> part = boost::dynamic_pointer_cast<ChatWindow::ChatTextMessagePart>(result.getParts()[index]);
+ std::shared_ptr<ChatWindow::ChatTextMessagePart> part = std::dynamic_pointer_cast<ChatWindow::ChatTextMessagePart>(result.getParts()[index]);
CPPUNIT_ASSERT_EQUAL(text, part->text);
}
void assertEmoticon(const ChatWindow::ChatMessage& result, size_t index, const std::string& text, const std::string& path) {
- boost::shared_ptr<ChatWindow::ChatEmoticonMessagePart> part = boost::dynamic_pointer_cast<ChatWindow::ChatEmoticonMessagePart>(result.getParts()[index]);
+ std::shared_ptr<ChatWindow::ChatEmoticonMessagePart> part = std::dynamic_pointer_cast<ChatWindow::ChatEmoticonMessagePart>(result.getParts()[index]);
CPPUNIT_ASSERT(!!part);
CPPUNIT_ASSERT_EQUAL(text, part->alternativeText);
CPPUNIT_ASSERT_EQUAL(path, part->imagePath);
@@ -51,13 +51,13 @@ public:
#define assertHighlight(RESULT, INDEX, TEXT, EXPECTED_HIGHLIGHT) \
{ \
- boost::shared_ptr<ChatWindow::ChatHighlightingMessagePart> part = boost::dynamic_pointer_cast<ChatWindow::ChatHighlightingMessagePart>(RESULT.getParts()[INDEX]); \
+ std::shared_ptr<ChatWindow::ChatHighlightingMessagePart> part = std::dynamic_pointer_cast<ChatWindow::ChatHighlightingMessagePart>(RESULT.getParts()[INDEX]); \
CPPUNIT_ASSERT_EQUAL(std::string(TEXT), part->text); \
CPPUNIT_ASSERT(EXPECTED_HIGHLIGHT == part->action); \
}
void assertURL(const ChatWindow::ChatMessage& result, size_t index, const std::string& text) {
- boost::shared_ptr<ChatWindow::ChatURIMessagePart> part = boost::dynamic_pointer_cast<ChatWindow::ChatURIMessagePart>(result.getParts()[index]);
+ std::shared_ptr<ChatWindow::ChatURIMessagePart> part = std::dynamic_pointer_cast<ChatWindow::ChatURIMessagePart>(result.getParts()[index]);
CPPUNIT_ASSERT_EQUAL(text, part->target);
}
@@ -76,14 +76,14 @@ public:
static const HighlightRulesListPtr ruleListFromKeyword(const std::string& keyword, bool matchCase, bool matchWholeWord)
{
- boost::shared_ptr<HighlightManager::HighlightRulesList> list = boost::make_shared<HighlightManager::HighlightRulesList>();
+ std::shared_ptr<HighlightManager::HighlightRulesList> list = std::make_shared<HighlightManager::HighlightRulesList>();
list->addRule(ruleFromKeyword(keyword, matchCase, matchWholeWord));
return list;
}
static const HighlightRulesListPtr ruleListFromKeywords(const HighlightRule &rule1, const HighlightRule &rule2)
{
- boost::shared_ptr<HighlightManager::HighlightRulesList> list = boost::make_shared<HighlightManager::HighlightRulesList>();
+ std::shared_ptr<HighlightManager::HighlightRulesList> list = std::make_shared<HighlightManager::HighlightRulesList>();
list->addRule(rule1);
list->addRule(rule2);
return list;
@@ -99,14 +99,14 @@ public:
if (withHighlightColour) {
rule.getAction().setTextBackground("white");
}
- boost::shared_ptr<HighlightManager::HighlightRulesList> list = boost::make_shared<HighlightManager::HighlightRulesList>();
+ std::shared_ptr<HighlightManager::HighlightRulesList> list = std::make_shared<HighlightManager::HighlightRulesList>();
list->addRule(rule);
return list;
}
void testFullBody() {
const std::string no_special_message = "a message with no special content";
- ChatMessageParser testling(emoticons_, boost::make_shared<HighlightManager::HighlightRulesList>());
+ ChatMessageParser testling(emoticons_, std::make_shared<HighlightManager::HighlightRulesList>());
ChatWindow::ChatMessage result = testling.parseMessageBody(no_special_message);
assertText(result, 0, no_special_message);
@@ -221,7 +221,7 @@ public:
}
void testOneEmoticon() {
- ChatMessageParser testling(emoticons_, boost::make_shared<HighlightManager::HighlightRulesList>());
+ ChatMessageParser testling(emoticons_, std::make_shared<HighlightManager::HighlightRulesList>());
ChatWindow::ChatMessage result = testling.parseMessageBody(" :) ");
assertText(result, 0, " ");
assertEmoticon(result, 1, smile1_, smile1Path_);
@@ -230,26 +230,26 @@ public:
void testBareEmoticon() {
- ChatMessageParser testling(emoticons_, boost::make_shared<HighlightManager::HighlightRulesList>());
+ ChatMessageParser testling(emoticons_, std::make_shared<HighlightManager::HighlightRulesList>());
ChatWindow::ChatMessage result = testling.parseMessageBody(":)");
assertEmoticon(result, 0, smile1_, smile1Path_);
}
void testHiddenEmoticon() {
- ChatMessageParser testling(emoticons_, boost::make_shared<HighlightManager::HighlightRulesList>());
+ ChatMessageParser testling(emoticons_, std::make_shared<HighlightManager::HighlightRulesList>());
ChatWindow::ChatMessage result = testling.parseMessageBody("b:)a");
assertText(result, 0, "b:)a");
}
void testEndlineEmoticon() {
- ChatMessageParser testling(emoticons_, boost::make_shared<HighlightManager::HighlightRulesList>());
+ ChatMessageParser testling(emoticons_, std::make_shared<HighlightManager::HighlightRulesList>());
ChatWindow::ChatMessage result = testling.parseMessageBody("Lazy:)");
assertText(result, 0, "Lazy");
assertEmoticon(result, 1, smile1_, smile1Path_);
}
void testBoundedEmoticons() {
- ChatMessageParser testling(emoticons_, boost::make_shared<HighlightManager::HighlightRulesList>());
+ ChatMessageParser testling(emoticons_, std::make_shared<HighlightManager::HighlightRulesList>());
ChatWindow::ChatMessage result = testling.parseMessageBody(":)Lazy:(");
assertEmoticon(result, 0, smile1_, smile1Path_);
assertText(result, 1, "Lazy");
@@ -257,7 +257,7 @@ public:
}
void testEmoticonParenthesis() {
- ChatMessageParser testling(emoticons_, boost::make_shared<HighlightManager::HighlightRulesList>());
+ ChatMessageParser testling(emoticons_, std::make_shared<HighlightManager::HighlightRulesList>());
ChatWindow::ChatMessage result = testling.parseMessageBody("(Like this :))");
assertText(result, 0, "(Like this ");
assertEmoticon(result, 1, smile1_, smile1Path_);
diff --git a/Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp b/Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp
index 92a8ca0..90600dc 100644
--- a/Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp
+++ b/Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp
@@ -97,7 +97,7 @@ public:
mucRegistry_ = new MUCRegistry();
nickResolver_ = new NickResolver(jid_.toBare(), xmppRoster_, nullptr, mucRegistry_);
presenceOracle_ = new PresenceOracle(stanzaChannel_, xmppRoster_);
- serverDiscoInfo_ = boost::make_shared<DiscoInfo>();
+ serverDiscoInfo_ = std::make_shared<DiscoInfo>();
presenceSender_ = new StanzaChannelPresenceSender(stanzaChannel_);
directedPresenceSender_ = new DirectedPresenceSender(presenceSender_);
mucManager_ = new MUCManager(stanzaChannel_, iqRouter_, directedPresenceSender_, mucRegistry_);
@@ -167,7 +167,7 @@ public:
MockChatWindow* window = new MockChatWindow();
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(messageJID, uiEventStream_).Return(window);
- boost::shared_ptr<Message> message(new Message());
+ std::shared_ptr<Message> message(new Message());
message->setFrom(messageJID);
std::string body("This is a legible message. >HEH@)oeueu");
message->setBody(body);
@@ -181,7 +181,7 @@ public:
MockChatWindow* window1 = new MockChatWindow();//mocks_->InterfaceMock<ChatWindow>();
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(messageJID1, uiEventStream_).Return(window1);
- boost::shared_ptr<Message> message1(new Message());
+ std::shared_ptr<Message> message1(new Message());
message1->setFrom(messageJID1);
std::string body1("This is a legible message. >HEH@)oeueu");
message1->setBody(body1);
@@ -193,7 +193,7 @@ public:
//MockChatWindow* window2 = new MockChatWindow();//mocks_->InterfaceMock<ChatWindow>();
//mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(messageJID2, uiEventStream_).Return(window2);
- boost::shared_ptr<Message> message2(new Message());
+ std::shared_ptr<Message> message2(new Message());
message2->setFrom(messageJID2);
std::string body2("This is a legible message. .cmaulm.chul");
message2->setBody(body2);
@@ -207,7 +207,7 @@ public:
ChatWindow* window = new MockChatWindow();//mocks_->InterfaceMock<ChatWindow>();
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(JID(messageJIDString), uiEventStream_).Return(window);
- uiEventStream_->send(boost::shared_ptr<UIEvent>(new RequestChatUIEvent(JID(messageJIDString))));
+ uiEventStream_->send(std::make_shared<RequestChatUIEvent>(JID(messageJIDString)));
}
@@ -217,9 +217,9 @@ public:
MockChatWindow* window = new MockChatWindow();//mocks_->InterfaceMock<ChatWindow>();
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(JID(bareJIDString), uiEventStream_).Return(window);
- uiEventStream_->send(boost::shared_ptr<UIEvent>(new RequestChatUIEvent(JID(bareJIDString))));
+ uiEventStream_->send(std::make_shared<RequestChatUIEvent>(JID(bareJIDString)));
- boost::shared_ptr<Message> message(new Message());
+ std::shared_ptr<Message> message(new Message());
message->setFrom(JID(fullJIDString));
std::string body("This is a legible message. mjuga3089gm8G(*>M)@*(");
message->setBody(body);
@@ -231,13 +231,13 @@ public:
std::string messageJIDString1("testling1@test.com");
ChatWindow* window1 = new MockChatWindow();//mocks_->InterfaceMock<ChatWindow>();
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(JID(messageJIDString1), uiEventStream_).Return(window1);
- uiEventStream_->send(boost::shared_ptr<UIEvent>(new RequestChatUIEvent(JID(messageJIDString1))));
+ uiEventStream_->send(std::make_shared<RequestChatUIEvent>(JID(messageJIDString1)));
std::string messageJIDString2("testling2@test.com");
ChatWindow* window2 = new MockChatWindow();//mocks_->InterfaceMock<ChatWindow>();
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(JID(messageJIDString2), uiEventStream_).Return(window2);
- uiEventStream_->send(boost::shared_ptr<UIEvent>(new RequestChatUIEvent(JID(messageJIDString2))));
+ uiEventStream_->send(std::make_shared<RequestChatUIEvent>(JID(messageJIDString2)));
}
/** Complete cycle.
@@ -253,23 +253,23 @@ public:
MockChatWindow* window = new MockChatWindow();//mocks_->InterfaceMock<ChatWindow>();
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(JID(bareJIDString), uiEventStream_).Return(window);
- uiEventStream_->send(boost::shared_ptr<UIEvent>(new RequestChatUIEvent(JID(bareJIDString))));
+ uiEventStream_->send(std::make_shared<RequestChatUIEvent>(JID(bareJIDString)));
- boost::shared_ptr<Message> message1(new Message());
+ std::shared_ptr<Message> message1(new Message());
message1->setFrom(JID(fullJIDString1));
std::string messageBody1("This is a legible message.");
message1->setBody(messageBody1);
manager_->handleIncomingMessage(message1);
CPPUNIT_ASSERT_EQUAL(messageBody1, window->lastMessageBody_);
- boost::shared_ptr<Presence> jid1Online(new Presence());
+ std::shared_ptr<Presence> jid1Online(new Presence());
jid1Online->setFrom(JID(fullJIDString1));
- boost::shared_ptr<Presence> jid1Offline(new Presence());
+ std::shared_ptr<Presence> jid1Offline(new Presence());
jid1Offline->setFrom(JID(fullJIDString1));
jid1Offline->setType(Presence::Unavailable);
presenceOracle_->onPresenceChange(jid1Offline);
- boost::shared_ptr<Message> message2(new Message());
+ std::shared_ptr<Message> message2(new Message());
message2->setFrom(JID(fullJIDString2));
std::string messageBody2("This is another legible message.");
message2->setBody(messageBody2);
@@ -284,29 +284,29 @@ public:
JID muc("testling@test.com");
ChatWindow* mucWindow = new MockChatWindow();
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(muc, uiEventStream_).Return(mucWindow);
- uiEventStream_->send(boost::make_shared<JoinMUCUIEvent>(muc, std::string("nick")));
+ uiEventStream_->send(std::make_shared<JoinMUCUIEvent>(muc, std::string("nick")));
std::string messageJIDString1("testling@test.com/1");
ChatWindow* window1 = new MockChatWindow();//mocks_->InterfaceMock<ChatWindow>();
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(JID(messageJIDString1), uiEventStream_).Return(window1);
- uiEventStream_->send(boost::shared_ptr<UIEvent>(new RequestChatUIEvent(JID(messageJIDString1))));
+ uiEventStream_->send(std::make_shared<RequestChatUIEvent>(JID(messageJIDString1)));
std::string messageJIDString2("testling@test.com/2");
ChatWindow* window2 = new MockChatWindow();//mocks_->InterfaceMock<ChatWindow>();
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(JID(messageJIDString2), uiEventStream_).Return(window2);
- uiEventStream_->send(boost::shared_ptr<UIEvent>(new RequestChatUIEvent(JID(messageJIDString2))));
+ uiEventStream_->send(std::make_shared<RequestChatUIEvent>(JID(messageJIDString2)));
std::string messageJIDString3("testling@test.com/3");
ChatWindow* window3 = new MockChatWindow();//mocks_->InterfaceMock<ChatWindow>();
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(JID(messageJIDString3), uiEventStream_).Return(window3);
- uiEventStream_->send(boost::shared_ptr<UIEvent>(new RequestChatUIEvent(JID(messageJIDString3))));
+ uiEventStream_->send(std::make_shared<RequestChatUIEvent>(JID(messageJIDString3)));
/* Refetch an earlier window */
/* We do not expect a new window to be created */
- uiEventStream_->send(boost::shared_ptr<UIEvent>(new RequestChatUIEvent(JID(messageJIDString1))));
+ uiEventStream_->send(std::make_shared<RequestChatUIEvent>(JID(messageJIDString1)));
}
@@ -325,7 +325,7 @@ public:
MockChatWindow* window1 = new MockChatWindow();//mocks_->InterfaceMock<ChatWindow>();
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(messageJID1, uiEventStream_).Return(window1);
- boost::shared_ptr<Message> message1(new Message());
+ std::shared_ptr<Message> message1(new Message());
message1->setFrom(messageJID1);
message1->setBody("This is a legible message1.");
manager_->handleIncomingMessage(message1);
@@ -335,35 +335,35 @@ public:
//MockChatWindow* window2 = new MockChatWindow();//mocks_->InterfaceMock<ChatWindow>();
//mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(messageJID2, uiEventStream_).Return(window2);
- boost::shared_ptr<Message> message2(new Message());
+ std::shared_ptr<Message> message2(new Message());
message2->setFrom(messageJID2);
message2->setBody("This is a legible message2.");
manager_->handleIncomingMessage(message2);
- boost::shared_ptr<Presence> jid1Online(new Presence());
+ std::shared_ptr<Presence> jid1Online(new Presence());
jid1Online->setFrom(JID(messageJID1));
- boost::shared_ptr<Presence> jid1Offline(new Presence());
+ std::shared_ptr<Presence> jid1Offline(new Presence());
jid1Offline->setFrom(JID(messageJID1));
jid1Offline->setType(Presence::Unavailable);
presenceOracle_->onPresenceChange(jid1Offline);
- boost::shared_ptr<Presence> jid2Online(new Presence());
+ std::shared_ptr<Presence> jid2Online(new Presence());
jid2Online->setFrom(JID(messageJID2));
- boost::shared_ptr<Presence> jid2Offline(new Presence());
+ std::shared_ptr<Presence> jid2Offline(new Presence());
jid2Offline->setFrom(JID(messageJID2));
jid2Offline->setType(Presence::Unavailable);
presenceOracle_->onPresenceChange(jid2Offline);
JID messageJID3("testling@test.com/resource3");
- boost::shared_ptr<Message> message3(new Message());
+ std::shared_ptr<Message> message3(new Message());
message3->setFrom(messageJID3);
std::string body3("This is a legible message3.");
message3->setBody(body3);
manager_->handleIncomingMessage(message3);
CPPUNIT_ASSERT_EQUAL(body3, window1->lastMessageBody_);
- boost::shared_ptr<Message> message2b(new Message());
+ std::shared_ptr<Message> message2b(new Message());
message2b->setFrom(messageJID2);
std::string body2b("This is a legible message2b.");
message2b->setBody(body2b);
@@ -382,7 +382,7 @@ public:
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(messageJID, uiEventStream_).Return(window);
settings_->storeSetting(SettingConstants::REQUEST_DELIVERYRECEIPTS, true);
- boost::shared_ptr<Message> message = makeDeliveryReceiptTestMessage(messageJID, "1");
+ std::shared_ptr<Message> message = makeDeliveryReceiptTestMessage(messageJID, "1");
manager_->handleIncomingMessage(message);
Stanza::ref stanzaContactOnRoster = stanzaChannel_->getStanzaAtIndex<Stanza>(0);
CPPUNIT_ASSERT_EQUAL(st(1), stanzaChannel_->sentStanzas.size());
@@ -405,7 +405,7 @@ public:
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(messageJID, uiEventStream_).Return(window);
settings_->storeSetting(SettingConstants::REQUEST_DELIVERYRECEIPTS, true);
- boost::shared_ptr<Message> message = makeDeliveryReceiptTestMessage(messageJID, "1");
+ std::shared_ptr<Message> message = makeDeliveryReceiptTestMessage(messageJID, "1");
manager_->handleIncomingMessage(message);
CPPUNIT_ASSERT_EQUAL(st(0), stanzaChannel_->sentStanzas.size());
@@ -447,16 +447,16 @@ public:
MockChatWindow* window = new MockChatWindow();
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(sender, uiEventStream_).Return(window);
- uiEventStream_->send(boost::make_shared<RequestChatUIEvent>(sender));
+ uiEventStream_->send(std::make_shared<RequestChatUIEvent>(sender));
foreach(const JID& senderJID, senderResource) {
// The sender supports delivery receipts.
- DiscoInfo::ref disco = boost::make_shared<DiscoInfo>();
+ DiscoInfo::ref disco = std::make_shared<DiscoInfo>();
disco->addFeature(DiscoInfo::MessageDeliveryReceiptsFeature);
entityCapsProvider_->caps[senderJID] = disco;
// The sender is online.
- Presence::ref senderPresence = boost::make_shared<Presence>();
+ Presence::ref senderPresence = std::make_shared<Presence>();
senderPresence->setFrom(senderJID);
senderPresence->setTo(ownJID);
stanzaChannel_->onPresenceReceived(senderPresence);
@@ -473,11 +473,11 @@ public:
// Two resources respond with message receipts.
foreach(const JID& senderJID, senderResource) {
- Message::ref receiptReply = boost::make_shared<Message>();
+ Message::ref receiptReply = std::make_shared<Message>();
receiptReply->setFrom(senderJID);
receiptReply->setTo(ownJID);
- boost::shared_ptr<DeliveryReceipt> receipt = boost::make_shared<DeliveryReceipt>();
+ std::shared_ptr<DeliveryReceipt> receipt = std::make_shared<DeliveryReceipt>();
receipt->setReceivedID(stanzaChannel_->getStanzaAtIndex<Message>(0)->getID());
receiptReply->addPayload(receipt);
manager_->handleIncomingMessage(receiptReply);
@@ -492,18 +492,18 @@ public:
// Two resources respond with message receipts.
foreach(const JID& senderJID, senderResource) {
- Message::ref receiptReply = boost::make_shared<Message>();
+ Message::ref receiptReply = std::make_shared<Message>();
receiptReply->setFrom(senderJID);
receiptReply->setTo(ownJID);
- boost::shared_ptr<DeliveryReceipt> receipt = boost::make_shared<DeliveryReceipt>();
+ std::shared_ptr<DeliveryReceipt> receipt = std::make_shared<DeliveryReceipt>();
receipt->setReceivedID(stanzaChannel_->getStanzaAtIndex<Message>(1)->getID());
receiptReply->addPayload(receipt);
manager_->handleIncomingMessage(receiptReply);
}
// Reply with a message including a body text.
- Message::ref reply = boost::make_shared<Message>();
+ Message::ref reply = std::make_shared<Message>();
reply->setFrom(senderResource[0]);
reply->setTo(ownJID);
reply->setBody("fine.");
@@ -517,11 +517,11 @@ public:
CPPUNIT_ASSERT(stanzaChannel_->getStanzaAtIndex<Message>(2)->getPayload<DeliveryReceiptRequest>());
// Receive random receipt from second sender resource.
- reply = boost::make_shared<Message>();
+ reply = std::make_shared<Message>();
reply->setFrom(senderResource[1]);
reply->setTo(ownJID);
- boost::shared_ptr<DeliveryReceipt> receipt = boost::make_shared<DeliveryReceipt>();
+ std::shared_ptr<DeliveryReceipt> receipt = std::make_shared<DeliveryReceipt>();
receipt->setReceivedID(stanzaChannel_->getStanzaAtIndex<Message>(2)->getID());
reply->addPayload(receipt);
manager_->handleIncomingMessage(reply);
@@ -534,7 +534,7 @@ public:
CPPUNIT_ASSERT(stanzaChannel_->getStanzaAtIndex<Message>(3)->getPayload<DeliveryReceiptRequest>());
// Reply with a message including a body text from second resource.
- reply = boost::make_shared<Message>();
+ reply = std::make_shared<Message>();
reply->setFrom(senderResource[1]);
reply->setTo(ownJID);
reply->setBody("nothing.");
@@ -562,16 +562,16 @@ public:
MockChatWindow* window = new MockChatWindow();
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(sender, uiEventStream_).Return(window);
- uiEventStream_->send(boost::make_shared<RequestChatUIEvent>(sender));
+ uiEventStream_->send(std::make_shared<RequestChatUIEvent>(sender));
foreach(const JID& senderJID, senderResource) {
// The sender supports delivery receipts.
- DiscoInfo::ref disco = boost::make_shared<DiscoInfo>();
+ DiscoInfo::ref disco = std::make_shared<DiscoInfo>();
disco->addFeature(DiscoInfo::MessageDeliveryReceiptsFeature);
entityCapsProvider_->caps[senderJID] = disco;
// The sender is online.
- Presence::ref senderPresence = boost::make_shared<Presence>();
+ Presence::ref senderPresence = std::make_shared<Presence>();
senderPresence->setFrom(senderJID);
senderPresence->setTo(ownJID);
stanzaChannel_->onPresenceReceived(senderPresence);
@@ -588,11 +588,11 @@ public:
// Two resources respond with message receipts.
foreach(const JID& senderJID, senderResource) {
- Message::ref reply = boost::make_shared<Message>();
+ Message::ref reply = std::make_shared<Message>();
reply->setFrom(senderJID);
reply->setTo(ownJID);
- boost::shared_ptr<ChatState> csn = boost::make_shared<ChatState>();
+ std::shared_ptr<ChatState> csn = std::make_shared<ChatState>();
csn->setChatState(ChatState::Active);
reply->addPayload(csn);
manager_->handleIncomingMessage(reply);
@@ -607,22 +607,22 @@ public:
// Two resources respond with message receipts.
foreach(const JID& senderJID, senderResource) {
- Message::ref receiptReply = boost::make_shared<Message>();
+ Message::ref receiptReply = std::make_shared<Message>();
receiptReply->setFrom(senderJID);
receiptReply->setTo(ownJID);
- boost::shared_ptr<DeliveryReceipt> receipt = boost::make_shared<DeliveryReceipt>();
+ std::shared_ptr<DeliveryReceipt> receipt = std::make_shared<DeliveryReceipt>();
receipt->setReceivedID(stanzaChannel_->getStanzaAtIndex<Message>(1)->getID());
receiptReply->addPayload(receipt);
manager_->handleIncomingMessage(receiptReply);
}
// Reply with a message including a CSN.
- Message::ref reply = boost::make_shared<Message>();
+ Message::ref reply = std::make_shared<Message>();
reply->setFrom(senderResource[0]);
reply->setTo(ownJID);
- boost::shared_ptr<ChatState> csn = boost::make_shared<ChatState>();
+ std::shared_ptr<ChatState> csn = std::make_shared<ChatState>();
csn->setChatState(ChatState::Composing);
reply->addPayload(csn);
manager_->handleIncomingMessage(reply);
@@ -635,11 +635,11 @@ public:
CPPUNIT_ASSERT(stanzaChannel_->getStanzaAtIndex<Message>(2)->getPayload<DeliveryReceiptRequest>());
// Reply with a message including a CSN from the other resource.
- reply = boost::make_shared<Message>();
+ reply = std::make_shared<Message>();
reply->setFrom(senderResource[1]);
reply->setTo(ownJID);
- csn = boost::make_shared<ChatState>();
+ csn = std::make_shared<ChatState>();
csn->setChatState(ChatState::Composing);
reply->addPayload(csn);
manager_->handleIncomingMessage(reply);
@@ -661,7 +661,7 @@ public:
MockChatWindow* window = new MockChatWindow();
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(participantA, uiEventStream_).Return(window);
- uiEventStream_->send(boost::shared_ptr<UIEvent>(new RequestChatUIEvent(JID(participantA))));
+ uiEventStream_->send(std::make_shared<RequestChatUIEvent>(JID(participantA)));
Presence::ref presence = Presence::create();
presence->setFrom(participantA);
@@ -692,17 +692,17 @@ public:
MockChatWindow* window = new MockChatWindow();
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(sender, uiEventStream_).Return(window);
- uiEventStream_->send(boost::make_shared<RequestChatUIEvent>(sender));
+ uiEventStream_->send(std::make_shared<RequestChatUIEvent>(sender));
CPPUNIT_ASSERT_EQUAL(false, window->impromptuMUCSupported_);
- boost::shared_ptr<IQ> infoRequest= iqChannel_->iqs_[1];
- boost::shared_ptr<IQ> infoResponse = IQ::createResult(infoRequest->getFrom(), infoRequest->getTo(), infoRequest->getID());
+ std::shared_ptr<IQ> infoRequest= iqChannel_->iqs_[1];
+ std::shared_ptr<IQ> infoResponse = IQ::createResult(infoRequest->getFrom(), infoRequest->getTo(), infoRequest->getID());
DiscoInfo info;
info.addIdentity(DiscoInfo::Identity("Shakespearean Chat Service", "conference", "text"));
info.addFeature("http://jabber.org/protocol/muc");
- infoResponse->addPayload(boost::make_shared<DiscoInfo>(info));
+ infoResponse->addPayload(std::make_shared<DiscoInfo>(info));
iqChannel_->onIQReceived(infoResponse);
CPPUNIT_ASSERT_EQUAL(true, window->impromptuMUCSupported_);
@@ -718,7 +718,7 @@ public:
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(messageJID, uiEventStream_).Return(window);
settings_->storeSetting(SettingConstants::REQUEST_DELIVERYRECEIPTS, true);
- boost::shared_ptr<Message> message = makeDeliveryReceiptTestMessage(messageJID, "1");
+ std::shared_ptr<Message> message = makeDeliveryReceiptTestMessage(messageJID, "1");
manager_->handleIncomingMessage(message);
CPPUNIT_ASSERT_EQUAL(st(0), stanzaChannel_->sentStanzas.size());
@@ -757,7 +757,7 @@ public:
MockChatWindow* window = new MockChatWindow();
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(messageJID, uiEventStream_).Return(window);
- boost::shared_ptr<Message> message(new Message());
+ std::shared_ptr<Message> message(new Message());
message->setFrom(messageJID);
std::string body("This message should cause two sounds: Juliet and Romeo.");
message->setBody(body);
@@ -792,7 +792,7 @@ public:
MockChatWindow* window = new MockChatWindow();
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(messageJID, uiEventStream_).Return(window);
- boost::shared_ptr<Message> message(new Message());
+ std::shared_ptr<Message> message(new Message());
message->setFrom(messageJID);
std::string body("This message should cause one sound, because both actions have the same sound: Juliet and Romeo.");
message->setBody(body);
@@ -804,12 +804,12 @@ public:
}
private:
- boost::shared_ptr<Message> makeDeliveryReceiptTestMessage(const JID& from, const std::string& id) {
- boost::shared_ptr<Message> message = boost::make_shared<Message>();
+ std::shared_ptr<Message> makeDeliveryReceiptTestMessage(const JID& from, const std::string& id) {
+ std::shared_ptr<Message> message = std::make_shared<Message>();
message->setFrom(from);
message->setID(id);
message->setBody("This will cause the window to open");
- message->addPayload(boost::make_shared<DeliveryReceiptRequest>());
+ message->addPayload(std::make_shared<DeliveryReceiptRequest>());
return message;
}
@@ -836,7 +836,7 @@ private:
NickResolver* nickResolver_;
PresenceOracle* presenceOracle_;
AvatarManager* avatarManager_;
- boost::shared_ptr<DiscoInfo> serverDiscoInfo_;
+ std::shared_ptr<DiscoInfo> serverDiscoInfo_;
XMPPRosterImpl* xmppRoster_;
PresenceSender* presenceSender_;
MockRepository* mocks_;
diff --git a/Swift/Controllers/Chat/UnitTest/MUCControllerTest.cpp b/Swift/Controllers/Chat/UnitTest/MUCControllerTest.cpp
index 80dbc32..1142c98 100644
--- a/Swift/Controllers/Chat/UnitTest/MUCControllerTest.cpp
+++ b/Swift/Controllers/Chat/UnitTest/MUCControllerTest.cpp
@@ -67,7 +67,7 @@ class MUCControllerTest : public CppUnit::TestFixture {
public:
void setUp() {
- crypto_ = boost::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
+ crypto_ = std::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
self_ = JID("girl@wonderland.lit/rabbithole");
nick_ = "aLiCe";
mucJID_ = JID("teaparty@rooms.wonderland.lit");
@@ -90,9 +90,9 @@ public:
entityCapsProvider_ = new DummyEntityCapsProvider();
settings_ = new DummySettingsProvider();
highlightManager_ = new HighlightManager(settings_);
- muc_ = boost::make_shared<MockMUC>(mucJID_);
+ muc_ = std::make_shared<MockMUC>(mucJID_);
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(muc_->getJID(), uiEventStream_).Return(window_);
- chatMessageParser_ = boost::make_shared<ChatMessageParser>(std::map<std::string, std::string>(), highlightManager_->getRules(), true);
+ chatMessageParser_ = std::make_shared<ChatMessageParser>(std::map<std::string, std::string>(), highlightManager_->getRules(), true);
vcardStorage_ = new VCardMemoryStorage(crypto_.get());
vcardManager_ = new VCardManager(self_, iqRouter_, vcardStorage_);
clientBlockListManager_ = new ClientBlockListManager(iqRouter_);
@@ -204,18 +204,18 @@ public:
SecurityLabelsCatalog::Item label;
label.setSelector("Bob");
window_->label_ = label;
- boost::shared_ptr<DiscoInfo> features = boost::make_shared<DiscoInfo>();
+ std::shared_ptr<DiscoInfo> features = std::make_shared<DiscoInfo>();
features->addFeature(DiscoInfo::SecurityLabelsCatalogFeature);
controller_->setAvailableServerFeatures(features);
IQ::ref iq = iqChannel_->iqs_[iqChannel_->iqs_.size() - 1];
- SecurityLabelsCatalog::ref labelPayload = boost::make_shared<SecurityLabelsCatalog>();
+ SecurityLabelsCatalog::ref labelPayload = std::make_shared<SecurityLabelsCatalog>();
labelPayload->addItem(label);
IQ::ref result = IQ::createResult(self_, iq->getID(), labelPayload);
iqChannel_->onIQReceived(result);
std::string messageBody("agamemnon");
window_->onSendMessageRequest(messageBody, false);
- boost::shared_ptr<Stanza> rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1];
- Message::ref message = boost::dynamic_pointer_cast<Message>(rawStanza);
+ std::shared_ptr<Stanza> rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1];
+ Message::ref message = std::dynamic_pointer_cast<Message>(rawStanza);
CPPUNIT_ASSERT_EQUAL(iq->getTo(), result->getFrom());
CPPUNIT_ASSERT(window_->labelsEnabled_);
CPPUNIT_ASSERT(stanzaChannel_->isAvailable()); /* Otherwise will prevent sends. */
@@ -225,24 +225,24 @@ public:
}
void testMessageWithLabelItem() {
- boost::shared_ptr<SecurityLabel> label = boost::make_shared<SecurityLabel>();
+ std::shared_ptr<SecurityLabel> label = std::make_shared<SecurityLabel>();
label->setLabel("a");
SecurityLabelsCatalog::Item labelItem;
labelItem.setSelector("Bob");
labelItem.setLabel(label);
window_->label_ = labelItem;
- boost::shared_ptr<DiscoInfo> features = boost::make_shared<DiscoInfo>();
+ std::shared_ptr<DiscoInfo> features = std::make_shared<DiscoInfo>();
features->addFeature(DiscoInfo::SecurityLabelsCatalogFeature);
controller_->setAvailableServerFeatures(features);
IQ::ref iq = iqChannel_->iqs_[iqChannel_->iqs_.size() - 1];
- SecurityLabelsCatalog::ref labelPayload = boost::make_shared<SecurityLabelsCatalog>();
+ SecurityLabelsCatalog::ref labelPayload = std::make_shared<SecurityLabelsCatalog>();
labelPayload->addItem(labelItem);
IQ::ref result = IQ::createResult(self_, iq->getID(), labelPayload);
iqChannel_->onIQReceived(result);
std::string messageBody("agamemnon");
window_->onSendMessageRequest(messageBody, false);
- boost::shared_ptr<Stanza> rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1];
- Message::ref message = boost::dynamic_pointer_cast<Message>(rawStanza);
+ std::shared_ptr<Stanza> rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1];
+ Message::ref message = std::dynamic_pointer_cast<Message>(rawStanza);
CPPUNIT_ASSERT_EQUAL(iq->getTo(), result->getFrom());
CPPUNIT_ASSERT(window_->labelsEnabled_);
CPPUNIT_ASSERT(stanzaChannel_->isAvailable()); /* Otherwise will prevent sends. */
@@ -252,29 +252,29 @@ public:
}
void testCorrectMessageWithLabelItem() {
- boost::shared_ptr<SecurityLabel> label = boost::make_shared<SecurityLabel>();
+ std::shared_ptr<SecurityLabel> label = std::make_shared<SecurityLabel>();
label->setLabel("a");
SecurityLabelsCatalog::Item labelItem;
labelItem.setSelector("Bob");
labelItem.setLabel(label);
- boost::shared_ptr<SecurityLabel> label2 = boost::make_shared<SecurityLabel>();
+ std::shared_ptr<SecurityLabel> label2 = std::make_shared<SecurityLabel>();
label->setLabel("b");
SecurityLabelsCatalog::Item labelItem2;
labelItem2.setSelector("Charlie");
labelItem2.setLabel(label2);
window_->label_ = labelItem;
- boost::shared_ptr<DiscoInfo> features = boost::make_shared<DiscoInfo>();
+ std::shared_ptr<DiscoInfo> features = std::make_shared<DiscoInfo>();
features->addFeature(DiscoInfo::SecurityLabelsCatalogFeature);
controller_->setAvailableServerFeatures(features);
IQ::ref iq = iqChannel_->iqs_[iqChannel_->iqs_.size() - 1];
- SecurityLabelsCatalog::ref labelPayload = boost::make_shared<SecurityLabelsCatalog>();
+ SecurityLabelsCatalog::ref labelPayload = std::make_shared<SecurityLabelsCatalog>();
labelPayload->addItem(labelItem);
IQ::ref result = IQ::createResult(self_, iq->getID(), labelPayload);
iqChannel_->onIQReceived(result);
std::string messageBody("agamemnon");
window_->onSendMessageRequest(messageBody, false);
- boost::shared_ptr<Stanza> rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1];
- Message::ref message = boost::dynamic_pointer_cast<Message>(rawStanza);
+ std::shared_ptr<Stanza> rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1];
+ Message::ref message = std::dynamic_pointer_cast<Message>(rawStanza);
CPPUNIT_ASSERT_EQUAL(iq->getTo(), result->getFrom());
CPPUNIT_ASSERT(window_->labelsEnabled_);
CPPUNIT_ASSERT(stanzaChannel_->isAvailable()); /* Otherwise will prevent sends. */
@@ -284,7 +284,7 @@ public:
window_->label_ = labelItem2;
window_->onSendMessageRequest(messageBody, true);
rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1];
- message = boost::dynamic_pointer_cast<Message>(rawStanza);
+ message = std::dynamic_pointer_cast<Message>(rawStanza);
CPPUNIT_ASSERT_EQUAL(messageBody, message->getBody().get());
CPPUNIT_ASSERT_EQUAL(label, message->getPayload<SecurityLabel>());
}
@@ -406,22 +406,22 @@ public:
void testSubjectChangeCorrect() {
std::string messageBody("test message");
window_->onSendMessageRequest(messageBody, false);
- boost::shared_ptr<Stanza> rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1];
- Message::ref message = boost::dynamic_pointer_cast<Message>(rawStanza);
+ std::shared_ptr<Stanza> rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1];
+ Message::ref message = std::dynamic_pointer_cast<Message>(rawStanza);
CPPUNIT_ASSERT(stanzaChannel_->isAvailable()); /* Otherwise will prevent sends. */
CPPUNIT_ASSERT(message);
CPPUNIT_ASSERT_EQUAL(messageBody, message->getBody().get_value_or(""));
{
- Message::ref message = boost::make_shared<Message>();
+ Message::ref message = std::make_shared<Message>();
message->setType(Message::Groupchat);
message->setTo(self_);
message->setFrom(mucJID_.withResource("SomeNickname"));
message->setID(iqChannel_->getNewIQID());
message->setSubject("New Room Subject");
- controller_->handleIncomingMessage(boost::make_shared<MessageEvent>(message));
- CPPUNIT_ASSERT_EQUAL(std::string("The room subject is now: New Room Subject"), boost::dynamic_pointer_cast<ChatWindow::ChatTextMessagePart>(window_->lastAddedSystemMessage_.getParts()[0])->text);
+ controller_->handleIncomingMessage(std::make_shared<MessageEvent>(message));
+ CPPUNIT_ASSERT_EQUAL(std::string("The room subject is now: New Room Subject"), std::dynamic_pointer_cast<ChatWindow::ChatTextMessagePart>(window_->lastAddedSystemMessage_.getParts()[0])->text);
}
}
@@ -431,14 +431,14 @@ public:
void testSubjectChangeIncorrectA() {
std::string messageBody("test message");
window_->onSendMessageRequest(messageBody, false);
- boost::shared_ptr<Stanza> rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1];
- Message::ref message = boost::dynamic_pointer_cast<Message>(rawStanza);
+ std::shared_ptr<Stanza> rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1];
+ Message::ref message = std::dynamic_pointer_cast<Message>(rawStanza);
CPPUNIT_ASSERT(stanzaChannel_->isAvailable()); /* Otherwise will prevent sends. */
CPPUNIT_ASSERT(message);
CPPUNIT_ASSERT_EQUAL(messageBody, message->getBody().get_value_or(""));
{
- Message::ref message = boost::make_shared<Message>();
+ Message::ref message = std::make_shared<Message>();
message->setType(Message::Groupchat);
message->setTo(self_);
message->setFrom(mucJID_.withResource("SomeNickname"));
@@ -446,8 +446,8 @@ public:
message->setSubject("New Room Subject");
message->setBody("Some body text that prevents this stanza from being a subject change.");
- controller_->handleIncomingMessage(boost::make_shared<MessageEvent>(message));
- CPPUNIT_ASSERT_EQUAL(std::string("Trying to enter room teaparty@rooms.wonderland.lit"), boost::dynamic_pointer_cast<ChatWindow::ChatTextMessagePart>(window_->lastAddedSystemMessage_.getParts()[0])->text);
+ controller_->handleIncomingMessage(std::make_shared<MessageEvent>(message));
+ CPPUNIT_ASSERT_EQUAL(std::string("Trying to enter room teaparty@rooms.wonderland.lit"), std::dynamic_pointer_cast<ChatWindow::ChatTextMessagePart>(window_->lastAddedSystemMessage_.getParts()[0])->text);
}
}
@@ -457,23 +457,23 @@ public:
void testSubjectChangeIncorrectB() {
std::string messageBody("test message");
window_->onSendMessageRequest(messageBody, false);
- boost::shared_ptr<Stanza> rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1];
- Message::ref message = boost::dynamic_pointer_cast<Message>(rawStanza);
+ std::shared_ptr<Stanza> rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1];
+ Message::ref message = std::dynamic_pointer_cast<Message>(rawStanza);
CPPUNIT_ASSERT(stanzaChannel_->isAvailable()); /* Otherwise will prevent sends. */
CPPUNIT_ASSERT(message);
CPPUNIT_ASSERT_EQUAL(messageBody, message->getBody().get_value_or(""));
{
- Message::ref message = boost::make_shared<Message>();
+ Message::ref message = std::make_shared<Message>();
message->setType(Message::Groupchat);
message->setTo(self_);
message->setFrom(mucJID_.withResource("SomeNickname"));
message->setID(iqChannel_->getNewIQID());
message->setSubject("New Room Subject");
- message->addPayload(boost::make_shared<Thread>("Thread that prevents the subject change."));
+ message->addPayload(std::make_shared<Thread>("Thread that prevents the subject change."));
- controller_->handleIncomingMessage(boost::make_shared<MessageEvent>(message));
- CPPUNIT_ASSERT_EQUAL(std::string("Trying to enter room teaparty@rooms.wonderland.lit"), boost::dynamic_pointer_cast<ChatWindow::ChatTextMessagePart>(window_->lastAddedSystemMessage_.getParts()[0])->text);
+ controller_->handleIncomingMessage(std::make_shared<MessageEvent>(message));
+ CPPUNIT_ASSERT_EQUAL(std::string("Trying to enter room teaparty@rooms.wonderland.lit"), std::dynamic_pointer_cast<ChatWindow::ChatTextMessagePart>(window_->lastAddedSystemMessage_.getParts()[0])->text);
}
}
@@ -483,14 +483,14 @@ public:
void testSubjectChangeIncorrectC() {
std::string messageBody("test message");
window_->onSendMessageRequest(messageBody, false);
- boost::shared_ptr<Stanza> rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1];
- Message::ref message = boost::dynamic_pointer_cast<Message>(rawStanza);
+ std::shared_ptr<Stanza> rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1];
+ Message::ref message = std::dynamic_pointer_cast<Message>(rawStanza);
CPPUNIT_ASSERT(stanzaChannel_->isAvailable()); /* Otherwise will prevent sends. */
CPPUNIT_ASSERT(message);
CPPUNIT_ASSERT_EQUAL(messageBody, message->getBody().get_value_or(""));
{
- Message::ref message = boost::make_shared<Message>();
+ Message::ref message = std::make_shared<Message>();
message->setType(Message::Groupchat);
message->setTo(self_);
message->setFrom(mucJID_.withResource("SomeNickname"));
@@ -498,8 +498,8 @@ public:
message->setSubject("New Room Subject");
message->setBody("");
- controller_->handleIncomingMessage(boost::make_shared<MessageEvent>(message));
- CPPUNIT_ASSERT_EQUAL(std::string("Trying to enter room teaparty@rooms.wonderland.lit"), boost::dynamic_pointer_cast<ChatWindow::ChatTextMessagePart>(window_->lastAddedSystemMessage_.getParts()[0])->text);
+ controller_->handleIncomingMessage(std::make_shared<MessageEvent>(message));
+ CPPUNIT_ASSERT_EQUAL(std::string("Trying to enter room teaparty@rooms.wonderland.lit"), std::dynamic_pointer_cast<ChatWindow::ChatTextMessagePart>(window_->lastAddedSystemMessage_.getParts()[0])->text);
}
}
@@ -544,8 +544,8 @@ private:
DummyEntityCapsProvider* entityCapsProvider_;
DummySettingsProvider* settings_;
HighlightManager* highlightManager_;
- boost::shared_ptr<ChatMessageParser> chatMessageParser_;
- boost::shared_ptr<CryptoProvider> crypto_;
+ std::shared_ptr<ChatMessageParser> chatMessageParser_;
+ std::shared_ptr<CryptoProvider> crypto_;
VCardManager* vcardManager_;
VCardMemoryStorage* vcardStorage_;
ClientBlockListManager* clientBlockListManager_;