diff --git a/ChangeLog b/ChangeLog index b9e0a35db..987424762 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-05-20 Tatsuhiro Tsujikawa + + 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 Fixed compile error when configured with --without-gnutls diff --git a/test/DownloadHandlerFactoryTest.cc b/test/DownloadHandlerFactoryTest.cc index b7c9c0af2..e090300ae 100644 --- a/test/DownloadHandlerFactoryTest.cc +++ b/test/DownloadHandlerFactoryTest.cc @@ -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; diff --git a/test/FeatureConfigTest.cc b/test/FeatureConfigTest.cc index fa0952e08..86f8b9e87 100644 --- a/test/FeatureConfigTest.cc +++ b/test/FeatureConfigTest.cc @@ -1,4 +1,8 @@ #include "FeatureConfig.h" +#include "a2functional.h" +#include "array_fun.h" +#include "Util.h" +#include #include 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()); }