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:
Tatsuhiro Tsujikawa 2009-06-29 08:42:58 +00:00
parent 8122399ca7
commit e82f870fdc
69 changed files with 640 additions and 442 deletions

View file

@ -117,7 +117,7 @@ void XmlRpcMethodTest::testAddUri()
_e->_requestGroupMan->getReservedGroups();
CPPUNIT_ASSERT_EQUAL((size_t)1, rgs.size());
CPPUNIT_ASSERT_EQUAL(std::string("http://localhost/"),
rgs.front()->getRemainingUris().front());
rgs.front()->getDownloadContext()->getFirstFileEntry()->getRemainingUris().front());
}
// with options
BDE opt = BDE::dict();
@ -180,7 +180,7 @@ void XmlRpcMethodTest::testAddUri_withPosition()
m.execute(req2, _e.get());
std::string uri =
_e->_requestGroupMan->getReservedGroups()[0]->getRemainingUris()[0];
_e->_requestGroupMan->getReservedGroups()[0]->getDownloadContext()->getFirstFileEntry()->getRemainingUris()[0];
CPPUNIT_ASSERT_EQUAL(std::string("http://uri2"), uri);
}
@ -215,9 +215,9 @@ void XmlRpcMethodTest::testAddTorrent()
CPPUNIT_ASSERT(!group.isNull());
CPPUNIT_ASSERT_EQUAL(std::string("/tmp/aria2-0.8.2.tar.bz2"),
group->getFirstFilePath());
CPPUNIT_ASSERT_EQUAL((size_t)1, group->getRemainingUris().size());
CPPUNIT_ASSERT_EQUAL((size_t)1, group->getDownloadContext()->getFirstFileEntry()->getRemainingUris().size());
CPPUNIT_ASSERT_EQUAL(std::string("http://localhost/aria2-0.8.2.tar.bz2"),
group->getRemainingUris()[0]);
group->getDownloadContext()->getFirstFileEntry()->getRemainingUris()[0]);
}
// with options
BDE opt = BDE::dict();
@ -349,8 +349,7 @@ void XmlRpcMethodTest::testAddMetalink_withPosition()
void XmlRpcMethodTest::testChangeOption()
{
SharedHandle<RequestGroup> group
(new RequestGroup(_option, std::deque<std::string>()));
SharedHandle<RequestGroup> group(new RequestGroup(_option));
_e->_requestGroupMan->addReservedGroup(group);
ChangeOptionXmlRpcMethod m;
@ -374,8 +373,7 @@ void XmlRpcMethodTest::testChangeOption()
void XmlRpcMethodTest::testChangeOption_withBadOption()
{
SharedHandle<RequestGroup> group
(new RequestGroup(_option, std::deque<std::string>()));
SharedHandle<RequestGroup> group(new RequestGroup(_option));
_e->_requestGroupMan->addReservedGroup(group);
ChangeOptionXmlRpcMethod m;