diff --git a/ChangeLog b/ChangeLog index 7c7ca8a8..42835cb6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,12 @@ Removed unnecessary string copy. Updated doc and corrected indentation. * src/Base64.cc + + Fixed compilation warnings + * test/DataTest.cc + * test/HttpRequestTest.cc + * test/MetaFileUtilTest.cc + * test/RequestTest.cc * Release 0.12.0 diff --git a/test/DataTest.cc b/test/DataTest.cc index 3f0e3287..19c8ef6a 100644 --- a/test/DataTest.cc +++ b/test/DataTest.cc @@ -37,7 +37,6 @@ void DataTest::testToString() { void DataTest::testGetData() { Data data("aria2", 5); - int len; CPPUNIT_ASSERT_EQUAL(0, memcmp("aria2", data.getData(), 5)); CPPUNIT_ASSERT_EQUAL((int32_t)5, data.getLen()); diff --git a/test/HttpRequestTest.cc b/test/HttpRequestTest.cc index df79b514..514b2c55 100644 --- a/test/HttpRequestTest.cc +++ b/test/HttpRequestTest.cc @@ -55,7 +55,6 @@ void HttpRequestTest::testGetEndByte() int32_t index = 1; int32_t length = 1024*1024-1024; int32_t segmentLength = 1024*1024; - int32_t writtenLength = 1024; HttpRequest httpRequest; SegmentHandle segment = new PiecedSegment(segmentLength, diff --git a/test/MetaFileUtilTest.cc b/test/MetaFileUtilTest.cc index b8280d91..cec564e4 100644 --- a/test/MetaFileUtilTest.cc +++ b/test/MetaFileUtilTest.cc @@ -36,7 +36,7 @@ void MetaFileUtilTest::testParseMetaFile() { void MetaFileUtilTest::testBdecoding() { try { const char* str = "5:abcd"; - MetaEntry* entry = MetaFileUtil::bdecoding(str, strlen(str)); + MetaFileUtil::bdecoding(str, strlen(str)); CPPUNIT_FAIL("DlAbortEx exception must be thrown."); } catch(DlAbortEx* ex) { delete ex; @@ -46,7 +46,7 @@ void MetaFileUtilTest::testBdecoding() { try { const char* str = "i1234"; - MetaEntry* entry = MetaFileUtil::bdecoding(str, strlen(str)); + MetaFileUtil::bdecoding(str, strlen(str)); CPPUNIT_FAIL("DlAbortEx exception must be thrown."); } catch(DlAbortEx* ex) { delete ex; @@ -56,7 +56,7 @@ void MetaFileUtilTest::testBdecoding() { try { const char* str = "5abcd"; - MetaEntry* entry = MetaFileUtil::bdecoding(str, strlen(str)); + MetaFileUtil::bdecoding(str, strlen(str)); CPPUNIT_FAIL("DlAbortEx exception must be thrown."); } catch(DlAbortEx* ex) { delete ex; @@ -66,7 +66,7 @@ void MetaFileUtilTest::testBdecoding() { try { const char* str = "d"; - MetaEntry* entry = MetaFileUtil::bdecoding(str, strlen(str)); + MetaFileUtil::bdecoding(str, strlen(str)); CPPUNIT_FAIL("DlAbortEx exception must be thrown."); } catch(DlAbortEx* ex) { delete ex; diff --git a/test/RequestTest.cc b/test/RequestTest.cc index 13ab75c4..a7a3382d 100644 --- a/test/RequestTest.cc +++ b/test/RequestTest.cc @@ -257,7 +257,7 @@ void RequestTest::testSetUrl17() void RequestTest::testRedirectUrl() { Request req; 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/"); CPPUNIT_ASSERT(v2); @@ -279,19 +279,19 @@ void RequestTest::testRedirectUrl() { void RequestTest::testRedirectUrl2() { 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()); req.setReferer("http://aria.rednoah.com/"); // previousUrl is updated when referer is specified 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 CPPUNIT_ASSERT_EQUAL(string(""), req.getPreviousUrl()); // referer is unchagned 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 CPPUNIT_ASSERT_EQUAL(string(""), req.getPreviousUrl()); @@ -299,9 +299,9 @@ void RequestTest::testRedirectUrl2() { void RequestTest::testResetUrl() { 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/"); - bool v2 = req.redirectUrl("ftp://aria.rednoah.co.jp/"); + req.redirectUrl("ftp://aria.rednoah.co.jp/"); bool v3 = req.resetUrl(); CPPUNIT_ASSERT(v3);