Merge remote-tracking branch 'upstream/develop' into develop-evmcc

This commit is contained in:
Paweł Bylica 2014-12-12 09:52:07 +01:00
commit b0b14eca7f
2 changed files with 11 additions and 7 deletions

View File

@ -51,7 +51,7 @@ BOOST_AUTO_TEST_CASE(genesis_tests)
BOOST_CHECK_EQUAL(BlockChain::genesis().stateRoot, h256(o["genesis_state_root"].get_str()));
BOOST_CHECK_EQUAL(toHex(BlockChain::createGenesisBlock()), toHex(fromHex(o["genesis_rlp_hex"].get_str())));
BOOST_CHECK_EQUAL(sha3(BlockChain::createGenesisBlock()), h256(o["genesis_hash"].get_str()));
BOOST_CHECK_EQUAL(BlockInfo::headerHash(BlockChain::createGenesisBlock()), h256(o["genesis_hash"].get_str()));
}
BOOST_AUTO_TEST_SUITE_END()

View File

@ -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);
}