#include "bittorrent_helper.h" #include #include #include #include "DownloadContext.h" #include "util.h" #include "RecoverableException.h" #include "AnnounceTier.h" #include "FixedNumberRandomizer.h" #include "FileEntry.h" #include "array_fun.h" #include "a2netcompat.h" #include "bencode2.h" #include "TestUtil.h" #include "base32.h" #include "Option.h" #include "prefs.h" namespace aria2 { namespace bittorrent { class BittorrentHelperTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(BittorrentHelperTest); CPPUNIT_TEST(testGetInfoHash); CPPUNIT_TEST(testGetPieceHash); CPPUNIT_TEST(testGetFileEntries); CPPUNIT_TEST(testGetTotalLength); CPPUNIT_TEST(testGetFileEntriesSingle); CPPUNIT_TEST(testGetTotalLengthSingle); CPPUNIT_TEST(testGetFileModeMulti); CPPUNIT_TEST(testGetFileModeSingle); CPPUNIT_TEST(testGetNameMulti); CPPUNIT_TEST(testGetNameSingle); CPPUNIT_TEST(testOverrideName); CPPUNIT_TEST(testGetAnnounceTier); CPPUNIT_TEST(testGetAnnounceTierAnnounceList); CPPUNIT_TEST(testGetPieceLength); CPPUNIT_TEST(testGetInfoHashAsString); CPPUNIT_TEST(testGetPeerId); CPPUNIT_TEST(testGetPeerAgent); CPPUNIT_TEST(testComputeFastSet); CPPUNIT_TEST(testGetFileEntries_multiFileUrlList); CPPUNIT_TEST(testGetFileEntries_singleFileUrlList); CPPUNIT_TEST(testGetFileEntries_singleFileUrlListEndsWithSlash); CPPUNIT_TEST(testLoadFromMemory); CPPUNIT_TEST(testLoadFromMemory_somethingMissing); CPPUNIT_TEST(testLoadFromMemory_overrideName); CPPUNIT_TEST(testLoadFromMemory_multiFileDirTraversal); CPPUNIT_TEST(testLoadFromMemory_singleFileDirTraversal); CPPUNIT_TEST(testLoadFromMemory_multiFileNonUtf8Path); CPPUNIT_TEST(testLoadFromMemory_singleFileNonUtf8Path); CPPUNIT_TEST(testGetNodes); CPPUNIT_TEST(testGetBasePath); CPPUNIT_TEST(testSetFileFilter_single); CPPUNIT_TEST(testSetFileFilter_multi); CPPUNIT_TEST(testUTF8Torrent); CPPUNIT_TEST(testEtc); CPPUNIT_TEST(testCheckBitfield); CPPUNIT_TEST(testMetadata); CPPUNIT_TEST(testParseMagnet); CPPUNIT_TEST(testParseMagnet_base32); CPPUNIT_TEST(testMetadata2Torrent); CPPUNIT_TEST(testTorrent2Magnet); CPPUNIT_TEST(testExtractPeerFromString); CPPUNIT_TEST(testExtractPeerFromList); CPPUNIT_TEST(testExtract2PeersFromList); CPPUNIT_TEST(testPackcompact); CPPUNIT_TEST(testUnpackcompact); CPPUNIT_TEST(testRemoveAnnounceUri); CPPUNIT_TEST(testAddAnnounceUri); CPPUNIT_TEST(testAdjustAnnounceUri); CPPUNIT_TEST_SUITE_END(); public: std::shared_ptr