mirror of https://github.com/aria2/aria2
2008-08-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Eliminated randomness from the test case. Removed #ifdef __MINGW32 directive. * test/DefaultPieceStorageTest.ccpull/1/head
parent
fcb7254bf5
commit
4baee78941
|
@ -1,3 +1,9 @@
|
||||||
|
2008-08-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
|
Eliminated randomness from the test case. Removed #ifdef __MINGW32
|
||||||
|
directive.
|
||||||
|
* test/DefaultPieceStorageTest.cc
|
||||||
|
|
||||||
2008-08-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
2008-08-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
Fixed memory leak in test code
|
Fixed memory leak in test code
|
||||||
|
|
|
@ -95,7 +95,7 @@ void DefaultPieceStorageTest::testGetMissingPiece() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DefaultPieceStorageTest::testGetMissingFastPiece() {
|
void DefaultPieceStorageTest::testGetMissingFastPiece() {
|
||||||
DefaultPieceStorage pss(btContext, option);
|
DefaultPieceStorage pss(btContext, option, false);
|
||||||
pss.setEndGamePieceNum(0);
|
pss.setEndGamePieceNum(0);
|
||||||
|
|
||||||
peer->setAllBitfield();
|
peer->setAllBitfield();
|
||||||
|
@ -118,19 +118,14 @@ void DefaultPieceStorageTest::testHasMissingPiece() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DefaultPieceStorageTest::testCompletePiece() {
|
void DefaultPieceStorageTest::testCompletePiece() {
|
||||||
DefaultPieceStorage pss(btContext, option, true);
|
DefaultPieceStorage pss(btContext, option, false);
|
||||||
pss.setEndGamePieceNum(0);
|
pss.setEndGamePieceNum(0);
|
||||||
|
|
||||||
peer->setAllBitfield();
|
peer->setAllBitfield();
|
||||||
|
|
||||||
SharedHandle<Piece> piece = pss.getMissingPiece(peer);
|
SharedHandle<Piece> piece = pss.getMissingPiece(peer);
|
||||||
#ifdef __MINGW32__
|
|
||||||
CPPUNIT_ASSERT_EQUAL(std::string("piece: index=2, length=128"),
|
|
||||||
piece->toString());
|
|
||||||
#else // !__MINGW32__
|
|
||||||
CPPUNIT_ASSERT_EQUAL(std::string("piece: index=0, length=128"),
|
CPPUNIT_ASSERT_EQUAL(std::string("piece: index=0, length=128"),
|
||||||
piece->toString());
|
piece->toString());
|
||||||
#endif // !__MINGW32__
|
|
||||||
|
|
||||||
CPPUNIT_ASSERT_EQUAL((uint64_t)0ULL, pss.getCompletedLength());
|
CPPUNIT_ASSERT_EQUAL((uint64_t)0ULL, pss.getCompletedLength());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue