diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-11-24 16:42:55 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-11-24 16:42:55 +0000 |
| commit | 3fa6ce55f4107ae79f108ec7ffbdbd9e26fca398 (patch) | |
| tree | 4a94ba9655be57b9eeab57603a82a671a2c896ef /test/UTMetadataPostDownloadHandlerTest.cc | |
| parent | 656cbd16a0ca0a9d7066c0e0abd3c7bf5e72fc85 (diff) | |
2009-11-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that trackers in BitTorrent Magnet URI are not
inherited to generated RequestGroup.
* src/UTMetadataPostDownloadHandler.cc
* test/UTMetadataPostDownloadHandlerTest.cc
Diffstat (limited to 'test/UTMetadataPostDownloadHandlerTest.cc')
| -rw-r--r-- | test/UTMetadataPostDownloadHandlerTest.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/UTMetadataPostDownloadHandlerTest.cc b/test/UTMetadataPostDownloadHandlerTest.cc index 30578005..88b0eb73 100644 --- a/test/UTMetadataPostDownloadHandlerTest.cc +++ b/test/UTMetadataPostDownloadHandlerTest.cc @@ -73,6 +73,8 @@ void UTMetadataPostDownloadHandlerTest::testGetNextRequestGroups() BDE attrs = BDE::dict(); attrs[bittorrent::INFO_HASH] = std::string(&infoHash[0], &infoHash[20]); BDE announceList = BDE::list(); + announceList << BDE::list(); + announceList[0] << std::string("http://tracker"); attrs[bittorrent::ANNOUNCE_LIST] = announceList; _dctx->setAttribute(bittorrent::BITTORRENT, attrs); _requestGroup->setDiskWriterFactory @@ -93,6 +95,9 @@ void UTMetadataPostDownloadHandlerTest::testGetNextRequestGroups() CPPUNIT_ASSERT_EQUAL(util::toHex(attrs[bittorrent::INFO_HASH].s()), util::toHex(newAttrs[bittorrent::INFO_HASH].s())); CPPUNIT_ASSERT(newAttrs.containsKey(bittorrent::ANNOUNCE_LIST)); + CPPUNIT_ASSERT_EQUAL((size_t)1, newAttrs[bittorrent::ANNOUNCE_LIST].size()); + CPPUNIT_ASSERT_EQUAL(std::string("http://tracker"), + newAttrs[bittorrent::ANNOUNCE_LIST][0][0].s()); CPPUNIT_ASSERT_EQUAL(_option->get("Hello"), newRg->getOption()->get("Hello")); |
