aria2/test/MockSegment.h

77 lines
1.3 KiB
C
Raw Normal View History

#ifndef D_MOCK_SEGMENT_H
#define D_MOCK_SEGMENT_H
#include "Segment.h"
#include "Piece.h"
#include "A2STR.h"
namespace aria2 {
class MockSegment:public Segment {
public:
2013-07-06 09:15:09 +00:00
virtual bool complete() const CXX11_OVERRIDE
{
return false;
}
2013-07-06 09:15:09 +00:00
virtual size_t getIndex() const CXX11_OVERRIDE
{
return 0;
}
2013-07-06 09:15:09 +00:00
virtual int64_t getPosition() const CXX11_OVERRIDE
{
return 0;
}
2012-10-01 14:52:22 +00:00
2013-07-06 09:15:09 +00:00
virtual int64_t getPositionToWrite() const CXX11_OVERRIDE
{
return 0;
}
2013-07-06 09:15:09 +00:00
virtual int32_t getLength() const CXX11_OVERRIDE
{
return 0;
}
2013-07-06 09:15:09 +00:00
virtual int32_t getSegmentLength() const CXX11_OVERRIDE
{
return 0;
}
2013-07-06 09:15:09 +00:00
virtual int32_t getWrittenLength() const CXX11_OVERRIDE
{
return 0;
}
2013-07-06 09:15:09 +00:00
virtual void updateWrittenLength(int32_t bytes) CXX11_OVERRIDE {}
// `begin' is a offset inside this segment.
virtual bool updateHash
2013-07-06 09:15:09 +00:00
(int32_t begin, const unsigned char* data, size_t dataLength) CXX11_OVERRIDE
{
return false;
}
2013-07-06 09:15:09 +00:00
virtual bool isHashCalculated() const CXX11_OVERRIDE
{
return false;
}
2013-07-06 09:15:09 +00:00
virtual std::string getDigest() CXX11_OVERRIDE
{
return A2STR::NIL;
}
2013-07-06 09:15:09 +00:00
virtual void clear(WrDiskCache* diskCache) CXX11_OVERRIDE {}
2013-07-06 09:15:09 +00:00
virtual std::shared_ptr<Piece> getPiece() const CXX11_OVERRIDE
{
return std::shared_ptr<Piece>(new Piece());
}
};
} // namespace aria2
#endif // D_MOCK_SEGMENT_H