aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsubtly <subtly@users.noreply.github.com>2014-12-28 21:24:21 +0800
committersubtly <subtly@users.noreply.github.com>2014-12-28 21:24:21 +0800
commit94c1a961d9e7bfc951e10a8a81fc1513c23b9f65 (patch)
tree9afe381862bfb18a275c7480f7d9c7e9c1f6fd9a
parent60f2344b2bbb9efec42469cebf62570dc5068284 (diff)
downloaddexon-solidity-94c1a961d9e7bfc951e10a8a81fc1513c23b9f65.tar.gz
dexon-solidity-94c1a961d9e7bfc951e10a8a81fc1513c23b9f65.tar.zst
dexon-solidity-94c1a961d9e7bfc951e10a8a81fc1513c23b9f65.zip
manually populate nodes for test rather than leveraging ping
-rw-r--r--net.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/net.cpp b/net.cpp
index d9b5d157..8a2e2af7 100644
--- a/net.cpp
+++ b/net.cpp
@@ -111,6 +111,8 @@ struct TestNodeTableHost: public TestHost
void pingAll() { for (auto& t: nodeTables) t->pingTestNodes(testNodes); }
+ void populateAll(size_t _count = 0) { for (auto& t: nodeTables) t->populateTestNodes(testNodes, _count); }
+
void populate(size_t _count = 0) { nodeTable->populateTestNodes(testNodes, _count); }
KeyPair m_alias;
@@ -171,22 +173,21 @@ BOOST_AUTO_TEST_CASE(test_findnode_neighbors)
BOOST_AUTO_TEST_CASE(kademlia)
{
- TestNodeTableHost node(12);
+ // Not yet a 'real' test.
+ TestNodeTableHost node(8);
node.start();
node.nodeTable->join(); // ideally, joining with empty node table logs warning we can check for
node.setup();
node.populate();
clog << "NodeTable:\n" << *node.nodeTable.get() << endl;
- node.pingAll();
- this_thread::sleep_for(chrono::milliseconds(1000));
+ node.populateAll();
clog << "NodeTable:\n" << *node.nodeTable.get() << endl;
node.nodeTable->reset();
clog << "NodeTable:\n" << *node.nodeTable.get() << endl;
- node.populate(2);
- this_thread::sleep_for(chrono::milliseconds(500));
+ node.populate(1);
clog << "NodeTable:\n" << *node.nodeTable.get() << endl;
node.nodeTable->join();