summaryrefslogtreecommitdiff
path: root/test/BtPostDownloadHandlerTest.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-12-02 22:38:36 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-12-02 22:52:35 +0900
commit3ee6784b7680ea941ec4ddd727b481d44d093953 (patch)
tree48b609b276283df0add56c6328b19a2f2f4f4f16 /test/BtPostDownloadHandlerTest.cc
parent7ac1f17d56b9182ad3dfc262ec363e906943e64b (diff)
Made `make distcheck' pass.
We added 2 macros A2_TEST_DIR and A2_TEST_OUT_DIR to pass tests in `make distcheck`. A2_TEST_DIR refers to test directory. All output files by unit tests are now created under A2_TEST_OUT_DIR directory.
Diffstat (limited to 'test/BtPostDownloadHandlerTest.cc')
-rw-r--r--test/BtPostDownloadHandlerTest.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/BtPostDownloadHandlerTest.cc b/test/BtPostDownloadHandlerTest.cc
index c7808d08..606a5c07 100644
--- a/test/BtPostDownloadHandlerTest.cc
+++ b/test/BtPostDownloadHandlerTest.cc
@@ -7,6 +7,8 @@
#include "Option.h"
#include "FileEntry.h"
#include "bittorrent_helper.h"
+#include "PieceStorage.h"
+#include "DiskAdaptor.h"
namespace aria2 {
@@ -35,7 +37,8 @@ CPPUNIT_TEST_SUITE_REGISTRATION( BtPostDownloadHandlerTest );
void BtPostDownloadHandlerTest::testCanHandle_extension()
{
- SharedHandle<DownloadContext> dctx(new DownloadContext(0, 0, "test.torrent"));
+ SharedHandle<DownloadContext> dctx
+ (new DownloadContext(0, 0, A2_TEST_DIR"/test.torrent"));
RequestGroup rg(option_);
rg.setDownloadContext(dctx);
@@ -43,7 +46,7 @@ void BtPostDownloadHandlerTest::testCanHandle_extension()
CPPUNIT_ASSERT(handler.canHandle(&rg));
- dctx->getFirstFileEntry()->setPath("test.torrent2");
+ dctx->getFirstFileEntry()->setPath(A2_TEST_DIR"/test.torrent2");
CPPUNIT_ASSERT(!handler.canHandle(&rg));
}
@@ -65,10 +68,11 @@ void BtPostDownloadHandlerTest::testCanHandle_contentType()
void BtPostDownloadHandlerTest::testGetNextRequestGroups()
{
SharedHandle<DownloadContext> dctx
- (new DownloadContext(1024, 0, "test.torrent"));
+ (new DownloadContext(1024, 0, A2_TEST_DIR"/test.torrent"));
RequestGroup rg(option_);
rg.setDownloadContext(dctx);
rg.initPieceStorage();
+ rg.getPieceStorage()->getDiskAdaptor()->enableReadOnly();
BtPostDownloadHandler handler;
std::vector<SharedHandle<RequestGroup> > groups;