mirror of
https://github.com/aria2/aria2.git
synced 2025-04-05 05:27:38 +03:00
2008-02-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Removed "using namespace std;" from all sources. Appended std:: prefix to c++ standard classes. Included string.h where mem* function are used.
This commit is contained in:
parent
d82e183d34
commit
1b7c198289
801 changed files with 12024 additions and 8627 deletions
|
@ -1,13 +1,15 @@
|
|||
#include "BtPortMessage.h"
|
||||
#include "PeerMessageUtil.h"
|
||||
#include "Util.h"
|
||||
#include "Peer.h"
|
||||
#include "DHTNode.h"
|
||||
#include "MockDHTTask.h"
|
||||
#include "MockDHTTaskFactory.h"
|
||||
#include "MockDHTTaskQueue.h"
|
||||
#include <cstring>
|
||||
#include <cppunit/extensions/HelperMacros.h>
|
||||
|
||||
using namespace std;
|
||||
namespace aria2 {
|
||||
|
||||
class BtPortMessageTest:public CppUnit::TestFixture {
|
||||
|
||||
|
@ -30,8 +32,8 @@ public:
|
|||
|
||||
class MockDHTTaskFactory2:public MockDHTTaskFactory {
|
||||
public:
|
||||
virtual DHTTaskHandle createPingTask(const DHTNodeHandle& remoteNode,
|
||||
size_t numRetry)
|
||||
virtual SharedHandle<DHTTask>
|
||||
createPingTask(const SharedHandle<DHTNode>& remoteNode, size_t numRetry)
|
||||
{
|
||||
return new MockDHTTask(remoteNode);
|
||||
}
|
||||
|
@ -69,7 +71,7 @@ void BtPortMessageTest::testCreate() {
|
|||
|
||||
void BtPortMessageTest::testToString() {
|
||||
BtPortMessage msg(1);
|
||||
CPPUNIT_ASSERT_EQUAL(string("port port=1"), msg.toString());
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("port port=1"), msg.toString());
|
||||
}
|
||||
|
||||
void BtPortMessageTest::testGetMessage() {
|
||||
|
@ -82,7 +84,7 @@ void BtPortMessageTest::testGetMessage() {
|
|||
|
||||
void BtPortMessageTest::testDoReceivedAction()
|
||||
{
|
||||
PeerHandle peer = new Peer("192.168.0.1", 6881);
|
||||
SharedHandle<Peer> peer = new Peer("192.168.0.1", 6881);
|
||||
BtPortMessage msg(6881);
|
||||
MockDHTTaskQueue taskQueue;
|
||||
MockDHTTaskFactory2 taskFactory;
|
||||
|
@ -93,7 +95,9 @@ void BtPortMessageTest::testDoReceivedAction()
|
|||
msg.doReceivedAction();
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)1, taskQueue._immediateTaskQueue.size());
|
||||
DHTNodeHandle node = SharedHandle<MockDHTTask>(taskQueue._immediateTaskQueue.front())->_remoteNode;
|
||||
CPPUNIT_ASSERT_EQUAL(string("192.168.0.1"), node->getIPAddress());
|
||||
SharedHandle<DHTNode> node = SharedHandle<MockDHTTask>(taskQueue._immediateTaskQueue.front())->_remoteNode;
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("192.168.0.1"), node->getIPAddress());
|
||||
CPPUNIT_ASSERT_EQUAL((uint16_t)6881, node->getPort());
|
||||
}
|
||||
|
||||
} // namespace aria2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue