mirror of
https://github.com/aria2/aria2.git
synced 2025-04-05 05:27:38 +03:00
make clang-format using clang-format-3.6
This commit is contained in:
parent
4abad2f64c
commit
b1132d6b10
1095 changed files with 30423 additions and 33770 deletions
|
@ -16,26 +16,28 @@
|
|||
|
||||
namespace aria2 {
|
||||
|
||||
class UTMetadataRequestFactoryTest:public CppUnit::TestFixture {
|
||||
class UTMetadataRequestFactoryTest : public CppUnit::TestFixture {
|
||||
|
||||
CPPUNIT_TEST_SUITE(UTMetadataRequestFactoryTest);
|
||||
CPPUNIT_TEST(testCreate);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
void testCreate();
|
||||
|
||||
class MockPieceStorage2:public MockPieceStorage {
|
||||
class MockPieceStorage2 : public MockPieceStorage {
|
||||
public:
|
||||
std::deque<size_t> missingIndexes;
|
||||
|
||||
virtual std::shared_ptr<Piece> getMissingPiece
|
||||
(const std::shared_ptr<Peer>& peer,
|
||||
const std::vector<size_t>& exlucdedIndexes,
|
||||
cuid_t cuid) CXX11_OVERRIDE
|
||||
virtual std::shared_ptr<Piece>
|
||||
getMissingPiece(const std::shared_ptr<Peer>& peer,
|
||||
const std::vector<size_t>& exlucdedIndexes,
|
||||
cuid_t cuid) CXX11_OVERRIDE
|
||||
{
|
||||
if(missingIndexes.empty()) {
|
||||
if (missingIndexes.empty()) {
|
||||
return nullptr;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
size_t index = missingIndexes.front();
|
||||
missingIndexes.pop_front();
|
||||
return std::make_shared<Piece>(index, 0);
|
||||
|
@ -44,13 +46,12 @@ public:
|
|||
};
|
||||
};
|
||||
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(UTMetadataRequestFactoryTest);
|
||||
|
||||
void UTMetadataRequestFactoryTest::testCreate()
|
||||
{
|
||||
UTMetadataRequestFactory factory;
|
||||
DownloadContext dctx{METADATA_PIECE_SIZE, METADATA_PIECE_SIZE*2};
|
||||
DownloadContext dctx{METADATA_PIECE_SIZE, METADATA_PIECE_SIZE * 2};
|
||||
factory.setDownloadContext(&dctx);
|
||||
MockPieceStorage2 ps;
|
||||
ps.missingIndexes.push_back(0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue