AbstractSingleDiskAdaptor: Use std::unique_ptr for diskWriter_

This commit is contained in:
Tatsuhiro Tsujikawa 2013-07-05 22:40:29 +09:00
parent f8d305fe63
commit ae84ff26e2
9 changed files with 60 additions and 54 deletions

View file

@ -66,8 +66,12 @@ void UTMetadataDataExtensionMessageTest::testToString()
void UTMetadataDataExtensionMessageTest::testDoReceivedAction()
{
auto diskAdaptor = std::make_shared<DirectDiskAdaptor>();
auto diskWriter = std::make_shared<ByteArrayDiskWriter>();
diskAdaptor->setDiskWriter(diskWriter);
ByteArrayDiskWriter* diskWriter;
{
auto dw = make_unique<ByteArrayDiskWriter>();
diskWriter = dw.get();
diskAdaptor->setDiskWriter(std::move(dw));
}
auto pieceStorage = make_unique<MockPieceStorage>();
pieceStorage->setDiskAdaptor(diskAdaptor);
auto tracker = make_unique<UTMetadataRequestTracker>();