mirror of https://github.com/aria2/aria2
2010-03-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed compile error and unit test error without openssl and gnutls. * src/MetalinkParserController.cc * test/MetalinkProcessorTest.ccpull/1/head
parent
c4a35932cb
commit
ab6644c3de
|
@ -1,3 +1,10 @@
|
|||
2010-03-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||
|
||||
Fixed compile error and unit test error without openssl and
|
||||
gnutls.
|
||||
* src/MetalinkParserController.cc
|
||||
* test/MetalinkProcessorTest.cc
|
||||
|
||||
2010-03-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||
|
||||
Fixed unitest fails if openssl doesn't support sha-256.
|
||||
|
|
|
@ -53,12 +53,14 @@
|
|||
|
||||
namespace aria2 {
|
||||
|
||||
#ifdef ENABLE_MESSAGE_DIGEST
|
||||
static bool isValidHash(const std::string& algo, const std::string& hash)
|
||||
{
|
||||
return util::isHexDigit(hash) &&
|
||||
MessageDigestContext::supports(algo) &&
|
||||
MessageDigestContext::digestLength(algo)*2 == hash.size();
|
||||
}
|
||||
#endif // ENABLE_MESSAGE_DIGEST
|
||||
|
||||
MetalinkParserController::MetalinkParserController():
|
||||
_metalinker(new Metalinker())
|
||||
|
|
|
@ -121,10 +121,7 @@ void MetalinkProcessorTest::testParseFileV4()
|
|||
(std::string("44213f9f4d59b557314fadcd233232eebcac8012"),
|
||||
e->chunkChecksum->getChecksum(2));
|
||||
}
|
||||
#else // !ENABLE_MESSAGE_DIGEST
|
||||
CPPUNIT_ASSERT(e->checksum.isNull());
|
||||
CPPUNIT_ASSERT(e->chunkChecksum.isNull());
|
||||
#endif // !ENABLE_MESSAGE_DIGEST
|
||||
#endif // ENABLE_MESSAGE_DIGEST
|
||||
CPPUNIT_ASSERT(!e->getSignature().isNull());
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("application/pgp-signature"),
|
||||
e->getSignature()->getType());
|
||||
|
@ -339,6 +336,7 @@ void MetalinkProcessorTest::testParseFileV4_attrs()
|
|||
// success
|
||||
}
|
||||
}
|
||||
#ifdef ENABLE_MESSAGE_DIGEST
|
||||
{
|
||||
// Testing pieces@length
|
||||
// No pieces@length
|
||||
|
@ -455,6 +453,7 @@ void MetalinkProcessorTest::testParseFileV4_attrs()
|
|||
CPPUNIT_FAIL("exception must be thrown.");
|
||||
} catch(RecoverableException& e) {}
|
||||
}
|
||||
#endif // ENABLE_MESSAGE_DIGEST
|
||||
{
|
||||
// Testing signature@mediatype
|
||||
// No hash@type
|
||||
|
|
Loading…
Reference in New Issue