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/FileTransfer/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/FileTransfer/UnitTest')
-rw-r--r--Swiften/FileTransfer/UnitTest/DummyFileTransferManager.h6
-rw-r--r--Swiften/FileTransfer/UnitTest/DummyFileTransferTransporterFactory.h36
-rw-r--r--Swiften/FileTransfer/UnitTest/IBBReceiveSessionTest.cpp22
-rw-r--r--Swiften/FileTransfer/UnitTest/IBBSendSessionTest.cpp32
-rw-r--r--Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp58
-rw-r--r--Swiften/FileTransfer/UnitTest/OutgoingJingleFileTransferTest.cpp46
-rw-r--r--Swiften/FileTransfer/UnitTest/SOCKS5BytestreamClientSessionTest.cpp35
-rw-r--r--Swiften/FileTransfer/UnitTest/SOCKS5BytestreamServerSessionTest.cpp24
8 files changed, 129 insertions, 130 deletions
diff --git a/Swiften/FileTransfer/UnitTest/DummyFileTransferManager.h b/Swiften/FileTransfer/UnitTest/DummyFileTransferManager.h
index 70d25a5..03e2476 100644
--- a/Swiften/FileTransfer/UnitTest/DummyFileTransferManager.h
+++ b/Swiften/FileTransfer/UnitTest/DummyFileTransferManager.h
@@ -33,7 +33,7 @@ namespace Swift {
const JID&,
const boost::filesystem::path&,
const std::string&,
- boost::shared_ptr<ReadBytestream>,
+ std::shared_ptr<ReadBytestream>,
const FileTransferOptions&) SWIFTEN_OVERRIDE {
return OutgoingFileTransfer::ref();
}
@@ -44,12 +44,12 @@ namespace Swift {
const std::string&,
const boost::uintmax_t,
const boost::posix_time::ptime&,
- boost::shared_ptr<ReadBytestream>,
+ std::shared_ptr<ReadBytestream>,
const FileTransferOptions&) SWIFTEN_OVERRIDE {
return OutgoingFileTransfer::ref();
}
- virtual void addS5BProxy(boost::shared_ptr<S5BProxyRequest>) {
+ virtual void addS5BProxy(std::shared_ptr<S5BProxyRequest>) {
}
};
diff --git a/Swiften/FileTransfer/UnitTest/DummyFileTransferTransporterFactory.h b/Swiften/FileTransfer/UnitTest/DummyFileTransferTransporterFactory.h
index f3972ab..5db3368 100644
--- a/Swiften/FileTransfer/UnitTest/DummyFileTransferTransporterFactory.h
+++ b/Swiften/FileTransfer/UnitTest/DummyFileTransferTransporterFactory.h
@@ -84,37 +84,37 @@ public:
virtual void stopActivatingProxy() {
}
- virtual boost::shared_ptr<TransportSession> createIBBSendSession(const std::string& sessionID, unsigned int blockSize, boost::shared_ptr<ReadBytestream> stream) {
- boost::shared_ptr<IBBSendSession> ibbSession = boost::make_shared<IBBSendSession>(
+ virtual std::shared_ptr<TransportSession> createIBBSendSession(const std::string& sessionID, unsigned int blockSize, std::shared_ptr<ReadBytestream> stream) {
+ std::shared_ptr<IBBSendSession> ibbSession = std::make_shared<IBBSendSession>(
sessionID, initiator_, responder_, stream, iqRouter_);
ibbSession->setBlockSize(blockSize);
- return boost::make_shared<IBBSendTransportSession>(ibbSession);
+ return std::make_shared<IBBSendTransportSession>(ibbSession);
}
- virtual boost::shared_ptr<TransportSession> createIBBReceiveSession(const std::string& sessionID, unsigned long long size, boost::shared_ptr<WriteBytestream> stream) {
- boost::shared_ptr<IBBReceiveSession> ibbSession = boost::make_shared<IBBReceiveSession>(
+ virtual std::shared_ptr<TransportSession> createIBBReceiveSession(const std::string& sessionID, unsigned long long size, std::shared_ptr<WriteBytestream> stream) {
+ std::shared_ptr<IBBReceiveSession> ibbSession = std::make_shared<IBBReceiveSession>(
sessionID, initiator_, responder_, size, stream, iqRouter_);
- return boost::make_shared<IBBReceiveTransportSession>(ibbSession);
+ return std::make_shared<IBBReceiveTransportSession>(ibbSession);
}
- virtual boost::shared_ptr<TransportSession> createRemoteCandidateSession(
- boost::shared_ptr<ReadBytestream>, const JingleS5BTransportPayload::Candidate& /* candidate */) {
- return boost::shared_ptr<TransportSession>();
+ virtual std::shared_ptr<TransportSession> createRemoteCandidateSession(
+ std::shared_ptr<ReadBytestream>, const JingleS5BTransportPayload::Candidate& /* candidate */) {
+ return std::shared_ptr<TransportSession>();
}
- virtual boost::shared_ptr<TransportSession> createRemoteCandidateSession(
- boost::shared_ptr<WriteBytestream>, const JingleS5BTransportPayload::Candidate& /* candidate */) {
- return boost::shared_ptr<TransportSession>();
+ virtual std::shared_ptr<TransportSession> createRemoteCandidateSession(
+ std::shared_ptr<WriteBytestream>, const JingleS5BTransportPayload::Candidate& /* candidate */) {
+ return std::shared_ptr<TransportSession>();
}
- virtual boost::shared_ptr<TransportSession> createLocalCandidateSession(
- boost::shared_ptr<ReadBytestream>, const JingleS5BTransportPayload::Candidate& /* candidate */) {
- return boost::shared_ptr<TransportSession>();
+ virtual std::shared_ptr<TransportSession> createLocalCandidateSession(
+ std::shared_ptr<ReadBytestream>, const JingleS5BTransportPayload::Candidate& /* candidate */) {
+ return std::shared_ptr<TransportSession>();
}
- virtual boost::shared_ptr<TransportSession> createLocalCandidateSession(
- boost::shared_ptr<WriteBytestream>, const JingleS5BTransportPayload::Candidate& /* candidate */) {
- return boost::shared_ptr<TransportSession>();
+ virtual std::shared_ptr<TransportSession> createLocalCandidateSession(
+ std::shared_ptr<WriteBytestream>, const JingleS5BTransportPayload::Candidate& /* candidate */) {
+ return std::shared_ptr<TransportSession>();
}
private:
diff --git a/Swiften/FileTransfer/UnitTest/IBBReceiveSessionTest.cpp b/Swiften/FileTransfer/UnitTest/IBBReceiveSessionTest.cpp
index d78f4f0..31f46de 100644
--- a/Swiften/FileTransfer/UnitTest/IBBReceiveSessionTest.cpp
+++ b/Swiften/FileTransfer/UnitTest/IBBReceiveSessionTest.cpp
@@ -5,10 +5,10 @@
*/
+#include <memory>
#include <vector>
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -38,7 +38,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture {
stanzaChannel = new DummyStanzaChannel();
iqRouter = new IQRouter(stanzaChannel);
finished = false;
- bytestream = boost::make_shared<ByteArrayWriteBytestream>();
+ bytestream = std::make_shared<ByteArrayWriteBytestream>();
}
void tearDown() {
@@ -47,7 +47,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture {
}
void testOpen() {
- boost::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
+ std::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
testling->start();
stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open"));
@@ -58,7 +58,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture {
}
void testReceiveData() {
- boost::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
+ std::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
testling->start();
stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open"));
@@ -72,7 +72,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture {
}
void testReceiveMultipleData() {
- boost::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
+ std::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
testling->start();
stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open"));
@@ -87,7 +87,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture {
}
void testReceiveDataForOtherSession() {
- boost::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
+ std::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
testling->start();
stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open"));
@@ -99,7 +99,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture {
}
void testReceiveDataOutOfOrder() {
- boost::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
+ std::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
testling->start();
stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open"));
@@ -114,7 +114,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture {
}
void testReceiveLastData() {
- boost::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession", 6));
+ std::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession", 6));
testling->start();
stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open"));
@@ -130,7 +130,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture {
}
void testReceiveClose() {
- boost::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
+ std::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
testling->start();
stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open"));
@@ -143,7 +143,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture {
}
void testStopWhileActive() {
- boost::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
+ std::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
testling->start();
stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open"));
@@ -181,7 +181,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture {
IQRouter* iqRouter;
bool finished;
boost::optional<FileTransferError> error;
- boost::shared_ptr<ByteArrayWriteBytestream> bytestream;
+ std::shared_ptr<ByteArrayWriteBytestream> bytestream;
};
CPPUNIT_TEST_SUITE_REGISTRATION(IBBReceiveSessionTest);
diff --git a/Swiften/FileTransfer/UnitTest/IBBSendSessionTest.cpp b/Swiften/FileTransfer/UnitTest/IBBSendSessionTest.cpp
index e417c77..f9057f8 100644
--- a/Swiften/FileTransfer/UnitTest/IBBSendSessionTest.cpp
+++ b/Swiften/FileTransfer/UnitTest/IBBSendSessionTest.cpp
@@ -39,7 +39,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
void setUp() {
stanzaChannel = new DummyStanzaChannel();
iqRouter = new IQRouter(stanzaChannel);
- bytestream = boost::make_shared<ByteArrayReadBytestream>(createByteArray("abcdefg"));
+ bytestream = std::make_shared<ByteArrayReadBytestream>(createByteArray("abcdefg"));
finished = false;
}
@@ -49,7 +49,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
}
void testStart() {
- boost::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
+ std::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
testling->setBlockSize(1234);
testling->start();
@@ -63,7 +63,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
}
void testStart_ResponseStartsSending() {
- boost::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
+ std::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
testling->setBlockSize(3);
testling->start();
@@ -79,7 +79,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
}
void testResponseContinuesSending() {
- boost::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
+ std::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
testling->setBlockSize(3);
testling->start();
stanzaChannel->onIQReceived(createIBBResult());
@@ -95,7 +95,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
}
void testRespondToAllFinishes() {
- boost::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
+ std::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
testling->setBlockSize(3);
testling->start();
stanzaChannel->onIQReceived(createIBBResult());
@@ -108,7 +108,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
}
void testErrorResponseFinishesWithError() {
- boost::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
+ std::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
testling->setBlockSize(3);
testling->start();
stanzaChannel->onIQReceived(IQ::createError(JID("baz@fum.com/foo"), stanzaChannel->sentStanzas[0]->getTo(), stanzaChannel->sentStanzas[0]->getID()));
@@ -118,7 +118,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
}
void testStopDuringSessionCloses() {
- boost::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
+ std::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
testling->setBlockSize(3);
testling->start();
testling->stop();
@@ -133,7 +133,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
}
void testStopAfterFinishedDoesNotClose() {
- boost::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
+ std::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
testling->setBlockSize(16);
testling->start();
stanzaChannel->onIQReceived(createIBBResult());
@@ -146,7 +146,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
}
void testDataStreamPauseStopsSendingData() {
- boost::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
+ std::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
bytestream->setDataComplete(false);
testling->setBlockSize(3);
testling->start();
@@ -162,7 +162,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
}
void testDataStreamResumeAfterPauseSendsData() {
- boost::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
+ std::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
bytestream->setDataComplete(false);
testling->setBlockSize(3);
testling->start();
@@ -177,7 +177,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
}
void testDataStreamResumeBeforePauseDoesNotSendData() {
- boost::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
+ std::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
bytestream->setDataComplete(false);
testling->setBlockSize(3);
testling->start();
@@ -189,7 +189,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
}
void testDataStreamResumeAfterResumeDoesNotSendData() {
- boost::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
+ std::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
bytestream->setDataComplete(false);
testling->setBlockSize(3);
testling->start();
@@ -206,12 +206,12 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
private:
IQ::ref createIBBResult() {
- return IQ::createResult(JID("baz@fum.com/dum"), stanzaChannel->sentStanzas[stanzaChannel->sentStanzas.size()-1]->getTo(), stanzaChannel->sentStanzas[stanzaChannel->sentStanzas.size()-1]->getID(), boost::shared_ptr<IBB>());
+ return IQ::createResult(JID("baz@fum.com/dum"), stanzaChannel->sentStanzas[stanzaChannel->sentStanzas.size()-1]->getTo(), stanzaChannel->sentStanzas[stanzaChannel->sentStanzas.size()-1]->getID(), std::shared_ptr<IBB>());
}
private:
- boost::shared_ptr<IBBSendSession> createSession(const std::string& to) {
- boost::shared_ptr<IBBSendSession> session(new IBBSendSession("myid", JID(), JID(to), bytestream, iqRouter));
+ std::shared_ptr<IBBSendSession> createSession(const std::string& to) {
+ std::shared_ptr<IBBSendSession> session(new IBBSendSession("myid", JID(), JID(to), bytestream, iqRouter));
session->onFinished.connect(boost::bind(&IBBSendSessionTest::handleFinished, this, _1));
return session;
}
@@ -226,7 +226,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
IQRouter* iqRouter;
bool finished;
boost::optional<FileTransferError> error;
- boost::shared_ptr<ByteArrayReadBytestream> bytestream;
+ std::shared_ptr<ByteArrayReadBytestream> bytestream;
};
CPPUNIT_TEST_SUITE_REGISTRATION(IBBSendSessionTest);
diff --git a/Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp b/Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp
index a76773c..72b933d 100644
--- a/Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp
+++ b/Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp
@@ -5,14 +5,13 @@
*/
/*
- * Copyright (c) 2013-2015 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <iostream>
-
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -45,7 +44,6 @@
#include <Swiften/Queries/IQRouter.h>
using namespace Swift;
-using namespace boost;
class IncomingJingleFileTransferTest : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(IncomingJingleFileTransferTest);
@@ -54,9 +52,9 @@ class IncomingJingleFileTransferTest : public CppUnit::TestFixture {
//CPPUNIT_TEST(test_AcceptFailingS5BFallsBackToIBB);
CPPUNIT_TEST_SUITE_END();
public:
- shared_ptr<IncomingJingleFileTransfer> createTestling() {
+ std::shared_ptr<IncomingJingleFileTransfer> createTestling() {
JID ourJID("our@jid.org/full");
- return boost::make_shared<IncomingJingleFileTransfer>(ourJID, shared_ptr<JingleSession>(session), jingleContentPayload, ftTransporterFactory, timerFactory, crypto.get());
+ return std::make_shared<IncomingJingleFileTransfer>(ourJID, std::shared_ptr<JingleSession>(session), jingleContentPayload, ftTransporterFactory, timerFactory, crypto.get());
}
IQ::ref createIBBRequest(IBB::ref ibb, const JID& from, const std::string& id) {
@@ -66,13 +64,13 @@ public:
}
void setUp() {
- crypto = boost::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
+ crypto = std::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
eventLoop = new DummyEventLoop();
resolver = new StaticDomainNameResolver(eventLoop);
- session = boost::make_shared<FakeJingleSession>("foo@bar.com/baz", "mysession");
- jingleContentPayload = make_shared<JingleContentPayload>();
- // fakeRJTCSF = make_shared<FakeRemoteJingleTransportCandidateSelectorFactory>();
- // fakeLJTCF = make_shared<FakeLocalJingleTransportCandidateGeneratorFactory>();
+ session = std::make_shared<FakeJingleSession>("foo@bar.com/baz", "mysession");
+ jingleContentPayload = std::make_shared<JingleContentPayload>();
+ // fakeRJTCSF = std::make_shared<FakeRemoteJingleTransportCandidateSelectorFactory>();
+ // fakeLJTCF = std::make_shared<FakeLocalJingleTransportCandidateGeneratorFactory>();
stanzaChannel = new DummyStanzaChannel();
connectionFactory = new DummyConnectionFactory(eventLoop);
serverConnectionFactory = new DummyConnectionServerFactory(eventLoop);
@@ -108,17 +106,17 @@ public:
// Tests whether IncomingJingleFileTransfer would accept a IBB only file transfer.
void test_AcceptOnyIBBSendsSessionAccept() {
//1. create your test incoming file transfer
- shared_ptr<JingleFileTransferDescription> desc = make_shared<JingleFileTransferDescription>();
+ std::shared_ptr<JingleFileTransferDescription> desc = std::make_shared<JingleFileTransferDescription>();
desc->setFileInfo(JingleFileTransferFileInfo("foo.txt", "", 10));
jingleContentPayload->addDescription(desc);
- JingleIBBTransportPayload::ref tpRef = make_shared<JingleIBBTransportPayload>();
+ JingleIBBTransportPayload::ref tpRef = std::make_shared<JingleIBBTransportPayload>();
tpRef->setSessionID("mysession");
jingleContentPayload->addTransport(tpRef);
- shared_ptr<IncomingJingleFileTransfer> fileTransfer = createTestling();
+ std::shared_ptr<IncomingJingleFileTransfer> fileTransfer = createTestling();
//2. do 'accept' on a dummy writebytestream (you'll have to look if there already is one)
- shared_ptr<ByteArrayWriteBytestream> byteStream = make_shared<ByteArrayWriteBytestream>();
+ std::shared_ptr<ByteArrayWriteBytestream> byteStream = std::make_shared<ByteArrayWriteBytestream>();
fileTransfer->accept(byteStream);
// check whether accept has been called
@@ -127,17 +125,17 @@ public:
void test_OnlyIBBTransferReceiveWorks() {
//1. create your test incoming file transfer
- shared_ptr<JingleFileTransferDescription> desc = make_shared<JingleFileTransferDescription>();
+ std::shared_ptr<JingleFileTransferDescription> desc = std::make_shared<JingleFileTransferDescription>();
desc->setFileInfo(JingleFileTransferFileInfo("file.txt", "", 10));
jingleContentPayload->addDescription(desc);
- JingleIBBTransportPayload::ref tpRef = make_shared<JingleIBBTransportPayload>();
+ JingleIBBTransportPayload::ref tpRef = std::make_shared<JingleIBBTransportPayload>();
tpRef->setSessionID("mysession");
jingleContentPayload->addTransport(tpRef);
- shared_ptr<IncomingJingleFileTransfer> fileTransfer = createTestling();
+ std::shared_ptr<IncomingJingleFileTransfer> fileTransfer = createTestling();
//2. do 'accept' on a dummy writebytestream (you'll have to look if there already is one)
- shared_ptr<ByteArrayWriteBytestream> byteStream = make_shared<ByteArrayWriteBytestream>();
+ std::shared_ptr<ByteArrayWriteBytestream> byteStream = std::make_shared<ByteArrayWriteBytestream>();
fileTransfer->accept(byteStream);
// check whether accept has been called
@@ -154,10 +152,10 @@ public:
// add SOCKS5BytestreamTransportPayload
JingleS5BTransportPayload::ref payLoad = addJingleS5BPayload();
- shared_ptr<IncomingJingleFileTransfer> fileTransfer = createTestling();
+ std::shared_ptr<IncomingJingleFileTransfer> fileTransfer = createTestling();
//2. do 'accept' on a dummy writebytestream (you'll have to look if there already is one)
- shared_ptr<ByteArrayWriteBytestream> byteStream = make_shared<ByteArrayWriteBytestream>();
+ std::shared_ptr<ByteArrayWriteBytestream> byteStream = std::make_shared<ByteArrayWriteBytestream>();
fileTransfer->accept(byteStream);
// candidates are gathered
@@ -168,7 +166,7 @@ public:
// check for candidate error
FakeJingleSession::InfoTransportCall infoTransportCall = getCall<FakeJingleSession::InfoTransportCall>(1);
- JingleS5BTransportPayload::ref s5bPayload = dynamic_pointer_cast<JingleS5BTransportPayload>(infoTransportCall.payload);
+ JingleS5BTransportPayload::ref s5bPayload = std::dynamic_pointer_cast<JingleS5BTransportPayload>(infoTransportCall.payload);
CPPUNIT_ASSERT(s5bPayload->hasCandidateError());
// indicate transport replace (Romeo)
@@ -189,20 +187,20 @@ public:
#endif
private:
void addFileTransferDescription() {
- shared_ptr<JingleFileTransferDescription> desc = make_shared<JingleFileTransferDescription>();
+ std::shared_ptr<JingleFileTransferDescription> desc = std::make_shared<JingleFileTransferDescription>();
desc->setFileInfo(JingleFileTransferFileInfo("file.txt", "", 10));
jingleContentPayload->addDescription(desc);
}
- shared_ptr<JingleS5BTransportPayload> addJingleS5BPayload() {
- JingleS5BTransportPayload::ref payLoad = make_shared<JingleS5BTransportPayload>();
+ std::shared_ptr<JingleS5BTransportPayload> addJingleS5BPayload() {
+ JingleS5BTransportPayload::ref payLoad = std::make_shared<JingleS5BTransportPayload>();
payLoad->setSessionID("mysession");
jingleContentPayload->addTransport(payLoad);
return payLoad;
}
- shared_ptr<JingleIBBTransportPayload> addJingleIBBPayload() {
- JingleIBBTransportPayload::ref payLoad = make_shared<JingleIBBTransportPayload>();
+ std::shared_ptr<JingleIBBTransportPayload> addJingleIBBPayload() {
+ JingleIBBTransportPayload::ref payLoad = std::make_shared<JingleIBBTransportPayload>();
payLoad->setSessionID("mysession");
jingleContentPayload->addTransport(payLoad);
return payLoad;
@@ -222,9 +220,9 @@ private:
private:
EventLoop* eventLoop;
- boost::shared_ptr<CryptoProvider> crypto;
- boost::shared_ptr<FakeJingleSession> session;
- shared_ptr<JingleContentPayload> jingleContentPayload;
+ std::shared_ptr<CryptoProvider> crypto;
+ std::shared_ptr<FakeJingleSession> session;
+ std::shared_ptr<JingleContentPayload> jingleContentPayload;
// shared_ptr<FakeRemoteJingleTransportCandidateSelectorFactory> fakeRJTCSF;
// shared_ptr<FakeLocalJingleTransportCandidateGeneratorFactory> fakeLJTCF;
FileTransferTransporterFactory* ftTransporterFactory;
diff --git a/Swiften/FileTransfer/UnitTest/OutgoingJingleFileTransferTest.cpp b/Swiften/FileTransfer/UnitTest/OutgoingJingleFileTransferTest.cpp
index 401463c..3f4d20f 100644
--- a/Swiften/FileTransfer/UnitTest/OutgoingJingleFileTransferTest.cpp
+++ b/Swiften/FileTransfer/UnitTest/OutgoingJingleFileTransferTest.cpp
@@ -11,10 +11,10 @@
*/
#include <iostream>
+#include <memory>
#include <boost/bind.hpp>
#include <boost/optional.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -81,16 +81,16 @@ class OutgoingJingleFileTransferTest : public CppUnit::TestFixture {
public:
- boost::shared_ptr<OutgoingJingleFileTransfer> createTestling(const FileTransferOptions& options = FileTransferOptions().withAssistedAllowed(false).withDirectAllowed(false).withProxiedAllowed(false)) {
+ std::shared_ptr<OutgoingJingleFileTransfer> createTestling(const FileTransferOptions& options = FileTransferOptions().withAssistedAllowed(false).withDirectAllowed(false).withProxiedAllowed(false)) {
JID to("test@foo.com/bla");
JingleFileTransferFileInfo fileInfo;
fileInfo.setDescription("some file");
fileInfo.setName("test.bin");
fileInfo.addHash(HashElement("sha-1", ByteArray()));
fileInfo.setSize(1024 * 1024);
- return boost::shared_ptr<OutgoingJingleFileTransfer>(new OutgoingJingleFileTransfer(
+ return std::shared_ptr<OutgoingJingleFileTransfer>(new OutgoingJingleFileTransfer(
to,
- boost::shared_ptr<JingleSession>(fakeJingleSession),
+ std::shared_ptr<JingleSession>(fakeJingleSession),
stream,
ftTransportFactory,
timerFactory,
@@ -107,9 +107,9 @@ public:
}
void setUp() {
- crypto = boost::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
+ crypto = std::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
fakeJingleSession = new FakeJingleSession("foo@bar.com/baz", "mysession");
- jingleContentPayload = boost::make_shared<JingleContentPayload>();
+ jingleContentPayload = std::make_shared<JingleContentPayload>();
stanzaChannel = new DummyStanzaChannel();
iqRouter = new IQRouter(stanzaChannel);
eventLoop = new DummyEventLoop();
@@ -126,7 +126,7 @@ public:
data.push_back(34);
}
- stream = boost::make_shared<ByteArrayReadBytestream>(data);
+ stream = std::make_shared<ByteArrayReadBytestream>(data);
idGen = new IDGenerator();
s5bProxy = new SOCKS5BytestreamProxiesManager(connectionFactory, timerFactory, resolver, iqRouter, "bar.com");
@@ -151,29 +151,29 @@ public:
void test_SendSessionInitiateOnStart() {
- boost::shared_ptr<OutgoingJingleFileTransfer> transfer = createTestling();
+ std::shared_ptr<OutgoingJingleFileTransfer> transfer = createTestling();
transfer->start();
FakeJingleSession::InitiateCall call = getCall<FakeJingleSession::InitiateCall>(0);
- JingleFileTransferDescription::ref description = boost::dynamic_pointer_cast<JingleFileTransferDescription>(call.description);
+ JingleFileTransferDescription::ref description = std::dynamic_pointer_cast<JingleFileTransferDescription>(call.description);
CPPUNIT_ASSERT(description);
CPPUNIT_ASSERT(static_cast<size_t>(1048576) == description->getFileInfo().getSize());
- JingleIBBTransportPayload::ref transport = boost::dynamic_pointer_cast<JingleIBBTransportPayload>(call.payload);
+ JingleIBBTransportPayload::ref transport = std::dynamic_pointer_cast<JingleIBBTransportPayload>(call.payload);
CPPUNIT_ASSERT(transport);
}
void test_FallbackToIBBAfterFailingS5B() {
- boost::shared_ptr<OutgoingJingleFileTransfer> transfer = createTestling(FileTransferOptions().withAssistedAllowed(true).withDirectAllowed(true).withProxiedAllowed(true));
+ std::shared_ptr<OutgoingJingleFileTransfer> transfer = createTestling(FileTransferOptions().withAssistedAllowed(true).withDirectAllowed(true).withProxiedAllowed(true));
transfer->start();
FakeJingleSession::InitiateCall call = getCall<FakeJingleSession::InitiateCall>(0);
- CPPUNIT_ASSERT(boost::dynamic_pointer_cast<JingleS5BTransportPayload>(call.payload));
+ CPPUNIT_ASSERT(std::dynamic_pointer_cast<JingleS5BTransportPayload>(call.payload));
fakeJingleSession->handleSessionAcceptReceived(call.id, call.description, call.payload);
// send candidate failure
- JingleS5BTransportPayload::ref candidateFailurePayload = boost::make_shared<JingleS5BTransportPayload>();
+ JingleS5BTransportPayload::ref candidateFailurePayload = std::make_shared<JingleS5BTransportPayload>();
candidateFailurePayload->setCandidateError(true);
candidateFailurePayload->setSessionID(call.payload->getSessionID());
fakeJingleSession->handleTransportInfoReceived(call.id, candidateFailurePayload);
@@ -193,7 +193,7 @@ public:
}
void test_ReceiveSessionTerminateAfterSessionInitiate() {
- boost::shared_ptr<OutgoingJingleFileTransfer> transfer = createTestling();
+ std::shared_ptr<OutgoingJingleFileTransfer> transfer = createTestling();
transfer->start();
getCall<FakeJingleSession::InitiateCall>(0);
@@ -207,7 +207,7 @@ public:
}
void test_DeclineEmitsFinishedStateCanceled() {
- boost::shared_ptr<OutgoingJingleFileTransfer> transfer = createTestling();
+ std::shared_ptr<OutgoingJingleFileTransfer> transfer = createTestling();
transfer->start();
getCall<FakeJingleSession::InitiateCall>(0);
@@ -227,20 +227,20 @@ public:
private:
void addFileTransferDescription() {
- boost::shared_ptr<JingleFileTransferDescription> desc = boost::make_shared<JingleFileTransferDescription>();
+ std::shared_ptr<JingleFileTransferDescription> desc = std::make_shared<JingleFileTransferDescription>();
desc->setFileInfo(JingleFileTransferFileInfo());
jingleContentPayload->addDescription(desc);
}
- boost::shared_ptr<JingleS5BTransportPayload> addJingleS5BPayload() {
- JingleS5BTransportPayload::ref payLoad = boost::make_shared<JingleS5BTransportPayload>();
+ std::shared_ptr<JingleS5BTransportPayload> addJingleS5BPayload() {
+ JingleS5BTransportPayload::ref payLoad = std::make_shared<JingleS5BTransportPayload>();
payLoad->setSessionID("mysession");
jingleContentPayload->addTransport(payLoad);
return payLoad;
}
- boost::shared_ptr<JingleIBBTransportPayload> addJingleIBBPayload() {
- JingleIBBTransportPayload::ref payLoad = boost::make_shared<JingleIBBTransportPayload>();
+ std::shared_ptr<JingleIBBTransportPayload> addJingleIBBPayload() {
+ JingleIBBTransportPayload::ref payLoad = std::make_shared<JingleIBBTransportPayload>();
payLoad->setSessionID("mysession");
jingleContentPayload->addTransport(payLoad);
return payLoad;
@@ -260,9 +260,9 @@ private:
private:
std::vector<unsigned char> data;
- boost::shared_ptr<ByteArrayReadBytestream> stream;
+ std::shared_ptr<ByteArrayReadBytestream> stream;
FakeJingleSession* fakeJingleSession;
- boost::shared_ptr<JingleContentPayload> jingleContentPayload;
+ std::shared_ptr<JingleContentPayload> jingleContentPayload;
FileTransferTransporterFactory* ftTransportFactory;
SOCKS5BytestreamServerManager* bytestreamServerManager;
DummyStanzaChannel* stanzaChannel;
@@ -274,7 +274,7 @@ private:
DummyTimerFactory* timerFactory;
DummyConnectionFactory* connectionFactory;
DummyConnectionServerFactory* serverConnectionFactory;
- boost::shared_ptr<CryptoProvider> crypto;
+ std::shared_ptr<CryptoProvider> crypto;
NetworkEnvironment* networkEnvironment;
NATTraverser* natTraverser;
DomainNameResolver* resolver;
diff --git a/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamClientSessionTest.cpp b/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamClientSessionTest.cpp
index 9690c09..5408cd4 100644
--- a/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamClientSessionTest.cpp
+++ b/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamClientSessionTest.cpp
@@ -10,11 +10,12 @@
* See the COPYING file for more information.
*/
+#include <memory>
+
#include <boost/bind.hpp>
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int.hpp>
#include <boost/random/variate_generator.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <QA/Checker/IO.h>
@@ -55,14 +56,14 @@ public:
SOCKS5BytestreamClientSessionTest() : destinationAddressPort(HostAddressPort(HostAddress("127.0.0.1"), 8888)) {}
void setUp() {
- crypto = boost::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
+ crypto = std::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
destination = "092a44d859d19c9eed676b551ee80025903351c2";
randomGen.seed(static_cast<unsigned int>(time(nullptr)));
eventLoop = new DummyEventLoop();
timerFactory = new DummyTimerFactory();
- connection = boost::make_shared<MockeryConnection>(failingPorts, true, eventLoop);
+ connection = std::make_shared<MockeryConnection>(failingPorts, true, eventLoop);
//connection->onDataSent.connect(boost::bind(&SOCKS5BytestreamServerSessionTest::handleDataWritten, this, _1));
- //stream1 = boost::make_shared<ByteArrayReadBytestream>(createByteArray("abcdefg")));
+ //stream1 = std::make_shared<ByteArrayReadBytestream>(createByteArray("abcdefg")));
// connection->onDataRead.connect(boost::bind(&SOCKS5BytestreamClientSessionTest::handleDataRead, this, _1));
}
@@ -76,7 +77,7 @@ public:
TestHelper helper;
connection->onDataSent.connect(boost::bind(&TestHelper::handleConnectionDataWritten, &helper, _1));
- SOCKS5BytestreamClientSession::ref clientSession = boost::make_shared<SOCKS5BytestreamClientSession>(connection, destinationAddressPort, destination, timerFactory);
+ SOCKS5BytestreamClientSession::ref clientSession = std::make_shared<SOCKS5BytestreamClientSession>(connection, destinationAddressPort, destination, timerFactory);
clientSession->onSessionReady.connect(boost::bind(&TestHelper::handleSessionReady, &helper, _1));
clientSession->start();
@@ -102,7 +103,7 @@ public:
TestHelper helper;
connection->onDataSent.connect(boost::bind(&TestHelper::handleConnectionDataWritten, &helper, _1));
- SOCKS5BytestreamClientSession::ref clientSession = boost::make_shared<SOCKS5BytestreamClientSession>(connection, destinationAddressPort, destination, timerFactory);
+ SOCKS5BytestreamClientSession::ref clientSession = std::make_shared<SOCKS5BytestreamClientSession>(connection, destinationAddressPort, destination, timerFactory);
clientSession->onSessionReady.connect(boost::bind(&TestHelper::handleSessionReady, &helper, _1));
clientSession->start();
@@ -122,7 +123,7 @@ public:
TestHelper helper;
connection->onDataSent.connect(boost::bind(&TestHelper::handleConnectionDataWritten, &helper, _1));
- SOCKS5BytestreamClientSession::ref clientSession = boost::make_shared<SOCKS5BytestreamClientSession>(connection, destinationAddressPort, destination, timerFactory);
+ SOCKS5BytestreamClientSession::ref clientSession = std::make_shared<SOCKS5BytestreamClientSession>(connection, destinationAddressPort, destination, timerFactory);
clientSession->onSessionReady.connect(boost::bind(&TestHelper::handleSessionReady, &helper, _1));
clientSession->start();
@@ -149,7 +150,7 @@ public:
TestHelper helper;
connection->onDataSent.connect(boost::bind(&TestHelper::handleConnectionDataWritten, &helper, _1));
- SOCKS5BytestreamClientSession::ref clientSession = boost::make_shared<SOCKS5BytestreamClientSession>(connection, destinationAddressPort, destination, timerFactory);
+ SOCKS5BytestreamClientSession::ref clientSession = std::make_shared<SOCKS5BytestreamClientSession>(connection, destinationAddressPort, destination, timerFactory);
clientSession->onSessionReady.connect(boost::bind(&TestHelper::handleSessionReady, &helper, _1));
clientSession->start();
@@ -165,7 +166,7 @@ public:
CPPUNIT_ASSERT_EQUAL(true, helper.sessionReadyCalled);
CPPUNIT_ASSERT_EQUAL(false, helper.sessionReadyError);
- boost::shared_ptr<ByteArrayWriteBytestream> output = boost::make_shared<ByteArrayWriteBytestream>();
+ std::shared_ptr<ByteArrayWriteBytestream> output = std::make_shared<ByteArrayWriteBytestream>();
clientSession->startReceiving(output);
ByteArray transferData = generateRandomByteArray(1024);
@@ -177,7 +178,7 @@ public:
TestHelper helper;
connection->onDataSent.connect(boost::bind(&TestHelper::handleConnectionDataWritten, &helper, _1));
- SOCKS5BytestreamClientSession::ref clientSession = boost::make_shared<SOCKS5BytestreamClientSession>(connection, destinationAddressPort, destination, timerFactory);
+ SOCKS5BytestreamClientSession::ref clientSession = std::make_shared<SOCKS5BytestreamClientSession>(connection, destinationAddressPort, destination, timerFactory);
clientSession->onSessionReady.connect(boost::bind(&TestHelper::handleSessionReady, &helper, _1));
clientSession->start();
@@ -195,7 +196,7 @@ public:
helper.unprocessedInput.clear();
ByteArray transferData = generateRandomByteArray(1024);
- boost::shared_ptr<ByteArrayReadBytestream> input = boost::make_shared<ByteArrayReadBytestream>(transferData);
+ std::shared_ptr<ByteArrayReadBytestream> input = std::make_shared<ByteArrayReadBytestream>(transferData);
clientSession->startSending(input);
eventLoop->processEvents();
@@ -225,7 +226,7 @@ private:
}
void serverRespondRequestOK() {
- boost::shared_ptr<SafeByteArray> dataToSend = createSafeByteArrayRef("\x05\x00\x00\x03", 4);
+ std::shared_ptr<SafeByteArray> dataToSend = createSafeByteArrayRef("\x05\x00\x00\x03", 4);
append(*dataToSend, createSafeByteArray(static_cast<char>(destination.size())));
append(*dataToSend, createSafeByteArray(destination));
append(*dataToSend, createSafeByteArray("\x00", 1));
@@ -233,12 +234,12 @@ private:
}
void serverRespondRequestFail() {
- boost::shared_ptr<SafeByteArray> correctData = createSafeByteArrayRef("\x05\x00\x00\x03", 4);
+ std::shared_ptr<SafeByteArray> correctData = createSafeByteArrayRef("\x05\x00\x00\x03", 4);
append(*correctData, createSafeByteArray(static_cast<char>(destination.size())));
append(*correctData, createSafeByteArray(destination));
append(*correctData, createSafeByteArray("\x00", 1));
- boost::shared_ptr<SafeByteArray> dataToSend;
+ std::shared_ptr<SafeByteArray> dataToSend;
//ByteArray failingData = Hexify::unhexify("8417947d1d305c72c11520ea7d2c6e787396705e72c312c6ccc3f66613d7cae1b91b7ab48e8b59a17d559c15fb51");
//append(dataToSend, failingData);
//SWIFT_LOG(debug) << "hexed: " << Hexify::hexify(failingData) << std::endl;
@@ -269,7 +270,7 @@ private:
private:
- struct MockeryConnection : public Connection, public EventOwner, public boost::enable_shared_from_this<MockeryConnection> {
+ struct MockeryConnection : public Connection, public EventOwner, public std::enable_shared_from_this<MockeryConnection> {
public:
MockeryConnection(const std::vector<HostAddressPort>& failingPorts, bool isResponsive, EventLoop* eventLoop) : eventLoop(eventLoop), failingPorts(failingPorts), isResponsive(isResponsive), disconnectCalled(false) {}
@@ -309,9 +310,9 @@ private:
std::string destination;
DummyEventLoop* eventLoop;
DummyTimerFactory* timerFactory;
- boost::shared_ptr<MockeryConnection> connection;
+ std::shared_ptr<MockeryConnection> connection;
const std::vector<HostAddressPort> failingPorts;
- boost::shared_ptr<CryptoProvider> crypto;
+ std::shared_ptr<CryptoProvider> crypto;
};
CPPUNIT_TEST_SUITE_REGISTRATION(SOCKS5BytestreamClientSessionTest);
diff --git a/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamServerSessionTest.cpp b/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamServerSessionTest.cpp
index 12690ff..d419b8a 100644
--- a/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamServerSessionTest.cpp
+++ b/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamServerSessionTest.cpp
@@ -37,9 +37,9 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
receivedDataChunks = 0;
eventLoop = new DummyEventLoop();
bytestreams = new SOCKS5BytestreamRegistry();
- connection = boost::make_shared<DummyConnection>(eventLoop);
+ connection = std::make_shared<DummyConnection>(eventLoop);
connection->onDataSent.connect(boost::bind(&SOCKS5BytestreamServerSessionTest::handleDataWritten, this, _1));
- stream1 = boost::make_shared<ByteArrayReadBytestream>(createByteArray("abcdefg"));
+ stream1 = std::make_shared<ByteArrayReadBytestream>(createByteArray("abcdefg"));
finished = false;
}
@@ -50,7 +50,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
}
void testAuthenticate() {
- boost::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
+ std::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
StartStopper<SOCKS5BytestreamServerSession> stopper(testling.get());
receive(createSafeByteArray("\x05\x02\x01\x02"));
@@ -59,7 +59,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
}
void testAuthenticate_Chunked() {
- boost::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
+ std::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
StartStopper<SOCKS5BytestreamServerSession> stopper(testling.get());
receive(createSafeByteArray("\x05\x02\x01"));
@@ -70,7 +70,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
}
void testRequest() {
- boost::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
+ std::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
StartStopper<SOCKS5BytestreamServerSession> stopper(testling.get());
bytestreams->setHasBytestream("abcdef", true);
authenticate();
@@ -81,7 +81,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
}
void testRequest_UnknownBytestream() {
- boost::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
+ std::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
StartStopper<SOCKS5BytestreamServerSession> stopper(testling.get());
authenticate();
@@ -91,7 +91,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
}
void testReceiveData() {
- boost::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
+ std::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
StartStopper<SOCKS5BytestreamServerSession> stopper(testling.get());
bytestreams->setHasBytestream("abcdef", true);
authenticate();
@@ -106,7 +106,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
}
void testReceiveData_Chunked() {
- boost::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
+ std::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
testling->setChunkSize(3);
StartStopper<SOCKS5BytestreamServerSession> stopper(testling.get());
bytestreams->setHasBytestream("abcdef", true);
@@ -121,7 +121,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
}
void testDataStreamPauseStopsSendingData() {
- boost::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
+ std::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
testling->setChunkSize(3);
stream1->setDataComplete(false);
StartStopper<SOCKS5BytestreamServerSession> stopper(testling.get());
@@ -140,7 +140,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
}
void testDataStreamResumeAfterPauseSendsData() {
- boost::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
+ std::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
testling->setChunkSize(3);
stream1->setDataComplete(false);
StartStopper<SOCKS5BytestreamServerSession> stopper(testling.get());
@@ -202,10 +202,10 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
private:
DummyEventLoop* eventLoop;
SOCKS5BytestreamRegistry* bytestreams;
- boost::shared_ptr<DummyConnection> connection;
+ std::shared_ptr<DummyConnection> connection;
std::vector<unsigned char> receivedData;
int receivedDataChunks;
- boost::shared_ptr<ByteArrayReadBytestream> stream1;
+ std::shared_ptr<ByteArrayReadBytestream> stream1;
bool finished;
boost::optional<FileTransferError> error;
};