mirror of https://github.com/aria2/aria2
2007-12-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed compilation warnings * test/DataTest.cc * test/HttpRequestTest.cc * test/MetaFileUtilTest.cc * test/RequestTest.ccpull/1/head
parent
2fe11ac548
commit
4b5ad58219
|
@ -2,6 +2,12 @@
|
||||||
|
|
||||||
Removed unnecessary string copy. Updated doc and corrected indentation.
|
Removed unnecessary string copy. Updated doc and corrected indentation.
|
||||||
* src/Base64.cc
|
* src/Base64.cc
|
||||||
|
|
||||||
|
Fixed compilation warnings
|
||||||
|
* test/DataTest.cc
|
||||||
|
* test/HttpRequestTest.cc
|
||||||
|
* test/MetaFileUtilTest.cc
|
||||||
|
* test/RequestTest.cc
|
||||||
|
|
||||||
* Release 0.12.0
|
* Release 0.12.0
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,6 @@ void DataTest::testToString() {
|
||||||
|
|
||||||
void DataTest::testGetData() {
|
void DataTest::testGetData() {
|
||||||
Data data("aria2", 5);
|
Data data("aria2", 5);
|
||||||
int len;
|
|
||||||
CPPUNIT_ASSERT_EQUAL(0, memcmp("aria2", data.getData(), 5));
|
CPPUNIT_ASSERT_EQUAL(0, memcmp("aria2", data.getData(), 5));
|
||||||
CPPUNIT_ASSERT_EQUAL((int32_t)5, data.getLen());
|
CPPUNIT_ASSERT_EQUAL((int32_t)5, data.getLen());
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,6 @@ void HttpRequestTest::testGetEndByte()
|
||||||
int32_t index = 1;
|
int32_t index = 1;
|
||||||
int32_t length = 1024*1024-1024;
|
int32_t length = 1024*1024-1024;
|
||||||
int32_t segmentLength = 1024*1024;
|
int32_t segmentLength = 1024*1024;
|
||||||
int32_t writtenLength = 1024;
|
|
||||||
|
|
||||||
HttpRequest httpRequest;
|
HttpRequest httpRequest;
|
||||||
SegmentHandle segment = new PiecedSegment(segmentLength,
|
SegmentHandle segment = new PiecedSegment(segmentLength,
|
||||||
|
|
|
@ -36,7 +36,7 @@ void MetaFileUtilTest::testParseMetaFile() {
|
||||||
void MetaFileUtilTest::testBdecoding() {
|
void MetaFileUtilTest::testBdecoding() {
|
||||||
try {
|
try {
|
||||||
const char* str = "5:abcd";
|
const char* str = "5:abcd";
|
||||||
MetaEntry* entry = MetaFileUtil::bdecoding(str, strlen(str));
|
MetaFileUtil::bdecoding(str, strlen(str));
|
||||||
CPPUNIT_FAIL("DlAbortEx exception must be thrown.");
|
CPPUNIT_FAIL("DlAbortEx exception must be thrown.");
|
||||||
} catch(DlAbortEx* ex) {
|
} catch(DlAbortEx* ex) {
|
||||||
delete ex;
|
delete ex;
|
||||||
|
@ -46,7 +46,7 @@ void MetaFileUtilTest::testBdecoding() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const char* str = "i1234";
|
const char* str = "i1234";
|
||||||
MetaEntry* entry = MetaFileUtil::bdecoding(str, strlen(str));
|
MetaFileUtil::bdecoding(str, strlen(str));
|
||||||
CPPUNIT_FAIL("DlAbortEx exception must be thrown.");
|
CPPUNIT_FAIL("DlAbortEx exception must be thrown.");
|
||||||
} catch(DlAbortEx* ex) {
|
} catch(DlAbortEx* ex) {
|
||||||
delete ex;
|
delete ex;
|
||||||
|
@ -56,7 +56,7 @@ void MetaFileUtilTest::testBdecoding() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const char* str = "5abcd";
|
const char* str = "5abcd";
|
||||||
MetaEntry* entry = MetaFileUtil::bdecoding(str, strlen(str));
|
MetaFileUtil::bdecoding(str, strlen(str));
|
||||||
CPPUNIT_FAIL("DlAbortEx exception must be thrown.");
|
CPPUNIT_FAIL("DlAbortEx exception must be thrown.");
|
||||||
} catch(DlAbortEx* ex) {
|
} catch(DlAbortEx* ex) {
|
||||||
delete ex;
|
delete ex;
|
||||||
|
@ -66,7 +66,7 @@ void MetaFileUtilTest::testBdecoding() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const char* str = "d";
|
const char* str = "d";
|
||||||
MetaEntry* entry = MetaFileUtil::bdecoding(str, strlen(str));
|
MetaFileUtil::bdecoding(str, strlen(str));
|
||||||
CPPUNIT_FAIL("DlAbortEx exception must be thrown.");
|
CPPUNIT_FAIL("DlAbortEx exception must be thrown.");
|
||||||
} catch(DlAbortEx* ex) {
|
} catch(DlAbortEx* ex) {
|
||||||
delete ex;
|
delete ex;
|
||||||
|
|
|
@ -257,7 +257,7 @@ void RequestTest::testSetUrl17()
|
||||||
void RequestTest::testRedirectUrl() {
|
void RequestTest::testRedirectUrl() {
|
||||||
Request req;
|
Request req;
|
||||||
req.setKeepAlive(true);
|
req.setKeepAlive(true);
|
||||||
bool v = req.setUrl("http://aria.rednoah.com:8080/aria2/index.html");
|
req.setUrl("http://aria.rednoah.com:8080/aria2/index.html");
|
||||||
|
|
||||||
bool v2 = req.redirectUrl("http://aria.rednoah.co.jp/");
|
bool v2 = req.redirectUrl("http://aria.rednoah.co.jp/");
|
||||||
CPPUNIT_ASSERT(v2);
|
CPPUNIT_ASSERT(v2);
|
||||||
|
@ -279,19 +279,19 @@ void RequestTest::testRedirectUrl() {
|
||||||
|
|
||||||
void RequestTest::testRedirectUrl2() {
|
void RequestTest::testRedirectUrl2() {
|
||||||
Request req;
|
Request req;
|
||||||
bool v = req.setUrl("http://aria.rednoah.com/download.html");
|
req.setUrl("http://aria.rednoah.com/download.html");
|
||||||
CPPUNIT_ASSERT_EQUAL(string(""), req.getPreviousUrl());
|
CPPUNIT_ASSERT_EQUAL(string(""), req.getPreviousUrl());
|
||||||
req.setReferer("http://aria.rednoah.com/");
|
req.setReferer("http://aria.rednoah.com/");
|
||||||
// previousUrl is updated when referer is specified
|
// previousUrl is updated when referer is specified
|
||||||
CPPUNIT_ASSERT_EQUAL(string("http://aria.rednoah.com/"), req.getPreviousUrl());
|
CPPUNIT_ASSERT_EQUAL(string("http://aria.rednoah.com/"), req.getPreviousUrl());
|
||||||
bool v2 = req.redirectUrl("http://aria.rednoah.com/403.html");
|
req.redirectUrl("http://aria.rednoah.com/403.html");
|
||||||
|
|
||||||
// previousUrl must be "" when redirection
|
// previousUrl must be "" when redirection
|
||||||
CPPUNIT_ASSERT_EQUAL(string(""), req.getPreviousUrl());
|
CPPUNIT_ASSERT_EQUAL(string(""), req.getPreviousUrl());
|
||||||
// referer is unchagned
|
// referer is unchagned
|
||||||
CPPUNIT_ASSERT_EQUAL(string("http://aria.rednoah.com/"), req.getReferer());
|
CPPUNIT_ASSERT_EQUAL(string("http://aria.rednoah.com/"), req.getReferer());
|
||||||
|
|
||||||
bool v3 = req.redirectUrl("http://aria.rednoah.com/error.html");
|
req.redirectUrl("http://aria.rednoah.com/error.html");
|
||||||
|
|
||||||
// previousUrl must be "" when redirection
|
// previousUrl must be "" when redirection
|
||||||
CPPUNIT_ASSERT_EQUAL(string(""), req.getPreviousUrl());
|
CPPUNIT_ASSERT_EQUAL(string(""), req.getPreviousUrl());
|
||||||
|
@ -299,9 +299,9 @@ void RequestTest::testRedirectUrl2() {
|
||||||
|
|
||||||
void RequestTest::testResetUrl() {
|
void RequestTest::testResetUrl() {
|
||||||
Request req;
|
Request req;
|
||||||
bool v = req.setUrl("http://aria.rednoah.com:8080/aria2/index.html");
|
req.setUrl("http://aria.rednoah.com:8080/aria2/index.html");
|
||||||
req.setReferer("http://aria.rednoah.com:8080/");
|
req.setReferer("http://aria.rednoah.com:8080/");
|
||||||
bool v2 = req.redirectUrl("ftp://aria.rednoah.co.jp/");
|
req.redirectUrl("ftp://aria.rednoah.co.jp/");
|
||||||
|
|
||||||
bool v3 = req.resetUrl();
|
bool v3 = req.resetUrl();
|
||||||
CPPUNIT_ASSERT(v3);
|
CPPUNIT_ASSERT(v3);
|
||||||
|
|
Loading…
Reference in New Issue