mirror of
https://github.com/aria2/aria2.git
synced 2025-04-05 21:47:37 +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
|
@ -60,7 +60,7 @@ void DirectDiskAdaptorTest::testWriteCache()
|
|||
adaptor->setDiskWriter(std::move(sdw));
|
||||
}
|
||||
WrDiskCacheEntry cache{adaptor};
|
||||
std::string data1(4096, '1'), data2(4094, '2');
|
||||
std::string data1(4_k, '1'), data2(4094, '2');
|
||||
cache.cacheData(createDataCell(5, data1.c_str()));
|
||||
cache.cacheData(createDataCell(5+data1.size(), data2.c_str()));
|
||||
adaptor->writeCache(&cache);
|
||||
|
@ -68,9 +68,9 @@ void DirectDiskAdaptorTest::testWriteCache()
|
|||
|
||||
cache.clear();
|
||||
dw->setString("");
|
||||
cache.cacheData(createDataCell(4096, data1.c_str()));
|
||||
cache.cacheData(createDataCell(4_k, data1.c_str()));
|
||||
adaptor->writeCache(&cache);
|
||||
CPPUNIT_ASSERT_EQUAL(data1, dw->getString().substr(4096));
|
||||
CPPUNIT_ASSERT_EQUAL(data1, dw->getString().substr(4_k));
|
||||
|
||||
cache.clear();
|
||||
dw->setString("???????");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue