From 98722ae8e842f54ff1dd67756cfeae7177431665 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Thu, 11 Dec 2014 22:52:20 +0100 Subject: Whisper test fix. --- whisperTopic.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'whisperTopic.cpp') diff --git a/whisperTopic.cpp b/whisperTopic.cpp index 493b37bc..941c790e 100644 --- a/whisperTopic.cpp +++ b/whisperTopic.cpp @@ -32,7 +32,7 @@ BOOST_AUTO_TEST_SUITE(whisper) BOOST_AUTO_TEST_CASE(topic) { - g_logVerbosity = 0; + g_logVerbosity = 20; bool started = false; unsigned result = 0; @@ -40,16 +40,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 +65,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 +80,8 @@ BOOST_AUTO_TEST_CASE(topic) } listener.join(); + g_logVerbosity = 0; + BOOST_REQUIRE_EQUAL(result, 1 + 9 + 25 + 49 + 81); } -- cgit From c9ccbe2562c35ecb957dc52f72dfc9c9555335e5 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Fri, 12 Dec 2014 13:35:05 +0100 Subject: Reduce verbosity. --- whisperTopic.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'whisperTopic.cpp') diff --git a/whisperTopic.cpp b/whisperTopic.cpp index 941c790e..1c8e7483 100644 --- a/whisperTopic.cpp +++ b/whisperTopic.cpp @@ -32,7 +32,8 @@ BOOST_AUTO_TEST_SUITE(whisper) BOOST_AUTO_TEST_CASE(topic) { - g_logVerbosity = 20; + cnote << "Testing Whisper..."; + g_logVerbosity = 0; bool started = false; unsigned result = 0; -- cgit From 73a2647474251168cde3febc6708eaa4d751e19d Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Fri, 12 Dec 2014 15:31:24 +0100 Subject: Fix tests. --- whisperTopic.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'whisperTopic.cpp') diff --git a/whisperTopic.cpp b/whisperTopic.cpp index 1c8e7483..c5e59332 100644 --- a/whisperTopic.cpp +++ b/whisperTopic.cpp @@ -33,7 +33,7 @@ BOOST_AUTO_TEST_SUITE(whisper) BOOST_AUTO_TEST_CASE(topic) { cnote << "Testing Whisper..."; - g_logVerbosity = 0; +// g_logVerbosity = 0; bool started = false; unsigned result = 0; @@ -81,7 +81,7 @@ BOOST_AUTO_TEST_CASE(topic) } listener.join(); - g_logVerbosity = 0; +// g_logVerbosity = 0; BOOST_REQUIRE_EQUAL(result, 1 + 9 + 25 + 49 + 81); } -- cgit