mirror of
https://github.com/aria2/aria2.git
synced 2025-04-06 05:57:36 +03:00
AbstractSingleDiskAdaptor: Use std::unique_ptr for diskWriter_
This commit is contained in:
parent
f8d305fe63
commit
ae84ff26e2
9 changed files with 60 additions and 54 deletions
|
@ -28,13 +28,14 @@ class PieceTest:public CppUnit::TestFixture {
|
|||
CPPUNIT_TEST_SUITE_END();
|
||||
private:
|
||||
std::shared_ptr<DirectDiskAdaptor> adaptor_;
|
||||
std::shared_ptr<ByteArrayDiskWriter> writer_;
|
||||
ByteArrayDiskWriter* writer_;
|
||||
public:
|
||||
void setUp()
|
||||
{
|
||||
adaptor_.reset(new DirectDiskAdaptor());
|
||||
writer_.reset(new ByteArrayDiskWriter());
|
||||
adaptor_->setDiskWriter(writer_);
|
||||
adaptor_ = std::make_shared<DirectDiskAdaptor>();
|
||||
auto dw = make_unique<ByteArrayDiskWriter>();
|
||||
writer_ = dw.get();
|
||||
adaptor_->setDiskWriter(std::move(dw));
|
||||
}
|
||||
|
||||
void testCompleteBlock();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue