2010-06-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Removed BDE and bencode
This commit is contained in:
Tatsuhiro Tsujikawa 2010-06-19 17:54:54 +00:00
parent 8ba97188ce
commit cb4e25e4b4
81 changed files with 1661 additions and 2848 deletions

View file

@ -7,7 +7,7 @@
#include "util.h"
#include "DHTBucket.h"
#include "bittorrent_helper.h"
#include "bencode.h"
#include "bencode2.h"
namespace aria2 {
@ -57,16 +57,16 @@ void DHTFindNodeReplyMessageTest::testGetBencodedMessage()
std::string msgbody = msg.getBencodedMessage();
BDE dict = BDE::dict();
dict["t"] = transactionID;
dict["v"] = BDE("A200");
dict["y"] = BDE("r");
BDE rDict = BDE::dict();
rDict["id"] = BDE(localNode->getID(), DHT_ID_LENGTH);
rDict["nodes"] = compactNodeInfo;
dict["r"] = rDict;
Dict dict;
dict.put("t", transactionID);
dict.put("v", "A200");
dict.put("y", "r");
SharedHandle<Dict> rDict = Dict::g();
rDict->put("id", String::g(localNode->getID(), DHT_ID_LENGTH));
rDict->put("nodes", compactNodeInfo);
dict.put("r", rDict);
CPPUNIT_ASSERT_EQUAL(bencode::encode(dict), msgbody);
CPPUNIT_ASSERT_EQUAL(bencode2::encode(&dict), msgbody);
}
} // namespace aria2