Rewritten DHTRoutingTableSerializer using stdio instead of stream.

This commit is contained in:
Tatsuhiro Tsujikawa 2011-08-05 22:15:55 +09:00
parent f141cd4228
commit dea7a7969c
5 changed files with 55 additions and 49 deletions

View file

@ -55,9 +55,7 @@ void DHTRoutingTableDeserializerTest::testDeserialize()
s.setNodes(nodes);
std::string filename = A2_TEST_OUT_DIR"/aria2_DHTRoutingTableDeserializerTest_testDeserialize";
std::ofstream outfile(filename.c_str(), std::ios::binary);
s.serialize(outfile);
outfile.close();
s.serialize(filename);
DHTRoutingTableDeserializer d(AF_INET);
d.deserialize(filename);
@ -96,9 +94,7 @@ void DHTRoutingTableDeserializerTest::testDeserialize6()
s.setNodes(nodes);
std::string filename = A2_TEST_OUT_DIR"/aria2_DHTRoutingTableDeserializerTest_testDeserialize6";
std::ofstream outfile(filename.c_str(), std::ios::binary);
s.serialize(outfile);
outfile.close();
s.serialize(filename);
DHTRoutingTableDeserializer d(AF_INET6);
d.deserialize(filename);