2008-05-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

Fixed compile error when configured with --disable-metalink.
	Also moved test/DownloadHandlerFactoryTest.cc to SRC in 
Makefile.am.
	* test/FeatureConfigTest.cc
	* test/DownloadHandlerFactoryTest.cc
pull/1/head
Tatsuhiro Tsujikawa 2008-05-20 14:27:58 +00:00
parent a70a747c23
commit bf58b49d87
3 changed files with 42 additions and 17 deletions

View File

@ -1,3 +1,10 @@
2008-05-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed compile error when configured with --disable-metalink.
Also moved test/DownloadHandlerFactoryTest.cc to SRC in Makefile.am.
* test/FeatureConfigTest.cc
* test/DownloadHandlerFactoryTest.cc
2008-05-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed compile error when configured with --without-gnutls

View File

@ -11,8 +11,10 @@ namespace aria2 {
class DownloadHandlerFactoryTest:public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(DownloadHandlerFactoryTest);
#ifdef ENABLE_METALINK
CPPUNIT_TEST(testGetMetalinkPreDownloadHandler_extension);
CPPUNIT_TEST(testGetMetalinkPreDownloadHandler_contentType);
#endif // ENABLE_METALINK
CPPUNIT_TEST(testGetBtPreDownloadHandler_extension);
CPPUNIT_TEST(testGetBtPreDownloadHandler_contentType);
CPPUNIT_TEST_SUITE_END();
@ -21,8 +23,11 @@ private:
public:
void setUp() {}
#ifdef ENABLE_METALINK
void testGetMetalinkPreDownloadHandler_extension();
void testGetMetalinkPreDownloadHandler_contentType();
#endif // ENABLE_METALINK
void testGetBtPreDownloadHandler_extension();
void testGetBtPreDownloadHandler_contentType();
};
@ -30,6 +35,8 @@ public:
CPPUNIT_TEST_SUITE_REGISTRATION( DownloadHandlerFactoryTest );
#ifdef ENABLE_METALINK
void DownloadHandlerFactoryTest::testGetMetalinkPreDownloadHandler_extension()
{
Option op;
@ -63,6 +70,8 @@ void DownloadHandlerFactoryTest::testGetMetalinkPreDownloadHandler_contentType()
CPPUNIT_ASSERT(!handler->canHandle(&rg));
}
#endif // ENABLE_METALINK
void DownloadHandlerFactoryTest::testGetBtPreDownloadHandler_extension()
{
Option op;

View File

@ -1,4 +1,8 @@
#include "FeatureConfig.h"
#include "a2functional.h"
#include "array_fun.h"
#include "Util.h"
#include <algorithm>
#include <cppunit/extensions/HelperMacros.h>
namespace aria2 {
@ -44,33 +48,38 @@ void FeatureConfigTest::testIsSupported() {
}
void FeatureConfigTest::testFeatureSummary() {
CPPUNIT_ASSERT_EQUAL(
const std::string features[] = {
#ifdef ENABLE_ASYNC_DNS
std::string("Async DNS, ")
#else
std::string()
"Async DNS",
#endif // ENABLE_ASYNC_DNS
#ifdef ENABLE_BITTORRENT
+std::string("BitTorrent, ")
#else
+std::string()
"BitTorrent",
#endif // ENABLE_BITTORRENT
#ifdef ENABLE_SSL
+std::string("HTTPS, ")
#else
+std::string()
"HTTPS",
#endif // ENABLE_SSL
#ifdef ENABLE_MESSAGE_DIGEST
+std::string("Message Digest, ")
#else
+std::string()
"Message Digest",
#endif // ENABLE_MESSAGE_DIGEST
#ifdef ENABLE_METALINK
+std::string("Metalink")
#else
+std::string()
"Metalink",
#endif // ENABLE_METALINK
,
};
std::string featuresString;
const std::string delim(", ");
std::for_each(&features[0], &features[arrayLength(features)],
StringAppend(featuresString, delim));
// USE Util::trimSelf(featureString);
featuresString = Util::trim(featuresString, delim);
CPPUNIT_ASSERT_EQUAL(featuresString,
FeatureConfig::getInstance()->featureSummary());
}