mirror of https://github.com/aria2/aria2
Fixed examples for metalink
parent
77a3820920
commit
6303da136a
10
doc/aria2c.1
10
doc/aria2c.1
|
@ -1,11 +1,11 @@
|
||||||
.\" Title: aria2c
|
.\" Title: aria2c
|
||||||
.\" Author:
|
.\" Author:
|
||||||
.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
|
.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
|
||||||
.\" Date: 07/06/2007
|
.\" Date: 07/09/2007
|
||||||
.\" Manual:
|
.\" Manual:
|
||||||
.\" Source:
|
.\" Source:
|
||||||
.\"
|
.\"
|
||||||
.TH "ARIA2C" "1" "07/06/2007" "" ""
|
.TH "ARIA2C" "1" "07/09/2007" "" ""
|
||||||
.\" disable hyphenation
|
.\" disable hyphenation
|
||||||
.nh
|
.nh
|
||||||
.\" disable justification (adjust text to left margin only)
|
.\" disable justification (adjust text to left margin only)
|
||||||
|
@ -486,17 +486,17 @@ aria2c \-M test.metalink \-\-metalink\-version=1.1.1 \-\-metalink\-language=en\-
|
||||||
.PP
|
.PP
|
||||||
Download only selected files
|
Download only selected files
|
||||||
.RS 4
|
.RS 4
|
||||||
aria2c \-T test.metalink \-\-metalink\-language=en\-US dir/file1.zip dir/file2.zip
|
aria2c \-M test.metalink \-\-metalink\-language=en\-US dir/file1.zip dir/file2.zip
|
||||||
.RE
|
.RE
|
||||||
.PP
|
.PP
|
||||||
Download only selected files using index
|
Download only selected files using index
|
||||||
.RS 4
|
.RS 4
|
||||||
aria2c \-T test.metalink \-\-metalink\-language=en\-US \-\-select\-file 1,3\-5
|
aria2c \-M test.metalink \-\-metalink\-language=en\-US \-\-select\-file 1,3\-5
|
||||||
.RE
|
.RE
|
||||||
.PP
|
.PP
|
||||||
Print file listing of .metalink file
|
Print file listing of .metalink file
|
||||||
.RS 4
|
.RS 4
|
||||||
aria2c \-T test.torrent \-S \-\-metalink\-language=en\-US
|
aria2c \-M test.metalink \-S \-\-metalink\-language=en\-US
|
||||||
.RE
|
.RE
|
||||||
.SH "FILES"
|
.SH "FILES"
|
||||||
.PP
|
.PP
|
||||||
|
|
|
@ -309,11 +309,11 @@ EXAMPLES
|
||||||
Metalink downloading with preferences::
|
Metalink downloading with preferences::
|
||||||
aria2c -M test.metalink --metalink-version=1.1.1 --metalink-language=en-US
|
aria2c -M test.metalink --metalink-version=1.1.1 --metalink-language=en-US
|
||||||
Download only selected files::
|
Download only selected files::
|
||||||
aria2c -T test.metalink --metalink-language=en-US dir/file1.zip dir/file2.zip
|
aria2c -M test.metalink --metalink-language=en-US dir/file1.zip dir/file2.zip
|
||||||
Download only selected files using index::
|
Download only selected files using index::
|
||||||
aria2c -T test.metalink --metalink-language=en-US --select-file 1,3-5
|
aria2c -M test.metalink --metalink-language=en-US --select-file 1,3-5
|
||||||
Print file listing of .metalink file::
|
Print file listing of .metalink file::
|
||||||
aria2c -T test.torrent -S --metalink-language=en-US
|
aria2c -M test.metalink -S --metalink-language=en-US
|
||||||
|
|
||||||
FILES
|
FILES
|
||||||
-----
|
-----
|
||||||
|
|
|
@ -311,11 +311,11 @@ void showUsage() {
|
||||||
cout << _(" Metalink downloading with preferences:") << endl;
|
cout << _(" Metalink downloading with preferences:") << endl;
|
||||||
cout << " aria2c -M test.metalink --metalink-version=1.1.1 --metalink-language=en-US" << endl;
|
cout << " aria2c -M test.metalink --metalink-version=1.1.1 --metalink-language=en-US" << endl;
|
||||||
cout << _(" Download only selected files:") << endl;
|
cout << _(" Download only selected files:") << endl;
|
||||||
cout << " aria2c -T test.metalink --metalink-language=en-US dir/file1.zip dir/file2.zip" << endl;
|
cout << " aria2c -M test.metalink --metalink-language=en-US dir/file1.zip dir/file2.zip" << endl;
|
||||||
cout << _(" Download only selected files using index:") << endl;
|
cout << _(" Download only selected files using index:") << endl;
|
||||||
cout << " aria2c -T test.metalink --metalink-language=en-US --select-file 1,3-5" << endl;
|
cout << " aria2c -M test.metalink --metalink-language=en-US --select-file 1,3-5" << endl;
|
||||||
cout << _(" Print file listing of .metalink file:") << endl;
|
cout << _(" Print file listing of .metalink file:") << endl;
|
||||||
cout << " aria2c -T test.torrent -S --metalink-language=en-US" << endl;
|
cout << " aria2c -M test.metalink -S --metalink-language=en-US" << endl;
|
||||||
#endif // ENABLE_METALINK
|
#endif // ENABLE_METALINK
|
||||||
cout << endl;
|
cout << endl;
|
||||||
printf(_("Report bugs to %s"), "<tujikawa at users dot sourceforge dot net>");
|
printf(_("Report bugs to %s"), "<tujikawa at users dot sourceforge dot net>");
|
||||||
|
|
|
@ -94,6 +94,9 @@ void BitfieldManTest::testIsAllBitSet() {
|
||||||
CPPUNIT_ASSERT(bt1.setBit(i));
|
CPPUNIT_ASSERT(bt1.setBit(i));
|
||||||
}
|
}
|
||||||
CPPUNIT_ASSERT(bt1.isAllBitSet());
|
CPPUNIT_ASSERT(bt1.isAllBitSet());
|
||||||
|
|
||||||
|
BitfieldMan btzero(1024, 0);
|
||||||
|
CPPUNIT_ASSERT(btzero.isAllBitSet());
|
||||||
}
|
}
|
||||||
|
|
||||||
void BitfieldManTest::testFilter() {
|
void BitfieldManTest::testFilter() {
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
#include "RequestGroupMan.h"
|
#include "RequestGroupMan.h"
|
||||||
|
#include "ConsoleDownloadEngine.h"
|
||||||
|
#include "CUIDCounter.h"
|
||||||
|
#include "prefs.h"
|
||||||
#include <cppunit/extensions/HelperMacros.h>
|
#include <cppunit/extensions/HelperMacros.h>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
@ -7,13 +10,19 @@ class RequestGroupManTest : public CppUnit::TestFixture {
|
||||||
|
|
||||||
CPPUNIT_TEST_SUITE(RequestGroupManTest);
|
CPPUNIT_TEST_SUITE(RequestGroupManTest);
|
||||||
CPPUNIT_TEST(testIsSameFileBeingDownloaded);
|
CPPUNIT_TEST(testIsSameFileBeingDownloaded);
|
||||||
|
CPPUNIT_TEST(testGetInitialCommands);
|
||||||
CPPUNIT_TEST_SUITE_END();
|
CPPUNIT_TEST_SUITE_END();
|
||||||
private:
|
private:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void setUp() {}
|
void setUp()
|
||||||
|
{
|
||||||
|
CUIDCounterHandle counter = new CUIDCounter();
|
||||||
|
CUIDCounterSingletonHolder::instance(counter);
|
||||||
|
}
|
||||||
|
|
||||||
void testIsSameFileBeingDownloaded();
|
void testIsSameFileBeingDownloaded();
|
||||||
|
void testGetInitialCommands();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -45,3 +54,24 @@ void RequestGroupManTest::testIsSameFileBeingDownloaded()
|
||||||
CPPUNIT_ASSERT(!gm.isSameFileBeingDownloaded(rg1.get()));
|
CPPUNIT_ASSERT(!gm.isSameFileBeingDownloaded(rg1.get()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RequestGroupManTest::testGetInitialCommands()
|
||||||
|
{
|
||||||
|
Option option;
|
||||||
|
option.put(PREF_SPLIT, "1");
|
||||||
|
option.put(PREF_TIMEOUT, "10");
|
||||||
|
RequestGroupMan gm;
|
||||||
|
|
||||||
|
RequestGroupHandle rg1 = new RequestGroup("aria2.tar.bz2.metalink",
|
||||||
|
&option);
|
||||||
|
RequestGroupHandle rg2 = new RequestGroup("http://localhost/aria2.tar.bz2",
|
||||||
|
&option);
|
||||||
|
|
||||||
|
gm.addRequestGroup(rg1);
|
||||||
|
gm.addRequestGroup(rg2);
|
||||||
|
|
||||||
|
ConsoleDownloadEngine e;
|
||||||
|
e.option = &option;
|
||||||
|
Commands commands = gm.getInitialCommands(&e);
|
||||||
|
CPPUNIT_ASSERT_EQUAL((size_t)1, commands.size());
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue