aria2/test/GrowSegmentTest.cc
Tatsuhiro Tsujikawa 048a2cf597 2007-10-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Implemented BitTorrent/http/ftp integrated download.
	I've rewritten lots of files and now some headers have forward
	class declarations to reduce compile time.
	The implementation is extremely alpha stage, I recommend to use this
	for testing purpose only.
2007-10-11 16:58:24 +00:00

31 lines
701 B
C++

#include "GrowSegment.h"
#include "Piece.h"
#include <cppunit/extensions/HelperMacros.h>
using namespace std;
class GrowSegmentTest : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(GrowSegmentTest);
CPPUNIT_TEST(testUpdateWrittenLength);
CPPUNIT_TEST_SUITE_END();
private:
public:
void setUp() {}
void testUpdateWrittenLength();
};
CPPUNIT_TEST_SUITE_REGISTRATION( GrowSegmentTest );
void GrowSegmentTest::testUpdateWrittenLength()
{
GrowSegment segment(new Piece());
segment.updateWrittenLength(32*1024);
CPPUNIT_ASSERT_EQUAL((int64_t)32*1024, segment.getPositionToWrite());
CPPUNIT_ASSERT(!segment.complete());
CPPUNIT_ASSERT(segment.getPiece()->pieceComplete());
}