Browse Source

add test-require to p2p/host

cl-refactor
subtly 10 years ago
parent
commit
2e7ea3564c
  1. 2
      libp2p/Host.cpp
  2. 5
      test/peer.cpp
  3. 1
      test/whisperTopic.cpp

2
libp2p/Host.cpp

@ -626,7 +626,7 @@ void Host::restoreNodes(bytesConstRef _b)
auto id = (NodeId)i[2];
if (!m_peers.count(id))
{
// TODO: p2p Important :)
// TODO: p2p import/export :)
// auto n = noteNode(id, ep);
// n->lastConnected = chrono::system_clock::time_point(chrono::seconds(i[4].toInt<unsigned>()));
// n->lastAttempted = chrono::system_clock::time_point(chrono::seconds(i[5].toInt<unsigned>()));

5
test/peer.cpp

@ -44,7 +44,10 @@ BOOST_AUTO_TEST_CASE(host)
host1.addNode(node2, "127.0.0.1", host2prefs.listenPort, host2prefs.listenPort);
this_thread::sleep_for(chrono::seconds(3));
this_thread::sleep_for(chrono::seconds(1));
BOOST_REQUIRE_EQUAL(host1.peerCount(), 1);
BOOST_REQUIRE_EQUAL(host2.peerCount(), host1.peerCount());
}
BOOST_AUTO_TEST_SUITE_END()

1
test/whisperTopic.cpp

@ -75,7 +75,6 @@ BOOST_AUTO_TEST_CASE(topic)
while (!started)
this_thread::sleep_for(chrono::milliseconds(1));
KeyPair us = KeyPair::create();
for (int i = 0; i < 10; ++i)

Loading…
Cancel
Save