diff --git a/peer.cpp b/peer.cpp index 5c3e677f6..7c128276e 100644 --- a/peer.cpp +++ b/peer.cpp @@ -44,7 +44,7 @@ BOOST_AUTO_TEST_CASE(host) host1.addNode(node2, "127.0.0.1", host2prefs.listenPort, host2prefs.listenPort); - this_thread::sleep_for(chrono::seconds(1)); + this_thread::sleep_for(chrono::seconds(3)); } BOOST_AUTO_TEST_SUITE_END() diff --git a/whisperTopic.cpp b/whisperTopic.cpp index 02fccbc9f..eccdf16c0 100644 --- a/whisperTopic.cpp +++ b/whisperTopic.cpp @@ -34,12 +34,21 @@ BOOST_AUTO_TEST_CASE(topic) { cnote << "Testing Whisper..."; auto oldLogVerbosity = g_logVerbosity; - g_logVerbosity = 5; + g_logVerbosity = 0; - Host phOther("Test", NetworkPreferences(30303, "127.0.0.1", true, true)); + Host phOther("Test", NetworkPreferences(30303, "127.0.0.1", false, true)); auto whOther = phOther.registerCapability(new WhisperHost()); phOther.start(); + Host ph("Test", NetworkPreferences(30300, "127.0.0.1", false, true)); + auto wh = ph.registerCapability(new WhisperHost()); + ph.start(); + + this_thread::sleep_for(chrono::milliseconds(100)); + ph.addNode(phOther.id(), "127.0.0.1", 30303, 30303); + + this_thread::sleep_for(chrono::milliseconds(500)); + bool started = false; unsigned result = 0; std::thread listener([&]() @@ -61,16 +70,11 @@ BOOST_AUTO_TEST_CASE(topic) } this_thread::sleep_for(chrono::milliseconds(50)); } + }); - Host ph("Test", NetworkPreferences(30300, "127.0.0.1", true, true)); - auto wh = ph.registerCapability(new WhisperHost()); - ph.start(); - ph.addNode(phOther.id(), "127.0.0.1", 30303, 30303); - - this_thread::sleep_for(chrono::milliseconds(300)); while (!started) - this_thread::sleep_for(chrono::milliseconds(25)); + this_thread::sleep_for(chrono::milliseconds(1)); KeyPair us = KeyPair::create();