From 2e7ea3564c10e498fdf8bbb3054c722b8f7845ac Mon Sep 17 00:00:00 2001 From: subtly Date: Sun, 25 Jan 2015 21:43:53 -0800 Subject: [PATCH] add test-require to p2p/host --- libp2p/Host.cpp | 2 +- test/peer.cpp | 5 ++++- test/whisperTopic.cpp | 1 - 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/libp2p/Host.cpp b/libp2p/Host.cpp index 11320e463..5bf0b937d 100644 --- a/libp2p/Host.cpp +++ b/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())); // n->lastAttempted = chrono::system_clock::time_point(chrono::seconds(i[5].toInt())); diff --git a/test/peer.cpp b/test/peer.cpp index 7c128276e..a4b07e0b3 100644 --- a/test/peer.cpp +++ b/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() diff --git a/test/whisperTopic.cpp b/test/whisperTopic.cpp index eccdf16c0..5bd8f0f88 100644 --- a/test/whisperTopic.cpp +++ b/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)