mirror of
https://github.com/aria2/aria2.git
synced 2025-04-05 05:27:38 +03:00
2008-02-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Removed "using namespace std;" from all sources. Appended std:: prefix to c++ standard classes. Included string.h where mem* function are used.
This commit is contained in:
parent
d82e183d34
commit
1b7c198289
801 changed files with 12024 additions and 8627 deletions
|
@ -3,8 +3,11 @@
|
|||
#include "RequestGroup.h"
|
||||
#include "Option.h"
|
||||
#include "SingleFileDownloadContext.h"
|
||||
#include "FileEntry.h"
|
||||
#include <cppunit/extensions/HelperMacros.h>
|
||||
|
||||
namespace aria2 {
|
||||
|
||||
class BtPostDownloadHandlerTest:public CppUnit::TestFixture {
|
||||
|
||||
CPPUNIT_TEST_SUITE(BtPostDownloadHandlerTest);
|
||||
|
@ -28,8 +31,8 @@ CPPUNIT_TEST_SUITE_REGISTRATION( BtPostDownloadHandlerTest );
|
|||
void BtPostDownloadHandlerTest::testCanHandle_extension()
|
||||
{
|
||||
Option op;
|
||||
SingleFileDownloadContextHandle dctx = new SingleFileDownloadContext(0, 0, "test.torrent");
|
||||
RequestGroup rg(&op, Strings());
|
||||
SharedHandle<SingleFileDownloadContext> dctx = new SingleFileDownloadContext(0, 0, "test.torrent");
|
||||
RequestGroup rg(&op, std::deque<std::string>());
|
||||
rg.setDownloadContext(dctx);
|
||||
|
||||
BtPostDownloadHandler handler;
|
||||
|
@ -43,9 +46,9 @@ void BtPostDownloadHandlerTest::testCanHandle_extension()
|
|||
void BtPostDownloadHandlerTest::testCanHandle_contentType()
|
||||
{
|
||||
Option op;
|
||||
SingleFileDownloadContextHandle dctx = new SingleFileDownloadContext(0, 0, "test");
|
||||
SharedHandle<SingleFileDownloadContext> dctx = new SingleFileDownloadContext(0, 0, "test");
|
||||
dctx->setContentType("application/x-bittorrent");
|
||||
RequestGroup rg(&op, Strings());
|
||||
RequestGroup rg(&op, std::deque<std::string>());
|
||||
rg.setDownloadContext(dctx);
|
||||
|
||||
BtPostDownloadHandler handler;
|
||||
|
@ -59,15 +62,17 @@ void BtPostDownloadHandlerTest::testCanHandle_contentType()
|
|||
void BtPostDownloadHandlerTest::testGetNextRequestGroups()
|
||||
{
|
||||
Option op;
|
||||
SingleFileDownloadContextHandle dctx = new SingleFileDownloadContext(0, 0, "test.torrent");
|
||||
RequestGroup rg(&op, Strings());
|
||||
SharedHandle<SingleFileDownloadContext> dctx = new SingleFileDownloadContext(0, 0, "test.torrent");
|
||||
RequestGroup rg(&op, std::deque<std::string>());
|
||||
rg.setDownloadContext(dctx);
|
||||
rg.initPieceStorage();
|
||||
|
||||
BtPostDownloadHandler handler;
|
||||
RequestGroups groups = handler.getNextRequestGroups(&rg);
|
||||
std::deque<SharedHandle<RequestGroup> > groups = handler.getNextRequestGroups(&rg);
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)1, groups.size());
|
||||
BtContextHandle btctx = groups.front()->getDownloadContext();
|
||||
SharedHandle<BtContext> btctx = groups.front()->getDownloadContext();
|
||||
CPPUNIT_ASSERT(!btctx.isNull());
|
||||
CPPUNIT_ASSERT_EQUAL(string("aria2-test"), btctx->getName());
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("aria2-test"), btctx->getName());
|
||||
}
|
||||
|
||||
} // namespace aria2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue