Fixing issues.

This commit is contained in:
clemahieu 2014-10-22 23:04:44 -05:00
commit e801cc7104
6 changed files with 14 additions and 22 deletions

View file

@ -51,7 +51,6 @@ add_executable (test
rai/test/wallet_test.cpp
rai/test/daemon.cpp
rai/test/uint256_union.cpp
rai/test/bulk_req_initiator.cpp
)
add_executable (qt_test

View file

@ -49,7 +49,7 @@ namespace
}
bool constexpr log_to_cerr ()
{
return true;
return false;
}
}
@ -2506,22 +2506,22 @@ void rai::bulk_req_initiator::received_type (boost::system::error_code const & e
{
case rai::block_type::send:
{
boost::asio::async_read (connection->socket, boost::asio::buffer (receive_buffer.data () + 1, 64 + 32 + 32 + 32), [this_l] (boost::system::error_code const & ec, size_t size_a) {this_l->received_block (ec, size_a);});
boost::asio::async_read (connection->socket, boost::asio::buffer (receive_buffer.data () + 1, sizeof (rai::signature) + sizeof (rai::block_hash) + sizeof (rai::amount) + sizeof (rai::address)), [this_l] (boost::system::error_code const & ec, size_t size_a) {this_l->received_block (ec, size_a);});
break;
}
case rai::block_type::receive:
{
boost::asio::async_read (connection->socket, boost::asio::buffer (receive_buffer.data () + 1, 64 + 32 + 32), [this_l] (boost::system::error_code const & ec, size_t size_a) {this_l->received_block (ec, size_a);});
boost::asio::async_read (connection->socket, boost::asio::buffer (receive_buffer.data () + 1, sizeof (rai::signature) + sizeof (rai::block_hash) + sizeof (rai::block_hash)), [this_l] (boost::system::error_code const & ec, size_t size_a) {this_l->received_block (ec, size_a);});
break;
}
case rai::block_type::open:
{
boost::asio::async_read (connection->socket, boost::asio::buffer (receive_buffer.data () + 1, 32 + 32 + 64), [this_l] (boost::system::error_code const & ec, size_t size_a) {this_l->received_block (ec, size_a);});
boost::asio::async_read (connection->socket, boost::asio::buffer (receive_buffer.data () + 1, sizeof (rai::signature) + sizeof (rai::block_hash) + sizeof (rai::address)), [this_l] (boost::system::error_code const & ec, size_t size_a) {this_l->received_block (ec, size_a);});
break;
}
case rai::block_type::change:
{
boost::asio::async_read (connection->socket, boost::asio::buffer (receive_buffer.data () + 1, 32 + 32 + 64), [this_l] (boost::system::error_code const & ec, size_t size_a) {this_l->received_block (ec, size_a);});
boost::asio::async_read (connection->socket, boost::asio::buffer (receive_buffer.data () + 1, sizeof (rai::signature) + sizeof (rai::block_hash) + sizeof (rai::address)), [this_l] (boost::system::error_code const & ec, size_t size_a) {this_l->received_block (ec, size_a);});
break;
}
case rai::block_type::not_a_block:

View file

@ -1,7 +0,0 @@
#include <gtest/gtest.h>
#include <rai/core/core.hpp>
TEST (bulk_req_initiator, receive_send)
{
}

View file

@ -87,7 +87,7 @@ TEST (client, send_single_many_peers)
system.service->poll_one ();
system.processor.poll_one ();
++iterations;
ASSERT_LT (iterations, 200);
ASSERT_LT (iterations, 2000);
}
}
@ -158,7 +158,7 @@ TEST (client, auto_bootstrap_reverse)
system.service->poll_one ();
system.processor.poll_one ();
++iterations;
ASSERT_LT (iterations, 20);
ASSERT_LT (iterations, 200);
} while (client1->ledger.account_balance (key2.pub) != 100);
}

View file

@ -676,7 +676,7 @@ TEST (system, generate_send_existing)
ASSERT_FALSE (system.clients [0]->store.latest_get (rai::test_genesis_key.pub, frontier2));
ASSERT_NE (frontier1.hash, frontier2.hash);
auto iterations1 (0);
while (system.clients [0]->ledger.account_balance (rai::test_genesis_key.pub) == std::numeric_limits <rai::uint256_t>::max ())
while (system.clients [0]->ledger.account_balance (rai::test_genesis_key.pub) == std::numeric_limits <rai::uint128_t>::max ())
{
system.service->poll_one ();
system.processor.poll_one ();
@ -684,7 +684,7 @@ TEST (system, generate_send_existing)
ASSERT_LT (iterations1, 20);
}
auto iterations2 (0);
while (system.clients [0]->ledger.account_balance (rai::test_genesis_key.pub) != std::numeric_limits <rai::uint256_t>::max ())
while (system.clients [0]->ledger.account_balance (rai::test_genesis_key.pub) != std::numeric_limits <rai::uint128_t>::max ())
{
system.service->poll_one ();
system.processor.poll_one ();

View file

@ -846,7 +846,7 @@ TEST (bootstrap_processor, process_one)
{
system.service->poll_one ();
++iterations;
ASSERT_LT (iterations, 20);
ASSERT_LT (iterations, 200);
}
auto hash3 (client1->ledger.latest (rai::test_genesis_key.pub));
ASSERT_EQ (hash1, hash3);
@ -874,7 +874,7 @@ TEST (bootstrap_processor, process_two)
{
system.service->run_one ();
++iterations;
ASSERT_LT (iterations, 20);
ASSERT_LT (iterations, 200);
}
auto hash4 (client1->ledger.latest (rai::test_genesis_key.pub));
ASSERT_EQ (hash3, hash4);
@ -893,7 +893,7 @@ TEST (bootstrap_processor, process_new)
system.service->poll_one ();
system.processor.poll_one ();
++iterations1;
ASSERT_LT (iterations1, 20);
ASSERT_LT (iterations1, 200);
}
auto balance1 (system.clients [0]->ledger.account_balance (rai::test_genesis_key.pub));
auto balance2 (system.clients [0]->ledger.account_balance (key2.pub));
@ -904,10 +904,10 @@ TEST (bootstrap_processor, process_new)
auto iterations2 (0);
while (client1->ledger.account_balance (key2.pub) != balance2)
{
system.service->run_one ();
system.service->poll_one ();
system.processor.poll_one ();
++iterations2;
ASSERT_LT (iterations2, 20);
ASSERT_LT (iterations2, 200);
}
ASSERT_EQ (balance1, client1->ledger.account_balance (rai::test_genesis_key.pub));
}