diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2016-09-12 20:22:31 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2016-09-14 09:16:48 +0000 |
commit | f24990e7ce5fbb61ec9e59ab7658fd39370e5b25 (patch) | |
tree | 253e2dafaba87c7c5982726c043d4726df1106f6 /filedistribution/src/tests | |
parent | 3e0ab6f73c7b49967b5c55e52cb0f2095e3f3c76 (diff) |
Replace usage of boost::shared_ptr/weak_ptr with std::versions.
Diffstat (limited to 'filedistribution/src/tests')
6 files changed, 29 insertions, 29 deletions
diff --git a/filedistribution/src/tests/filedbmodelimpl/test-filedistributionmodelimpl.cpp b/filedistribution/src/tests/filedbmodelimpl/test-filedistributionmodelimpl.cpp index 84d1b5b958c..7642798125b 100644 --- a/filedistribution/src/tests/filedbmodelimpl/test-filedistributionmodelimpl.cpp +++ b/filedistribution/src/tests/filedbmodelimpl/test-filedistributionmodelimpl.cpp @@ -20,10 +20,10 @@ namespace { struct Fixture { - boost::shared_ptr<ExceptionRethrower> _exceptionRethrower; + std::shared_ptr<ExceptionRethrower> _exceptionRethrower; ComponentsDeleter _componentsDeleter; - boost::shared_ptr<ZKFacade> _zk; - boost::shared_ptr<FileDistributionModelImpl> _distModel; + std::shared_ptr<ZKFacade> _zk; + std::shared_ptr<FileDistributionModelImpl> _distModel; Fixture() { _exceptionRethrower.reset(new ExceptionRethrower()); _zk = _componentsDeleter.track(new ZKFacade("test1-tonyv:2181", _exceptionRethrower)); diff --git a/filedistribution/src/tests/filedownloader/testfiledownloader.cpp b/filedistribution/src/tests/filedownloader/testfiledownloader.cpp index 94b505f4f9f..cc82aab01ea 100644 --- a/filedistribution/src/tests/filedownloader/testfiledownloader.cpp +++ b/filedistribution/src/tests/filedownloader/testfiledownloader.cpp @@ -33,14 +33,14 @@ const int uploaderPort = 9113; const int downloaderPort = 9112; #if 0 -boost::shared_ptr<FileDownloader> +std::shared_ptr<FileDownloader> createDownloader(ComponentsDeleter& deleter, int port, const fs::path& downloaderPath, - const boost::shared_ptr<FileDistributionModel>& model, - const boost::shared_ptr<ExceptionRethrower>& exceptionRethrower) + const std::shared_ptr<FileDistributionModel>& model, + const std::shared_ptr<ExceptionRethrower>& exceptionRethrower) { - boost::shared_ptr<FileDistributorTrackerImpl> tracker(deleter.track(new FileDistributorTrackerImpl(model, exceptionRethrower))); - boost::shared_ptr<FileDownloader> downloader(deleter.track(new FileDownloader(tracker, + std::shared_ptr<FileDistributorTrackerImpl> tracker(deleter.track(new FileDistributorTrackerImpl(model, exceptionRethrower))); + std::shared_ptr<FileDownloader> downloader(deleter.track(new FileDownloader(tracker, localHost, port, downloaderPath, exceptionRethrower))); tracker->setDownloader(downloader); @@ -101,13 +101,13 @@ BOOST_AUTO_TEST_CASE(fileDownloaderTest) { Buffer buffer(createTorrent.bencode()); ComponentsDeleter deleter; - boost::shared_ptr<ExceptionRethrower> exceptionRethrower(new ExceptionRethrower()); + std::shared_ptr<ExceptionRethrower> exceptionRethrower(new ExceptionRethrower()); - boost::shared_ptr<FileDistributionModel> model(deleter.track(new MockFileDistributionModel())); - boost::shared_ptr<FileDownloader> downloader = + std::shared_ptr<FileDistributionModel> model(deleter.track(new MockFileDistributionModel())); + std::shared_ptr<FileDownloader> downloader = createDownloader(deleter, downloaderPort, downloaderPath, model, exceptionRethrower); - boost::shared_ptr<FileDownloader> uploader = + std::shared_ptr<FileDownloader> uploader = createDownloader(deleter, uploaderPort, uploaderPath, model, exceptionRethrower); boost::thread uploaderThread( diff --git a/filedistribution/src/tests/lib/mock-zookeeper.cpp b/filedistribution/src/tests/lib/mock-zookeeper.cpp index 82cd03a268e..809733b9dd0 100644 --- a/filedistribution/src/tests/lib/mock-zookeeper.cpp +++ b/filedistribution/src/tests/lib/mock-zookeeper.cpp @@ -55,7 +55,7 @@ struct Node { void triggerWatches(zhandle_t* zh, const std::string& path); }; -boost::shared_ptr<Node> sharedRoot; +std::shared_ptr<Node> sharedRoot; struct ZHandle { struct Worker { @@ -68,7 +68,7 @@ struct ZHandle { int sequence; - boost::shared_ptr<Node> root; + std::shared_ptr<Node> root; boost::thread _watchersThread; vector<string> ephemeralNodes; diff --git a/filedistribution/src/tests/rpc/testfileprovider.cpp b/filedistribution/src/tests/rpc/testfileprovider.cpp index 6881eb96b8a..1291932c8a6 100644 --- a/filedistribution/src/tests/rpc/testfileprovider.cpp +++ b/filedistribution/src/tests/rpc/testfileprovider.cpp @@ -17,8 +17,8 @@ const std::string MockFileProvider::_queueForeverFileReference("queue-forever"); BOOST_AUTO_TEST_CASE(fileDistributionRPCTest) { const std::string spec("tcp/localhost:9111"); - boost::shared_ptr<fd::MockFileProvider> provider(new fd::MockFileProvider()); - boost::shared_ptr<fd::FileDistributorRPC> fileDistributorRPC(new fd::FileDistributorRPC(spec, provider)); + std::shared_ptr<fd::MockFileProvider> provider(new fd::MockFileProvider()); + fd::FileDistributorRPC::SP fileDistributorRPC(new fd::FileDistributorRPC(spec, provider)); fileDistributorRPC->start(); frtstream::FrtClientStream rpc(spec); @@ -37,8 +37,8 @@ BOOST_AUTO_TEST_CASE(fileDistributionRPCTest) { //must be run through valgrind BOOST_AUTO_TEST_CASE(require_that_queued_requests_does_not_leak_memory) { const std::string spec("tcp/localhost:9111"); - boost::shared_ptr<MockFileProvider> provider(new MockFileProvider()); - boost::shared_ptr<fd::FileDistributorRPC> fileDistributorRPC(new fd::FileDistributorRPC(spec, provider)); + std::shared_ptr<MockFileProvider> provider(new MockFileProvider()); + fd::FileDistributorRPC::SP fileDistributorRPC(new fd::FileDistributorRPC(spec, provider)); fileDistributorRPC->start(); FRT_Supervisor supervisor; diff --git a/filedistribution/src/tests/zkfacade/test-zkfacade.cpp b/filedistribution/src/tests/zkfacade/test-zkfacade.cpp index d45e5059a53..037ce448dd9 100644 --- a/filedistribution/src/tests/zkfacade/test-zkfacade.cpp +++ b/filedistribution/src/tests/zkfacade/test-zkfacade.cpp @@ -35,9 +35,9 @@ struct Watcher : public ZKFacade::NodeChangedWatcher { }; struct Fixture { - boost::shared_ptr<ExceptionRethrower> _exceptionRethrower; + std::shared_ptr<ExceptionRethrower> _exceptionRethrower; ComponentsDeleter _componentsDeleter; - boost::shared_ptr<ZKFacade> zk; + std::shared_ptr<ZKFacade> zk; ZKFacade::Path testNode; Fixture() { @@ -74,7 +74,7 @@ BOOST_AUTO_TEST_CASE(hasNode) BOOST_AUTO_TEST_CASE(hasNodeNotification) { - boost::shared_ptr<Watcher> watcher(new Watcher); + std::shared_ptr<Watcher> watcher(new Watcher); zk->hasNode(testNode, watcher); zk->setData(testNode, "", 0); @@ -169,7 +169,7 @@ BOOST_AUTO_TEST_CASE(addEphemeralNode) BOOST_AUTO_TEST_CASE(dataChangedNotification) { - boost::shared_ptr<Watcher> watcher(new Watcher); + std::shared_ptr<Watcher> watcher(new Watcher); zk->setData(testNode, "", 0); Buffer buffer(zk->getData(testNode, watcher)); @@ -182,7 +182,7 @@ BOOST_AUTO_TEST_CASE(dataChangedNotification) BOOST_AUTO_TEST_CASE(getChildrenNotification) { - boost::shared_ptr<Watcher> watcher(new Watcher); + std::shared_ptr<Watcher> watcher(new Watcher); zk->setData(testNode, "", 0); zk->getChildren(testNode, watcher); @@ -194,9 +194,9 @@ BOOST_AUTO_TEST_CASE(getChildrenNotification) BOOST_AUTO_TEST_CASE(require_that_zkfacade_can_be_deleted_from_callback) { struct DeleteZKFacadeWatcher : public Watcher { - boost::shared_ptr<ZKFacade> _zk; + std::shared_ptr<ZKFacade> _zk; - DeleteZKFacadeWatcher(const boost::shared_ptr<ZKFacade>& zk) + DeleteZKFacadeWatcher(const std::shared_ptr<ZKFacade>& zk) :_zk(zk) {} @@ -207,7 +207,7 @@ BOOST_AUTO_TEST_CASE(require_that_zkfacade_can_be_deleted_from_callback) } }; - boost::shared_ptr<Watcher> watcher((Watcher*)new DeleteZKFacadeWatcher(zk)); + std::shared_ptr<Watcher> watcher((Watcher*)new DeleteZKFacadeWatcher(zk)); zk->setData(testNode, "", 0); zk->getData(testNode, watcher); diff --git a/filedistribution/src/tests/zkfiledbmodel/test-zkfiledbmodel.cpp b/filedistribution/src/tests/zkfiledbmodel/test-zkfiledbmodel.cpp index b385949bb98..108278b2d24 100644 --- a/filedistribution/src/tests/zkfiledbmodel/test-zkfiledbmodel.cpp +++ b/filedistribution/src/tests/zkfiledbmodel/test-zkfiledbmodel.cpp @@ -26,10 +26,10 @@ namespace { struct Fixture { - boost::shared_ptr<ExceptionRethrower> _exceptionRethrower; + std::shared_ptr<ExceptionRethrower> _exceptionRethrower; ComponentsDeleter _componentsDeleter; - boost::shared_ptr<ZKFacade> zk; - boost::shared_ptr<ZKFileDBModel> model; + std::shared_ptr<ZKFacade> zk; + std::shared_ptr<ZKFileDBModel> model; Fixture() { _exceptionRethrower.reset(new ExceptionRethrower()); |