mirror of
https://github.com/aria2/aria2.git
synced 2025-04-04 21:17:41 +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
|
@ -108,7 +108,8 @@ void DHTRoutingTableSerializerTest::testSerialize()
|
|||
// 6bytes compact peer info
|
||||
ss.read(buf, 6);
|
||||
{
|
||||
std::pair<std::string, uint16_t> peer = PeerMessageUtil::unpackcompact(buf);
|
||||
std::pair<std::string, uint16_t> peer =
|
||||
PeerMessageUtil::unpackcompact(reinterpret_cast<const unsigned char*>(buf));
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("192.168.0.1"), peer.first);
|
||||
CPPUNIT_ASSERT_EQUAL((uint16_t)6881, peer.second);
|
||||
}
|
||||
|
@ -166,7 +167,8 @@ void DHTRoutingTableSerializerTest::testSerialize()
|
|||
// 6bytes compact peer info
|
||||
ss.read(buf, 6);
|
||||
{
|
||||
std::pair<std::string, uint16_t> peer = PeerMessageUtil::unpackcompact(buf);
|
||||
std::pair<std::string, uint16_t> peer =
|
||||
PeerMessageUtil::unpackcompact(reinterpret_cast<const unsigned char*>(buf));
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("192.168.0.3"), peer.first);
|
||||
CPPUNIT_ASSERT_EQUAL((uint16_t)6883, peer.second);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue