mirror of
https://github.com/aria2/aria2.git
synced 2025-04-05 13:37:40 +03:00
Use std::unique_ptr to store DHTMessages instead of std::shared_ptr
This commit is contained in:
parent
4f7d1c395b
commit
1a5d75e819
53 changed files with 833 additions and 872 deletions
|
@ -33,14 +33,17 @@ CPPUNIT_TEST_SUITE_REGISTRATION(DHTMessageTrackerEntryTest);
|
|||
|
||||
void DHTMessageTrackerEntryTest::testMatch()
|
||||
{
|
||||
std::shared_ptr<DHTNode> localNode(new DHTNode());
|
||||
auto localNode = std::make_shared<DHTNode>();
|
||||
try {
|
||||
std::shared_ptr<DHTNode> node1(new DHTNode());
|
||||
std::shared_ptr<MockDHTMessage> msg1(new MockDHTMessage(localNode, node1));
|
||||
std::shared_ptr<DHTNode> node2(new DHTNode());
|
||||
std::shared_ptr<MockDHTMessage> msg2(new MockDHTMessage(localNode, node2));
|
||||
auto node1 = std::make_shared<DHTNode>();
|
||||
auto msg1 = make_unique<MockDHTMessage>(localNode, node1);
|
||||
auto node2 = std::make_shared<DHTNode>();
|
||||
auto msg2 = make_unique<MockDHTMessage>(localNode, node2);
|
||||
|
||||
DHTMessageTrackerEntry entry(msg1, 30);
|
||||
DHTMessageTrackerEntry entry(msg1->getRemoteNode(),
|
||||
msg1->getTransactionID(),
|
||||
msg1->getMessageType(),
|
||||
30);
|
||||
|
||||
CPPUNIT_ASSERT(entry.match(msg1->getTransactionID(),
|
||||
msg1->getRemoteNode()->getIPAddress(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue