mirror of
https://github.com/aria2/aria2.git
synced 2025-04-06 14:07:37 +03:00
Wrap BtMessage objects by std::unique_ptr instead of std::shared_ptr
This commit is contained in:
parent
abcb0745ed
commit
098f1571be
71 changed files with 816 additions and 852 deletions
|
@ -32,9 +32,8 @@ void BtSuggestPieceMessageTest::testCreate() {
|
|||
unsigned char msg[9];
|
||||
bittorrent::createPeerMessageString(msg, sizeof(msg), 5, 13);
|
||||
bittorrent::setIntParam(&msg[5], 12345);
|
||||
std::shared_ptr<BtSuggestPieceMessage> pm
|
||||
(BtSuggestPieceMessage::create(&msg[4], 5));
|
||||
CPPUNIT_ASSERT_EQUAL((uint8_t)13, pm->getId());
|
||||
auto pm = BtSuggestPieceMessage::create(&msg[4], 5);
|
||||
CPPUNIT_ASSERT(BtSuggestPieceMessage::ID == pm->getId());
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)12345, pm->getIndex());
|
||||
|
||||
// case: payload size is wrong
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue