2010-03-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Fixed compile error with --disable-bittorrent
	* test/Metalink2RequestGroupTest.cc
	* test/MetalinkParserControllerTest.cc
pull/1/head
Tatsuhiro Tsujikawa 2010-03-07 15:37:18 +00:00
parent 49169c93ba
commit 5f376f3c60
3 changed files with 40 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2010-03-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed compile error with --disable-bittorrent
* test/Metalink2RequestGroupTest.cc
* test/MetalinkParserControllerTest.cc
2010-03-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added --reuse-uri option. This option has existed quite long, but

View File

@ -129,6 +129,8 @@ void Metalink2RequestGroupTest::testGenerate_groupByMetaurl()
Metalink2RequestGroup().generate(groups, "metalink4-groupbymetaurl.xml",
_option);
CPPUNIT_ASSERT_EQUAL((size_t)3, groups.size());
#ifdef ENABLE_BITTORRENT
// first RequestGroup is torrent for second RequestGroup
{
SharedHandle<RequestGroup> rg = groups[0];
@ -167,6 +169,30 @@ void Metalink2RequestGroupTest::testGenerate_groupByMetaurl()
CPPUNIT_ASSERT_EQUAL(std::string("http://file2p1"),
fileEntries[0]->getRemainingUris()[0]);
}
#else // !ENABLE_BITTORRENT
{
SharedHandle<RequestGroup> rg = groups[0];
std::vector<std::string> uris;
rg->getDownloadContext()->getFirstFileEntry()->getUris(uris);
CPPUNIT_ASSERT_EQUAL((size_t)1, uris.size());
CPPUNIT_ASSERT_EQUAL(std::string("http://file1p1"), uris[0]);
}
{
SharedHandle<RequestGroup> rg = groups[1];
std::vector<std::string> uris;
rg->getDownloadContext()->getFirstFileEntry()->getUris(uris);
CPPUNIT_ASSERT_EQUAL((size_t)1, uris.size());
CPPUNIT_ASSERT_EQUAL(std::string("http://file2p1"), uris[0]);
}
{
SharedHandle<RequestGroup> rg = groups[2];
std::vector<std::string> uris;
rg->getDownloadContext()->getFirstFileEntry()->getUris(uris);
CPPUNIT_ASSERT_EQUAL((size_t)1, uris.size());
CPPUNIT_ASSERT_EQUAL(std::string("http://file3p1"), uris[0]);
}
#endif // !ENABLE_BITTORRENT
}
} // namespace aria2

View File

@ -120,6 +120,7 @@ void MetalinkParserControllerTest::testMetaurlTransaction()
ctrl.setPriorityOfMetaurl(999);
ctrl.setNameOfMetaurl("mybirthdaycake");
ctrl.commitEntryTransaction();
#ifdef ENABLE_BITTORRENT
{
SharedHandle<Metalinker> m = ctrl.getResult();
CPPUNIT_ASSERT_EQUAL((size_t)1, m->entries.size());
@ -141,6 +142,13 @@ void MetalinkParserControllerTest::testMetaurlTransaction()
CPPUNIT_ASSERT_EQUAL((size_t)1, m->entries[0]->metaurls.size());
CPPUNIT_ASSERT_EQUAL((size_t)0, m->entries[1]->metaurls.size());
}
#else // !ENABLE_BITTORRENT
{
SharedHandle<Metalinker> m = ctrl.getResult();
CPPUNIT_ASSERT_EQUAL((size_t)1, m->entries.size());
CPPUNIT_ASSERT_EQUAL((size_t)0, m->entries[0]->metaurls.size());
}
#endif // !ENABLE_BITTORRENT
}
#ifdef ENABLE_MESSAGE_DIGEST