mirror of
https://github.com/aria2/aria2.git
synced 2025-01-09 03:21:33 +00:00
048a2cf597
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.
39 lines
1023 B
C++
39 lines
1023 B
C++
#include "MetalinkPostDownloadHandler.h"
|
|
#include "RequestGroup.h"
|
|
#include "Option.h"
|
|
#include <cppunit/extensions/HelperMacros.h>
|
|
|
|
class MetalinkPostDownloadHandlerTest:public CppUnit::TestFixture {
|
|
|
|
CPPUNIT_TEST_SUITE(MetalinkPostDownloadHandlerTest);
|
|
CPPUNIT_TEST(testCanHandle);
|
|
CPPUNIT_TEST(testGetNextRequestGroups);
|
|
CPPUNIT_TEST_SUITE_END();
|
|
private:
|
|
|
|
public:
|
|
void setUp() {}
|
|
|
|
void testCanHandle();
|
|
void testGetNextRequestGroups();
|
|
};
|
|
|
|
|
|
CPPUNIT_TEST_SUITE_REGISTRATION( MetalinkPostDownloadHandlerTest );
|
|
|
|
void MetalinkPostDownloadHandlerTest::testCanHandle()
|
|
{
|
|
Option op;
|
|
MetalinkPostDownloadHandler handler(&op);
|
|
CPPUNIT_ASSERT(!handler.canHandle(".metalink!!"));
|
|
CPPUNIT_ASSERT(handler.canHandle(".metalink"));
|
|
}
|
|
|
|
void MetalinkPostDownloadHandlerTest::testGetNextRequestGroups()
|
|
{
|
|
Option op;
|
|
MetalinkPostDownloadHandler handler(&op);
|
|
RequestGroups groups = handler.getNextRequestGroups("test.xml");
|
|
CPPUNIT_ASSERT_EQUAL((size_t)6/* 5 + 1 torrent file download */, groups.size());
|
|
}
|