mirror of
https://github.com/aria2/aria2.git
synced 2025-04-06 05:57:36 +03:00
2010-11-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
To match the behavior of friend operator functions in SharedHandle.h to std::tr1::shared_ptr, we intentionally broke these functions and modified code so that our code does not depend on old behavior. * src/AbstractCommand.cc * src/DHTAbstractNodeLookupTask.h * src/DHTBucket.cc * src/DHTMessageReceiver.cc * src/DHTNodeLookupEntry.cc * src/DHTRoutingTable.cc * src/DefaultBtRequestFactory.cc * src/DefaultPeerStorage.cc * src/DefaultPieceStorage.cc * src/DownloadContext.cc * src/EpollEventPoll.cc * src/Event.h * src/HttpConnection.cc * src/KqueueEventPoll.cc * src/MultiDiskAdaptor.cc * src/PeerAbstractCommand.cc * src/PieceStatMan.cc * src/PollEventPoll.cc * src/PortEventPoll.cc * src/SegmentMan.cc * src/SelectEventPoll.cc * src/SelectEventPoll.h * src/ServerStatMan.cc * src/SharedHandle.h * src/UnknownLengthPieceStorage.cc * src/a2functional.h * src/option_processing.cc * src/version_usage.cc * test/BNodeTest.cc * test/DHTAnnouncePeerMessageTest.cc * test/DHTBucketTest.cc * test/DHTFindNodeMessageTest.cc * test/DHTGetPeersMessageTest.cc * test/DHTIDCloserTest.cc * test/DHTMessageFactoryImplTest.cc * test/DHTPingMessageTest.cc * test/DefaultBtRequestFactoryTest.cc * test/DefaultPeerStorageTest.cc * test/SequentialPickerTest.cc * test/SingletonHolderTest.cc
This commit is contained in:
parent
bcf4593bda
commit
bc98e39fe5
41 changed files with 306 additions and 167 deletions
|
@ -121,7 +121,8 @@ void DefaultPeerStorageTest::testAddPeer() {
|
|||
CPPUNIT_ASSERT(ps.addPeer(peer4));
|
||||
// peer2 was deleted. While peer1 is oldest, its cuid is not 0.
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)3, ps.countPeer());
|
||||
CPPUNIT_ASSERT(std::find(ps.getPeers().begin(), ps.getPeers().end(), peer2) == ps.getPeers().end());
|
||||
CPPUNIT_ASSERT(std::find_if(ps.getPeers().begin(), ps.getPeers().end(),
|
||||
derefEqual(peer2)) == ps.getPeers().end());
|
||||
|
||||
SharedHandle<Peer> peer5(new Peer("192.168.0.4", 0));
|
||||
|
||||
|
@ -224,13 +225,14 @@ void DefaultPeerStorageTest::testReturnPeer()
|
|||
|
||||
ps.returnPeer(peer2); // peer2 removed from the container
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)2, ps.getPeers().size());
|
||||
CPPUNIT_ASSERT(std::find(ps.getPeers().begin(), ps.getPeers().end(), peer2)
|
||||
== ps.getPeers().end());
|
||||
CPPUNIT_ASSERT(std::find_if(ps.getPeers().begin(), ps.getPeers().end(),
|
||||
derefEqual(peer2)) == ps.getPeers().end());
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)1, ps.getDroppedPeers().size());
|
||||
|
||||
ps.returnPeer(peer1); // peer1 is removed from the container
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)1, ps.getPeers().size());
|
||||
CPPUNIT_ASSERT(std::find(ps.getPeers().begin(), ps.getPeers().end(), peer1) == ps.getPeers().end());
|
||||
CPPUNIT_ASSERT(std::find_if(ps.getPeers().begin(), ps.getPeers().end(),
|
||||
derefEqual(peer1)) == ps.getPeers().end());
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)1, ps.getDroppedPeers().size());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue