mirror of
https://github.com/aria2/aria2.git
synced 2025-04-05 05:27:38 +03:00
2008-05-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Changed method sinature: MetalinkEntry::toFileEntry, MetalinkHelper::query, MetalinkHelper::parseAndQuery, Metalinker::queryEntry * src/Metalink2RequestGroup.cc * src/MetalinkEntry.cc * src/MetalinkEntry.h * src/MetalinkHelper.cc * src/MetalinkHelper.h * src/Metalinker.cc * src/Metalinker.h * src/main.cc * test/MetalinkHelperTest.cc * test/MetalinkerTest.cc
This commit is contained in:
parent
f84eac327f
commit
3da60af41e
11 changed files with 100 additions and 65 deletions
|
@ -29,19 +29,19 @@ CPPUNIT_TEST_SUITE_REGISTRATION( MetalinkHelperTest );
|
|||
void MetalinkHelperTest::testParseAndQuery()
|
||||
{
|
||||
Option option;
|
||||
std::deque<SharedHandle<MetalinkEntry> > entries =
|
||||
MetalinkHelper::parseAndQuery("test.xml", &option);
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)5, entries.size());
|
||||
std::deque<SharedHandle<MetalinkEntry> > result;
|
||||
MetalinkHelper::parseAndQuery(result, "test.xml", &option);
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)5, result.size());
|
||||
}
|
||||
|
||||
void MetalinkHelperTest::testParseAndQuery_version()
|
||||
{
|
||||
Option option;
|
||||
option.put(PREF_METALINK_VERSION, "0.5.1");
|
||||
std::deque<SharedHandle<MetalinkEntry> > entries =
|
||||
MetalinkHelper::parseAndQuery("test.xml", &option);
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)1, entries.size());
|
||||
SharedHandle<MetalinkEntry> entry = entries.front();
|
||||
std::deque<SharedHandle<MetalinkEntry> > result;
|
||||
MetalinkHelper::parseAndQuery(result, "test.xml", &option);
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)1, result.size());
|
||||
SharedHandle<MetalinkEntry> entry = result.front();
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("aria2-0.5.1.tar.bz2"), entry->getPath());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue