mirror of
https://github.com/aria2/aria2.git
synced 2025-02-26 08:22:11 +00:00
* src/FeatureConfig.cc (FEATURE_ASYNC_DNS): New definition. (FeatureConfig): Added aysnc DNS entry. To replace CommandUuid with Command* in SocketEntry and NameResolverEntry: * src/DownloadEngine.h (CommandUuids): Removed. (SocketEntry::commandUuid): Removed. (SocketEntry::command): New variable. (SocketEntry::SocketEntry): Updated. (SocketEntry::operator==): Updated. (NameResolverEntry::commandUuid): Removed. (NameResolverEntry::command): New variable. (NameResolverEntry::NameResolverEntry): Updated. (NameResolverEntry::operator==): Updated. (waitData): Changed the argument type. (addSocketForReadCheck): Changed the argument type. (deleteSocketForReadCheck): Changed the argument type. (addSocketForWriteCheck): Changed the argument type. (deleteSocketForWriteCheck): Changed the argument type. (addNameResolverCheck): Changed the argument type. (deleteNameResolverCheck): Changed the argument type. * src/DownloadEngine.cc (FindCommand): Removed. (run): Removed activeUuid. Added activeCommands instead. (AccumulateActiveUuid): Renamed as AccumulateActiveCommand. (AccumulateActiveCommand): New function object. (waitData): Use AccumulateActiveCommand. (addSocketForReadCheck): Use Command instead of CommandUuid. (deleteSocketForReadCheck): Use Command instead of CommandUuid. (addSocketForWriteCheck): Use Command instead of CommandUuid. (deleteSocketForWriteCheck): Use Command instead of CommandUuid. (addNameResolverCheck): Use Command instead of CommandUuid. (deleteNameResolverCheck): Use Command instead of CommandUuid. * src/AbstractCommand.cc (disableReadCheckSocket): Updated according to the changes in DownloadEngine. (setReadCheckSocket): Updated according to the changes in DownloadEngine. (disableWriteCheckSocket): Updated according to the changes in DownloadEngine. (setWriteCheckSocket): Updated according to the changes in DownloadEngine. (setNameResolverCheck): Updated according to the changes in DownloadEngine. (disableNameResolverCheck): Updated according to the changes in DownloadEngine. * src/AbstractCommand.cc (disableReadCheckSocket): Updated according to the changes in DownloadEngine. (setReadCheckSocket): Updated according to the changes in DownloadEngine. (disableWriteCheckSocket): Updated according to the changes in DownloadEngine. (setWriteCheckSocket): Updated according to the changes in DownloadEngine. * release 0.7.1
52 lines
1.5 KiB
C++
52 lines
1.5 KiB
C++
#include "FeatureConfig.h"
|
|
|
|
#include <cppunit/extensions/HelperMacros.h>
|
|
|
|
class FeatureConfigTest:public CppUnit::TestFixture {
|
|
|
|
CPPUNIT_TEST_SUITE(FeatureConfigTest);
|
|
CPPUNIT_TEST(testGetDefaultPort);
|
|
CPPUNIT_TEST(testIsSupported);
|
|
CPPUNIT_TEST(testGetConfigurationSummary);
|
|
CPPUNIT_TEST_SUITE_END();
|
|
|
|
public:
|
|
void testGetDefaultPort();
|
|
void testIsSupported();
|
|
void testGetConfigurationSummary();
|
|
};
|
|
|
|
|
|
CPPUNIT_TEST_SUITE_REGISTRATION(FeatureConfigTest);
|
|
|
|
void FeatureConfigTest::testGetDefaultPort() {
|
|
CPPUNIT_ASSERT_EQUAL(80,
|
|
FeatureConfig::getInstance()->getDefaultPort("http"));
|
|
CPPUNIT_ASSERT_EQUAL(443,
|
|
FeatureConfig::getInstance()->getDefaultPort("https"));
|
|
CPPUNIT_ASSERT_EQUAL(21,
|
|
FeatureConfig::getInstance()->getDefaultPort("ftp"));
|
|
}
|
|
|
|
void FeatureConfigTest::testIsSupported() {
|
|
CPPUNIT_ASSERT_EQUAL(true,
|
|
FeatureConfig::getInstance()->isSupported("http"));
|
|
CPPUNIT_ASSERT_EQUAL(true,
|
|
FeatureConfig::getInstance()->isSupported("https"));
|
|
CPPUNIT_ASSERT_EQUAL(true,
|
|
FeatureConfig::getInstance()->isSupported("ftp"));
|
|
CPPUNIT_ASSERT_EQUAL(false,
|
|
FeatureConfig::getInstance()->isSupported("ftps"));
|
|
}
|
|
|
|
void FeatureConfigTest::testGetConfigurationSummary() {
|
|
CPPUNIT_ASSERT_EQUAL(string("http: yes\n")
|
|
+"https: yes\n"
|
|
+"ftp: yes\n"
|
|
+"bittorrent: yes\n"
|
|
+"metalink: yes\n"
|
|
+"message digest: yes\n"
|
|
+"async dns: yes\n",
|
|
FeatureConfig::getInstance()->getConfigurationSummary());
|
|
}
|