mirror of https://github.com/aria2/aria2
pull/1/head
parent
2c0b8d13ad
commit
6620c8d878
|
@ -8,7 +8,6 @@ class MetalinkEntryTest:public CppUnit::TestFixture {
|
|||
CPPUNIT_TEST_SUITE(MetalinkEntryTest);
|
||||
CPPUNIT_TEST(testDropUnsupportedResource);
|
||||
CPPUNIT_TEST(testReorderResourcesByPreference);
|
||||
CPPUNIT_TEST(testCheck);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
private:
|
||||
|
||||
|
@ -20,7 +19,6 @@ public:
|
|||
|
||||
void testDropUnsupportedResource();
|
||||
void testReorderResourcesByPreference();
|
||||
void testCheck();
|
||||
};
|
||||
|
||||
|
||||
|
@ -90,15 +88,3 @@ void MetalinkEntryTest::testReorderResourcesByPreference() {
|
|||
CPPUNIT_ASSERT_EQUAL(50, entry->resources.at(3)->preference);
|
||||
CPPUNIT_ASSERT_EQUAL(10, entry->resources.at(4)->preference);
|
||||
}
|
||||
|
||||
void MetalinkEntryTest::testCheck() {
|
||||
MetalinkEntry entry;
|
||||
string filename = "4096chunk.txt";
|
||||
CPPUNIT_ASSERT(entry.check(filename));
|
||||
entry.md5 = "82a7348c2e03731109d0cf45a7325b88";
|
||||
CPPUNIT_ASSERT(entry.check(filename));
|
||||
entry.md5 = "00000000000000000000000000000000";
|
||||
CPPUNIT_ASSERT(!entry.check(filename));
|
||||
entry.sha1 = "608cabc0f2fa18c260cafd974516865c772363d5";
|
||||
CPPUNIT_ASSERT(entry.check(filename));
|
||||
}
|
||||
|
|
|
@ -33,11 +33,10 @@ void Xml2MetalinkProcessorTest::testParseFile() {
|
|||
CPPUNIT_ASSERT_EQUAL(string("0.5.2"), entry1->version);
|
||||
CPPUNIT_ASSERT_EQUAL(string("en-US"), entry1->language);
|
||||
CPPUNIT_ASSERT_EQUAL(string("Linux-x86"), entry1->os);
|
||||
CPPUNIT_ASSERT_EQUAL(string("fc4d834e89c18c99b2615d902750948c"),
|
||||
entry1->md5);
|
||||
CPPUNIT_ASSERT_EQUAL(string("a96cf3f0266b91d87d5124cf94326422800b627d"),
|
||||
entry1->sha1);
|
||||
|
||||
entry1->checksum.getMessageDigest());
|
||||
CPPUNIT_ASSERT(DIGEST_ALGO_SHA1 == entry1->checksum.getDigestAlgo());
|
||||
|
||||
MetalinkResources::iterator resourceItr1 = entry1->resources.begin();
|
||||
MetalinkResource* resource1 = *resourceItr1;
|
||||
CPPUNIT_ASSERT_EQUAL((int)MetalinkResource::TYPE_FTP, resource1->type);
|
||||
|
@ -57,10 +56,9 @@ void Xml2MetalinkProcessorTest::testParseFile() {
|
|||
CPPUNIT_ASSERT_EQUAL(string("0.5.1"), entry2->version);
|
||||
CPPUNIT_ASSERT_EQUAL(string("ja-JP"), entry2->language);
|
||||
CPPUNIT_ASSERT_EQUAL(string("Linux-m68k"), entry2->os);
|
||||
CPPUNIT_ASSERT_EQUAL(string("92296e19c406d77d21bda0bb944eac46"),
|
||||
entry2->md5);
|
||||
CPPUNIT_ASSERT_EQUAL(string("4c255b0ed130f5ea880f0aa061c3da0487e251cc"),
|
||||
entry2->sha1);
|
||||
entry2->checksum.getMessageDigest());
|
||||
CPPUNIT_ASSERT(DIGEST_ALGO_SHA1 == entry2->checksum.getDigestAlgo());
|
||||
|
||||
delete metalinker;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue