2010-08-04 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Rewritten ut_pex peer selection.
	* src/DefaultBtInteractive.cc
	* src/DefaultPeerStorage.cc
	* src/DefaultPeerStorage.h
	* src/PeerStorage.h
	* src/UTPexExtensionMessage.h
	* test/DefaultPeerStorageTest.cc
	* test/MockPeerStorage.h
	* test/UTPexExtensionMessageTest.cc
This commit is contained in:
Tatsuhiro Tsujikawa 2010-08-04 12:25:46 +00:00
parent 2bd5020f81
commit 2176b68116
9 changed files with 71 additions and 20 deletions

View file

@ -228,7 +228,7 @@ void UTPexExtensionMessageTest::testAddDroppedPeer()
void UTPexExtensionMessageTest::testFreshPeersAreFull()
{
UTPexExtensionMessage msg(1);
CPPUNIT_ASSERT_EQUAL((size_t)30, msg.getMaxFreshPeer());
CPPUNIT_ASSERT_EQUAL((size_t)50, msg.getMaxFreshPeer());
msg.setMaxFreshPeer(2);
SharedHandle<Peer> p1(new Peer("192.168.0.1", 6881));
CPPUNIT_ASSERT(msg.addFreshPeer(p1));
@ -244,7 +244,7 @@ void UTPexExtensionMessageTest::testFreshPeersAreFull()
void UTPexExtensionMessageTest::testDroppedPeersAreFull()
{
UTPexExtensionMessage msg(1);
CPPUNIT_ASSERT_EQUAL((size_t)10, msg.getMaxDroppedPeer());
CPPUNIT_ASSERT_EQUAL((size_t)50, msg.getMaxDroppedPeer());
msg.setMaxDroppedPeer(2);
SharedHandle<Peer> p1(new Peer("192.168.0.1", 6881));
p1->startBadCondition();