mirror of
https://github.com/aria2/aria2.git
synced 2025-04-06 22:17:38 +03:00
2008-03-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Use unsigned char for data store.
This commit is contained in:
parent
7578d5fb22
commit
fc0fa4203a
86 changed files with 378 additions and 312 deletions
|
@ -30,7 +30,9 @@ void DHTUnknownMessageTest::testToString()
|
|||
{
|
||||
// data.size() > 8
|
||||
std::string data = "chocolate";
|
||||
DHTUnknownMessage msg(localNode, data.c_str(), data.size(),
|
||||
DHTUnknownMessage msg(localNode,
|
||||
reinterpret_cast<const unsigned char*>(data.c_str()),
|
||||
data.size(),
|
||||
ipaddr, port);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("dht unknown Remote:192.168.0.1:6881 length=9, first 8 bytes(hex)=63686f636f6c6174"), msg.toString());
|
||||
|
@ -38,7 +40,9 @@ void DHTUnknownMessageTest::testToString()
|
|||
{
|
||||
// data.size() == 3
|
||||
std::string data = "foo";
|
||||
DHTUnknownMessage msg(localNode, data.c_str(), data.size(),
|
||||
DHTUnknownMessage msg(localNode,
|
||||
reinterpret_cast<const unsigned char*>(data.c_str()),
|
||||
data.size(),
|
||||
ipaddr, port);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("dht unknown Remote:192.168.0.1:6881 length=3, first 8 bytes(hex)=666f6f"), msg.toString());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue