#include "DefaultBtMessageDispatcher.h" #include #include #include "util.h" #include "Exception.h" #include "MockBtMessage.h" #include "MockBtMessageFactory.h" #include "prefs.h" #include "BtCancelSendingPieceEvent.h" #include "BtHandshakeMessage.h" #include "Option.h" #include "RequestGroupMan.h" #include "ServerStatMan.h" #include "RequestGroup.h" #include "DownloadContext.h" #include "bittorrent_helper.h" #include "PeerConnection.h" namespace aria2 { class DefaultBtMessageDispatcherTest:public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(DefaultBtMessageDispatcherTest); CPPUNIT_TEST(testAddMessage); CPPUNIT_TEST(testSendMessages); CPPUNIT_TEST(testSendMessages_underUploadLimit); // See the comment on the definition //CPPUNIT_TEST(testSendMessages_overUploadLimit); CPPUNIT_TEST(testDoCancelSendingPieceAction); CPPUNIT_TEST(testCheckRequestSlotAndDoNecessaryThing); CPPUNIT_TEST(testCheckRequestSlotAndDoNecessaryThing_timeout); CPPUNIT_TEST(testCheckRequestSlotAndDoNecessaryThing_completeBlock); CPPUNIT_TEST(testCountOutstandingRequest); CPPUNIT_TEST(testIsOutstandingRequest); CPPUNIT_TEST(testGetOutstandingRequest); CPPUNIT_TEST(testRemoveOutstandingRequest); CPPUNIT_TEST_SUITE_END(); private: std::shared_ptr dctx_; std::shared_ptr peer; std::unique_ptr btMessageDispatcher; std::unique_ptr messageFactory_; std::unique_ptr rgman_; std::shared_ptr