operation_tests2.cpp: Fix witness_create test to comply with new witness schedule (breakage revealed by #427)

This commit is contained in:
theoreticalbts 2015-10-31 10:39:16 -04:00
parent cf4efca17f
commit e1a692b33c

View file

@ -453,15 +453,16 @@ BOOST_AUTO_TEST_CASE( witness_create )
generate_block();
int produced = 0;
// Make sure we get scheduled exactly once in witnesses.size() blocks
// Make sure we get scheduled at least once in witnesses.size()*2 blocks
// may take this many unless we measure where in the scheduling round we are
// TODO: intense_test that repeats this loop many times
for( size_t i=0; i<witnesses.size(); i++ )
for( size_t i=0, n=witnesses.size()*2; i<n; i++ )
{
signed_block block = generate_block();
if( block.witness == nathan_witness_id )
produced++;
}
BOOST_CHECK_EQUAL( produced, 2 );
BOOST_CHECK_GE( produced, 1 );
} FC_LOG_AND_RETHROW() }
/**