mirror of
https://github.com/aria2/aria2.git
synced 2025-04-05 21:47:37 +03:00
2009-06-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed _uris from RequestGroup. All functions that refer to _uris were moved to FileEntry. Exit status code are now defined in DownloadResultCode.h. * src/AbstractCommand.cc * src/AdaptiveURISelector.cc * src/AdaptiveURISelector.h * src/AutoSaveCommand.cc * src/BtPostDownloadHandler.cc * src/CheckIntegrityDispatcherCommand.cc * src/CookieStorage.cc * src/DHTAutoSaveCommand.cc * src/DHTBucketRefreshCommand.cc * src/DHTEntryPointNameResolveCommand.cc * src/DHTInteractionCommand.cc * src/DHTPeerAnnounceCommand.cc * src/DHTTokenUpdateCommand.cc * src/DlAbortEx.h * src/DlRetryEx.h * src/DownloadCommand.cc * src/DownloadContext.h * src/DownloadFailureException.h * src/DownloadResult.h * src/DownloadResultCode.h * src/FeedbackURISelector.cc * src/FeedbackURISelector.h * src/FileEntry.cc * src/FileEntry.h * src/FtpNegotiationCommand.cc * src/HttpListenCommand.cc * src/HttpResponseCommand.cc * src/HttpServerResponseCommand.cc * src/HttpSkipResponseCommand.cc * src/InOrderURISelector.cc * src/InOrderURISelector.h * src/Makefile.am * src/Makefile.in * src/Metalink2RequestGroup.cc * src/MultiUrlRequestInfo.cc * src/MultiUrlRequestInfo.h * src/OptionHandlerFactory.cc * src/PeerListenCommand.cc * src/RecoverableException.h * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/TimedHaltCommand.cc * src/TrackerWatcherCommand.cc * src/URIResult.cc * src/URIResult.h * src/URISelector.h * src/XmlRpcMethodImpl.cc * src/bittorrent_helper.cc * src/bittorrent_helper.h * src/download_helper.cc * src/main.cc * src/option_processing.cc * test/BtDependencyTest.cc * test/BtPostDownloadHandlerTest.cc * test/CookieStorageTest.cc * test/DefaultBtMessageDispatcherTest.cc * test/DownloadHandlerFactoryTest.cc * test/DownloadHelperTest.cc * test/FeedbackURISelectorTest.cc * test/FileEntryTest.cc * test/InOrderURISelectorTest.cc * test/Metalink2RequestGroupTest.cc * test/MetalinkPostDownloadHandlerTest.cc * test/RequestGroupManTest.cc * test/RequestGroupTest.cc * test/XmlRpcMethodTest.cc
This commit is contained in:
parent
8122399ca7
commit
e82f870fdc
69 changed files with 640 additions and 442 deletions
|
@ -82,7 +82,7 @@ void DownloadHelperTest::testCreateRequestGroupForUri()
|
|||
CPPUNIT_ASSERT_EQUAL((size_t)1, result.size());
|
||||
SharedHandle<RequestGroup> group = result[0];
|
||||
std::deque<std::string> uris;
|
||||
group->getURIs(uris);
|
||||
group->getDownloadContext()->getFirstFileEntry()->getUris(uris);
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)3, uris.size());
|
||||
for(size_t i = 0; i < arrayLength(array); ++i) {
|
||||
CPPUNIT_ASSERT_EQUAL(array[i], uris[i]);
|
||||
|
@ -101,7 +101,7 @@ void DownloadHelperTest::testCreateRequestGroupForUri()
|
|||
CPPUNIT_ASSERT_EQUAL((size_t)1, result.size());
|
||||
SharedHandle<RequestGroup> group = result[0];
|
||||
std::deque<std::string> uris;
|
||||
group->getURIs(uris);
|
||||
group->getDownloadContext()->getFirstFileEntry()->getUris(uris);
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)5, uris.size());
|
||||
for(size_t i = 0; i < arrayLength(array); ++i) {
|
||||
CPPUNIT_ASSERT_EQUAL(array[i], uris[i]);
|
||||
|
@ -120,7 +120,7 @@ void DownloadHelperTest::testCreateRequestGroupForUri()
|
|||
CPPUNIT_ASSERT_EQUAL((size_t)1, result.size());
|
||||
SharedHandle<RequestGroup> group = result[0];
|
||||
std::deque<std::string> uris;
|
||||
group->getURIs(uris);
|
||||
group->getDownloadContext()->getFirstFileEntry()->getUris(uris);
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)3, uris.size());
|
||||
for(size_t i = 0; i < arrayLength(array); ++i) {
|
||||
CPPUNIT_ASSERT_EQUAL(array[i], uris[i]);
|
||||
|
@ -138,7 +138,7 @@ void DownloadHelperTest::testCreateRequestGroupForUri()
|
|||
// for alpha server
|
||||
SharedHandle<RequestGroup> alphaGroup = result[0];
|
||||
std::deque<std::string> alphaURIs;
|
||||
alphaGroup->getURIs(alphaURIs);
|
||||
alphaGroup->getDownloadContext()->getFirstFileEntry()->getUris(alphaURIs);
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)2, alphaURIs.size());
|
||||
for(size_t i = 0; i < 2; ++i) {
|
||||
CPPUNIT_ASSERT_EQUAL(array[0], uris[0]);
|
||||
|
@ -171,7 +171,7 @@ void DownloadHelperTest::testCreateRequestGroupForUri_parameterized()
|
|||
CPPUNIT_ASSERT_EQUAL((size_t)1, result.size());
|
||||
SharedHandle<RequestGroup> group = result[0];
|
||||
std::deque<std::string> uris;
|
||||
group->getURIs(uris);
|
||||
group->getDownloadContext()->getFirstFileEntry()->getUris(uris);
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)3, uris.size());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("http://alpha/file"), uris[0]);
|
||||
|
@ -206,7 +206,7 @@ void DownloadHelperTest::testCreateRequestGroupForUri_BitTorrent()
|
|||
CPPUNIT_ASSERT_EQUAL((size_t)2, result.size());
|
||||
SharedHandle<RequestGroup> group = result[0];
|
||||
std::deque<std::string> uris;
|
||||
group->getURIs(uris);
|
||||
group->getDownloadContext()->getFirstFileEntry()->getUris(uris);
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)3, uris.size());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(array[0], uris[0]);
|
||||
|
@ -221,7 +221,7 @@ void DownloadHelperTest::testCreateRequestGroupForUri_BitTorrent()
|
|||
|
||||
SharedHandle<RequestGroup> torrentGroup = result[1];
|
||||
std::deque<std::string> auxURIs;
|
||||
torrentGroup->getURIs(auxURIs);
|
||||
torrentGroup->getDownloadContext()->getFirstFileEntry()->getUris(auxURIs);
|
||||
CPPUNIT_ASSERT(auxURIs.empty());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)3,
|
||||
torrentGroup->getNumConcurrentCommand());
|
||||
|
@ -262,7 +262,7 @@ void DownloadHelperTest::testCreateRequestGroupForUri_Metalink()
|
|||
|
||||
SharedHandle<RequestGroup> group = result[0];
|
||||
std::deque<std::string> uris;
|
||||
group->getURIs(uris);
|
||||
group->getDownloadContext()->getFirstFileEntry()->getUris(uris);
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)3, uris.size());
|
||||
for(size_t i = 0; i < 3; ++i) {
|
||||
CPPUNIT_ASSERT_EQUAL(array[i], uris[i]);
|
||||
|
@ -304,7 +304,7 @@ void DownloadHelperTest::testCreateRequestGroupForUriList()
|
|||
|
||||
SharedHandle<RequestGroup> fileGroup = result[0];
|
||||
std::deque<std::string> fileURIs;
|
||||
fileGroup->getURIs(fileURIs);
|
||||
fileGroup->getDownloadContext()->getFirstFileEntry()->getUris(fileURIs);
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("http://alpha/file"), fileURIs[0]);
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("http://bravo/file"), fileURIs[1]);
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("http://charlie/file"), fileURIs[2]);
|
||||
|
@ -344,13 +344,11 @@ void DownloadHelperTest::testCreateRequestGroupForBitTorrent()
|
|||
|
||||
SharedHandle<RequestGroup> group = result[0];
|
||||
std::deque<std::string> uris;
|
||||
group->getURIs(uris);
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)5, uris.size());
|
||||
group->getDownloadContext()->getFirstFileEntry()->getUris(uris);
|
||||
// See -s option is ignored
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)3, uris.size());
|
||||
for(size_t i = 0; i < arrayLength(array); ++i) {
|
||||
CPPUNIT_ASSERT_EQUAL(array[i], uris[i]);
|
||||
}
|
||||
for(size_t i = 0; i < 5-arrayLength(array); ++i) {
|
||||
CPPUNIT_ASSERT_EQUAL(array[i], uris[i+arrayLength(array)]);
|
||||
CPPUNIT_ASSERT_EQUAL(array[i]+"/aria2-test/aria2/src/aria2c", uris[i]);
|
||||
}
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)5, group->getNumConcurrentCommand());
|
||||
}
|
||||
|
@ -363,7 +361,7 @@ void DownloadHelperTest::testCreateRequestGroupForBitTorrent()
|
|||
CPPUNIT_ASSERT_EQUAL((size_t)1, result.size());
|
||||
SharedHandle<RequestGroup> group = result[0];
|
||||
std::deque<std::string> uris;
|
||||
group->getURIs(uris);
|
||||
group->getDownloadContext()->getFirstFileEntry()->getUris(uris);
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)0, uris.size());
|
||||
}
|
||||
_option->put(PREF_FORCE_SEQUENTIAL, V_TRUE);
|
||||
|
@ -398,7 +396,7 @@ void DownloadHelperTest::testCreateRequestGroupForMetalink()
|
|||
#endif // !ENABLE_BITTORRENT
|
||||
SharedHandle<RequestGroup> group = result[0];
|
||||
std::deque<std::string> uris;
|
||||
group->getURIs(uris);
|
||||
group->getDownloadContext()->getFirstFileEntry()->getUris(uris);
|
||||
std::sort(uris.begin(), uris.end());
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)2, uris.size());
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("ftp://ftphost/aria2-0.5.2.tar.bz2"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue