2008-04-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

Reorganized version information so that it can be displayed in a
	standard terminal screen without scrolling.
	Removed http, ftp from Configuration section, because they are 
always
	enabled.
	* src/FeatureConfig.cc
	* src/FeatureConfig.h
	* src/main.cc
	* src/messageDigest.cc
	* src/messageDigest.h
	* src/version_usage.cc
	* test/FeatureConfigTest.cc
This commit is contained in:
Tatsuhiro Tsujikawa 2008-04-27 05:55:02 +00:00
parent 3938307391
commit b74e27ff92
8 changed files with 168 additions and 180 deletions

View file

@ -8,13 +8,13 @@ class FeatureConfigTest:public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(FeatureConfigTest);
CPPUNIT_TEST(testGetDefaultPort);
CPPUNIT_TEST(testIsSupported);
CPPUNIT_TEST(testGetConfigurationSummary);
CPPUNIT_TEST(testFeatureSummary);
CPPUNIT_TEST_SUITE_END();
public:
void testGetDefaultPort();
void testIsSupported();
void testGetConfigurationSummary();
void testFeatureSummary();
};
@ -30,51 +30,48 @@ void FeatureConfigTest::testGetDefaultPort() {
}
void FeatureConfigTest::testIsSupported() {
CPPUNIT_ASSERT_EQUAL(true,
FeatureConfig::getInstance()->isSupported("http"));
#ifdef ENABLE_SSL
CPPUNIT_ASSERT_EQUAL(true,
FeatureConfig::getInstance()->isSupported("https"));
FeatureConfig::getInstance()->isSupported
(FeatureConfig::FEATURE_HTTPS));
#else
CPPUNIT_ASSERT_EQUAL(false,
FeatureConfig::getInstance()->isSupported("https"));
FeatureConfig::getInstance()->isSupported
(FeatureConfig::FEATURE_HTTPS));
#endif // ENABLE_SSL
CPPUNIT_ASSERT_EQUAL(true,
FeatureConfig::getInstance()->isSupported("ftp"));
CPPUNIT_ASSERT_EQUAL(false,
FeatureConfig::getInstance()->isSupported("ftps"));
FeatureConfig::getInstance()->isSupported("FTPS"));
}
void FeatureConfigTest::testGetConfigurationSummary() {
CPPUNIT_ASSERT_EQUAL(std::string("http: yes\n")
#ifdef ENABLE_SSL
+"https: yes\n"
#else
+"https: no\n"
#endif // ENABLE_SSL
+"ftp: yes\n"
#ifdef ENABLE_BITTORRENT
+"bittorrent: yes\n"
#else
+"bittorrent: no\n"
#endif // ENABLE_BITTORRENT
#ifdef ENABLE_METALINK
+"metalink: yes\n"
#else
+"metalink: no\n"
#endif // ENABLE_METALINK
#ifdef ENABLE_MESSAGE_DIGEST
+"message digest: yes\n"
#else
+"message digest: no\n"
#endif // ENABLE_MESSAGE_DIGEST
void FeatureConfigTest::testFeatureSummary() {
CPPUNIT_ASSERT_EQUAL(
#ifdef ENABLE_ASYNC_DNS
+"async dns: yes\n"
std::string("Async DNS, ")
#else
+"async dns: no\n"
std::string()
#endif // ENABLE_ASYNC_DNS
#ifdef ENABLE_BITTORRENT
+std::string("BitTorrent, ")
#else
+std::string()
#endif // ENABLE_BITTORRENT
#ifdef ENABLE_SSL
+std::string("HTTPS, ")
#else
+std::string()
#endif // ENABLE_SSL
#ifdef ENABLE_MESSAGE_DIGEST
+std::string("Message Digest, ")
#else
+std::string()
#endif // ENABLE_MESSAGE_DIGEST
#ifdef ENABLE_METALINK
+std::string("Metalink")
#else
+std::string()
#endif // ENABLE_METALINK
,
FeatureConfig::getInstance()->getConfigurationSummary());
FeatureConfig::getInstance()->featureSummary());
}
} // namespace aria2