Wrap BtMessage objects by std::unique_ptr instead of std::shared_ptr

This commit is contained in:
Tatsuhiro Tsujikawa 2013-06-30 16:55:15 +09:00
parent abcb0745ed
commit 098f1571be
71 changed files with 816 additions and 852 deletions

View file

@ -66,16 +66,14 @@ void UTMetadataRequestFactoryTest::testCreate()
(new UTMetadataRequestTracker());
factory.setUTMetadataRequestTracker(tracker.get());
std::vector<std::shared_ptr<BtMessage> > msgs;
factory.create(msgs, 1, ps);
auto msgs = factory.create(1, ps);
CPPUNIT_ASSERT_EQUAL((size_t)1, msgs.size());
factory.create(msgs, 1, ps);
CPPUNIT_ASSERT_EQUAL((size_t)2, msgs.size());
msgs = factory.create(1, ps);
CPPUNIT_ASSERT_EQUAL((size_t)1, msgs.size());
factory.create(msgs, 1, ps);
CPPUNIT_ASSERT_EQUAL((size_t)2, msgs.size());
msgs = factory.create(1, ps);
CPPUNIT_ASSERT_EQUAL((size_t)0, msgs.size());
}
} // namespace aria2