mirror of
https://github.com/aria2/aria2.git
synced 2025-04-04 21:17:41 +03:00
Rewritten DHTRoutingTableSerializer using stdio instead of stream.
This commit is contained in:
parent
f141cd4228
commit
dea7a7969c
5 changed files with 55 additions and 49 deletions
|
@ -1,7 +1,7 @@
|
|||
#include "DHTRoutingTableSerializer.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <sstream>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
#include <cppunit/extensions/HelperMacros.h>
|
||||
|
@ -115,8 +115,10 @@ void DHTRoutingTableSerializerTest::testSerialize()
|
|||
s.setLocalNode(localNode);
|
||||
s.setNodes(nodes);
|
||||
|
||||
std::stringstream ss;
|
||||
s.serialize(ss);
|
||||
std::string filename = A2_TEST_OUT_DIR"/aria2_DHTRoutingTableSerializerTest_testSerialize";
|
||||
s.serialize(filename);
|
||||
|
||||
std::ifstream ss(filename.c_str(), std::ios::binary);
|
||||
|
||||
checkToLocalnode(ss, localNode);
|
||||
size_t numNodes = 3;
|
||||
|
@ -242,8 +244,10 @@ void DHTRoutingTableSerializerTest::testSerialize6()
|
|||
s.setLocalNode(localNode);
|
||||
s.setNodes(nodes);
|
||||
|
||||
std::stringstream ss;
|
||||
s.serialize(ss);
|
||||
std::string filename = A2_TEST_OUT_DIR"/aria2_DHTRoutingTableSerializerTest_testSerialize6";
|
||||
s.serialize(filename);
|
||||
|
||||
std::ifstream ss(filename.c_str(), std::ios::binary);
|
||||
|
||||
checkToLocalnode(ss, localNode);
|
||||
size_t numNodes = 2;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue