diff options
author | subtly <subtly@users.noreply.github.com> | 2015-02-05 09:50:03 +0800 |
---|---|---|
committer | subtly <subtly@users.noreply.github.com> | 2015-02-05 09:50:03 +0800 |
commit | c44376d1f9d97aabcc54f0fe791994f0d3e518f2 (patch) | |
tree | d6c0e59c69ee1a8b144e5b27824a2ab8ae8967cd /whisperTopic.cpp | |
parent | 74e509acd282f658a4e2d6f7ae0f4175474304ef (diff) | |
download | dexon-solidity-c44376d1f9d97aabcc54f0fe791994f0d3e518f2.tar.gz dexon-solidity-c44376d1f9d97aabcc54f0fe791994f0d3e518f2.tar.zst dexon-solidity-c44376d1f9d97aabcc54f0fe791994f0d3e518f2.zip |
fix whispertopic test
Diffstat (limited to 'whisperTopic.cpp')
-rw-r--r-- | whisperTopic.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/whisperTopic.cpp b/whisperTopic.cpp index 9c88d1b2..1dcc6b9d 100644 --- a/whisperTopic.cpp +++ b/whisperTopic.cpp @@ -40,15 +40,6 @@ BOOST_AUTO_TEST_CASE(topic) 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([&]() @@ -66,7 +57,7 @@ BOOST_AUTO_TEST_CASE(topic) { for (auto i: whOther->checkWatch(w)) { - Message msg = wh->envelope(i).open(wh->fullTopic(w)); + Message msg = whOther->envelope(i).open(whOther->fullTopic(w)); last = RLP(msg.payload()).toInt<unsigned>(); if (received.count(last)) continue; @@ -78,6 +69,15 @@ BOOST_AUTO_TEST_CASE(topic) } }); + + 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)); while (!started) this_thread::sleep_for(chrono::milliseconds(2)); |