mirror of
https://github.com/aria2/aria2.git
synced 2025-04-06 05:57:36 +03:00
2008-02-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added test 'testDoReceivedAction' for DHTQueryMessage subclasses. * test/DHTPingMessageTest.cc * test/DHTGetPeersMessageTest.cc * test/DHTFindNodeMessageTest.cc * test/DHTAnnouncePeerMessageTest.cc * test/MockDHTMessage.h * test/MockDHTMessageFactory.h * test/MockDHTMessageDispatcher.h: New class.
This commit is contained in:
parent
e9f980afc7
commit
bebb7e1976
8 changed files with 360 additions and 7 deletions
|
@ -2,19 +2,29 @@
|
|||
#define _D_MOCK_DHT_MESSAGE_H_
|
||||
|
||||
#include "DHTMessage.h"
|
||||
#include "DHTNode.h"
|
||||
#include "Peer.h"
|
||||
#include <deque>
|
||||
|
||||
namespace aria2 {
|
||||
|
||||
class MockDHTMessage:public DHTMessage {
|
||||
private:
|
||||
public:
|
||||
bool _isReply;
|
||||
|
||||
std::string _messageType;
|
||||
|
||||
std::deque<SharedHandle<DHTNode> > _nodes;
|
||||
|
||||
std::deque<SharedHandle<Peer> > _peers;
|
||||
|
||||
std::string _token;
|
||||
public:
|
||||
MockDHTMessage(const SharedHandle<DHTNode>& localNode,
|
||||
const SharedHandle<DHTNode>& remoteNode,
|
||||
const std::string& messageType = "mock",
|
||||
const std::string& transactionID = ""):
|
||||
DHTMessage(localNode, remoteNode, transactionID), _isReply(false), _messageType("mock") {}
|
||||
DHTMessage(localNode, remoteNode, transactionID), _isReply(false), _messageType(messageType) {}
|
||||
|
||||
virtual ~MockDHTMessage() {}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue