aboutsummaryrefslogtreecommitdiffstats
path: root/whisperTopic.cpp
diff options
context:
space:
mode:
authorPaweł Bylica <pawel.bylica@imapp.pl>2014-12-12 23:46:38 +0800
committerPaweł Bylica <pawel.bylica@imapp.pl>2014-12-12 23:46:38 +0800
commit180b0fa9e3aab595048d171ff4556a769f85dd1e (patch)
tree776947a515b1274b51a563760cf374d5a58a1ca3 /whisperTopic.cpp
parentef593b751b97df54825c2ce94079aab4737c81e9 (diff)
parenta9b5c1b9cab3aee23b2df8f260ed935b36de257d (diff)
downloaddexon-solidity-180b0fa9e3aab595048d171ff4556a769f85dd1e.tar.gz
dexon-solidity-180b0fa9e3aab595048d171ff4556a769f85dd1e.tar.zst
dexon-solidity-180b0fa9e3aab595048d171ff4556a769f85dd1e.zip
Merge branch 'develop-evmcc' into pr-jit
Diffstat (limited to 'whisperTopic.cpp')
-rw-r--r--whisperTopic.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/whisperTopic.cpp b/whisperTopic.cpp
index 493b37bc..c5e59332 100644
--- a/whisperTopic.cpp
+++ b/whisperTopic.cpp
@@ -32,7 +32,8 @@ BOOST_AUTO_TEST_SUITE(whisper)
BOOST_AUTO_TEST_CASE(topic)
{
- g_logVerbosity = 0;
+ cnote << "Testing Whisper...";
+// g_logVerbosity = 0;
bool started = false;
unsigned result = 0;
@@ -40,16 +41,16 @@ BOOST_AUTO_TEST_CASE(topic)
{
setThreadName("other");
- Host ph("Test", NetworkPreferences(30303, "", false, true));
+ Host ph("Test", NetworkPreferences(50303, "", false, true));
auto wh = ph.registerCapability(new WhisperHost());
ph.start();
started = true;
/// Only interested in odd packets
- auto w = wh->installWatch(BuildTopicMask()("odd"));
+ auto w = wh->installWatch(BuildTopicMask("odd"));
- for (int i = 0, last = 0; i < 100 && last < 81; ++i)
+ for (int i = 0, last = 0; i < 200 && last < 81; ++i)
{
for (auto i: wh->checkWatch(w))
{
@@ -65,10 +66,12 @@ BOOST_AUTO_TEST_CASE(topic)
while (!started)
this_thread::sleep_for(chrono::milliseconds(50));
- Host ph("Test", NetworkPreferences(30300, "", false, true));
+ Host ph("Test", NetworkPreferences(50300, "", false, true));
auto wh = ph.registerCapability(new WhisperHost());
+ this_thread::sleep_for(chrono::milliseconds(500));
ph.start();
- ph.connect("127.0.0.1", 30303);
+ this_thread::sleep_for(chrono::milliseconds(500));
+ ph.connect("127.0.0.1", 50303);
KeyPair us = KeyPair::create();
for (int i = 0; i < 10; ++i)
@@ -78,6 +81,8 @@ BOOST_AUTO_TEST_CASE(topic)
}
listener.join();
+// g_logVerbosity = 0;
+
BOOST_REQUIRE_EQUAL(result, 1 + 9 + 25 + 49 + 81);
}