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:
Tatsuhiro Tsujikawa 2008-02-08 15:53:45 +00:00
parent d82e183d34
commit 1b7c198289
801 changed files with 12024 additions and 8627 deletions

View file

@ -3,6 +3,8 @@
#include "Exception.h"
#include <cppunit/extensions/HelperMacros.h>
namespace aria2 {
class DHTUnknownMessageTest:public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(DHTUnknownMessageTest);
@ -21,24 +23,26 @@ CPPUNIT_TEST_SUITE_REGISTRATION(DHTUnknownMessageTest);
void DHTUnknownMessageTest::testToString()
{
DHTNodeHandle localNode = new DHTNode();
string ipaddr = "192.168.0.1";
SharedHandle<DHTNode> localNode = new DHTNode();
std::string ipaddr = "192.168.0.1";
uint16_t port = 6881;
{
// data.size() > 8
string data = "chocolate";
DHTUnknownMessage msg(localNode, remoteNode, data.c_str(), data.size(),
std::string data = "chocolate";
DHTUnknownMessage msg(localNode, data.c_str(), data.size(),
ipaddr, port);
CPPUNIT_ASSERT_EQUAL(string("dht unknown Remote:192.168.0.1:6881 length=9, first 8 bytes(hex)=63686f636f6c617465"), msg.toString());
CPPUNIT_ASSERT_EQUAL(std::string("dht unknown Remote:192.168.0.1:6881 length=9, first 8 bytes(hex)=63686f636f6c6174"), msg.toString());
}
{
// data.size() == 3
string data = "foo";
DHTUnknownMessage msg(localNode, remoteNode, data.c_str(), data.size(),
std::string data = "foo";
DHTUnknownMessage msg(localNode, data.c_str(), data.size(),
ipaddr, port);
CPPUNIT_ASSERT_EQUAL(string("dht unknown Remote:192.168.0.1:6881 length=9, first 8 bytes(hex)=66666f"), msg.toString());
CPPUNIT_ASSERT_EQUAL(std::string("dht unknown Remote:192.168.0.1:6881 length=3, first 8 bytes(hex)=666f6f"), msg.toString());
}
}
} // namespace aria2