mirror of
https://github.com/aria2/aria2.git
synced 2025-04-04 21:17:41 +03:00
2009-10-22 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Moved static functions in Util class to namespace util. * src * test
This commit is contained in:
parent
3349fe0811
commit
c6035b2e24
129 changed files with 893 additions and 882 deletions
|
@ -53,7 +53,7 @@ void DHTGetPeersReplyMessageTest::testGetBencodedMessage()
|
|||
SharedHandle<DHTNode> nodes[8];
|
||||
for(size_t i = 0; i < DHTBucket::K; ++i) {
|
||||
nodes[i].reset(new DHTNode());
|
||||
nodes[i]->setIPAddress("192.168.0."+Util::uitos(i+1));
|
||||
nodes[i]->setIPAddress("192.168.0."+util::uitos(i+1));
|
||||
nodes[i]->setPort(6881+i);
|
||||
|
||||
unsigned char buf[6];
|
||||
|
@ -70,15 +70,15 @@ void DHTGetPeersReplyMessageTest::testGetBencodedMessage()
|
|||
|
||||
rDict["nodes"] = compactNodeInfo;
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(Util::urlencode(bencode::encode(dict)),
|
||||
Util::urlencode(msgbody));
|
||||
CPPUNIT_ASSERT_EQUAL(util::urlencode(bencode::encode(dict)),
|
||||
util::urlencode(msgbody));
|
||||
}
|
||||
rDict.removeKey("nodes");
|
||||
{
|
||||
std::deque<SharedHandle<Peer> > peers;
|
||||
BDE valuesList = BDE::list();
|
||||
for(size_t i = 0; i < 4; ++i) {
|
||||
SharedHandle<Peer> peer(new Peer("192.168.0."+Util::uitos(i+1), 6881+i));
|
||||
SharedHandle<Peer> peer(new Peer("192.168.0."+util::uitos(i+1), 6881+i));
|
||||
unsigned char buffer[6];
|
||||
CPPUNIT_ASSERT(bittorrent::createcompact
|
||||
(buffer, peer->ipaddr, peer->port));
|
||||
|
@ -90,8 +90,8 @@ void DHTGetPeersReplyMessageTest::testGetBencodedMessage()
|
|||
msg.setValues(peers);
|
||||
std::string msgbody = msg.getBencodedMessage();
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(Util::urlencode(bencode::encode(dict)),
|
||||
Util::urlencode(msgbody));
|
||||
CPPUNIT_ASSERT_EQUAL(util::urlencode(bencode::encode(dict)),
|
||||
util::urlencode(msgbody));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue