pull/1/head
Tatsuhiro Tsujikawa 2006-08-07 16:43:58 +00:00
parent 2c0b8d13ad
commit 6620c8d878
2 changed files with 5 additions and 21 deletions

View File

@ -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));
}

View File

@ -33,10 +33,9 @@ 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;
@ -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;
}