mirror of
https://github.com/aria2/aria2.git
synced 2025-04-05 05:27:38 +03:00
2008-03-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
type cleanup for allmost all remaining files.
This commit is contained in:
parent
ca3f6e57f3
commit
032c7c2808
278 changed files with 1489 additions and 1517 deletions
|
@ -50,14 +50,14 @@ public:
|
|||
class MockBtMessageFactory2 : public MockBtMessageFactory {
|
||||
public:
|
||||
virtual SharedHandle<BtMessage>
|
||||
createRequestMessage(const SharedHandle<Piece>& piece, int32_t blockIndex) {
|
||||
createRequestMessage(const SharedHandle<Piece>& piece, size_t blockIndex) {
|
||||
return new MockBtRequestMessage(piece->getIndex(), blockIndex);
|
||||
}
|
||||
};
|
||||
|
||||
class MockBtMessageDispatcher2 : public MockBtMessageDispatcher {
|
||||
public:
|
||||
virtual bool isOutstandingRequest(int32_t index, int32_t blockIndex) {
|
||||
virtual bool isOutstandingRequest(size_t index, size_t blockIndex) {
|
||||
return index == 0 && blockIndex == 0;
|
||||
}
|
||||
};
|
||||
|
@ -114,7 +114,7 @@ CPPUNIT_TEST_SUITE_REGISTRATION(DefaultBtRequestFactoryTest);
|
|||
void DefaultBtRequestFactoryTest::testAddTargetPiece() {
|
||||
SharedHandle<Piece> piece = new Piece(0, 16*1024);
|
||||
btRequestFactory->addTargetPiece(piece);
|
||||
CPPUNIT_ASSERT_EQUAL((int32_t)1, btRequestFactory->countTargetPiece());
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)1, btRequestFactory->countTargetPiece());
|
||||
}
|
||||
|
||||
void DefaultBtRequestFactoryTest::testRemoveCompletedPiece() {
|
||||
|
@ -123,9 +123,9 @@ void DefaultBtRequestFactoryTest::testRemoveCompletedPiece() {
|
|||
piece2->setAllBlock();
|
||||
btRequestFactory->addTargetPiece(piece1);
|
||||
btRequestFactory->addTargetPiece(piece2);
|
||||
CPPUNIT_ASSERT_EQUAL((int32_t)2, btRequestFactory->countTargetPiece());
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)2, btRequestFactory->countTargetPiece());
|
||||
btRequestFactory->removeCompletedPiece();
|
||||
CPPUNIT_ASSERT_EQUAL((int32_t)1, btRequestFactory->countTargetPiece());
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)1, btRequestFactory->countTargetPiece());
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)0, btRequestFactory->getTargetPieces().front()->getIndex());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue