mirror of
https://github.com/aria2/aria2.git
synced 2025-04-05 05:27:38 +03:00
Use user-defined literal for k, m, and g (powers of 1024)
This commit is contained in:
parent
8ba9b04747
commit
318c804504
99 changed files with 482 additions and 453 deletions
|
@ -25,9 +25,9 @@ CPPUNIT_TEST_SUITE_REGISTRATION( GrowSegmentTest );
|
|||
void GrowSegmentTest::testUpdateWrittenLength()
|
||||
{
|
||||
GrowSegment segment(std::shared_ptr<Piece>(new Piece()));
|
||||
segment.updateWrittenLength(32*1024);
|
||||
segment.updateWrittenLength(32_k);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL((int64_t)32*1024, segment.getPositionToWrite());
|
||||
CPPUNIT_ASSERT_EQUAL((int64_t)32_k, segment.getPositionToWrite());
|
||||
CPPUNIT_ASSERT(!segment.complete());
|
||||
CPPUNIT_ASSERT(segment.getPiece()->pieceComplete());
|
||||
}
|
||||
|
@ -35,8 +35,8 @@ void GrowSegmentTest::testUpdateWrittenLength()
|
|||
void GrowSegmentTest::testClear()
|
||||
{
|
||||
GrowSegment segment(std::shared_ptr<Piece>(new Piece()));
|
||||
segment.updateWrittenLength(32*1024);
|
||||
CPPUNIT_ASSERT_EQUAL((int64_t)32*1024, segment.getWrittenLength());
|
||||
segment.updateWrittenLength(32_k);
|
||||
CPPUNIT_ASSERT_EQUAL((int64_t)32_k, segment.getWrittenLength());
|
||||
segment.clear(nullptr);
|
||||
CPPUNIT_ASSERT_EQUAL((int64_t)0, segment.getWrittenLength());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue