提交 ff707c0a 编写于 作者: B Bart Wyatt

remove testers estimation of cpu usage which was horribly broken by...

remove testers estimation of cpu usage which was horribly broken by 18009d1e but not detected due to a math error put into the chain_controller.  Also fixed tests whose assumptions were now wrong after the removal of said estimation.  Finally, fixed the dice contract which was expecting empty tables to exist. EOSIO/eos#2042
上级 9faa7afc
......@@ -132,8 +132,8 @@ namespace eosio { namespace testing {
trx.net_usage_words = estimated_size / 8;
// estimate the usage of the context free actions
trx.kcpu_usage = 30000 + extra_cf_cpu_usage + (trx.context_free_actions.size() * config::default_base_per_action_cpu_usage * 10);
// dont estimate the cpu_usage
trx.kcpu_usage = 0;
}
......
......@@ -696,13 +696,13 @@ BOOST_FIXTURE_TEST_CASE(transaction_tests, TESTER) { try {
control->push_deferred_transactions( true );
// test test_transaction_size
CALL_TEST_FUNCTION(*this, "test_transaction", "test_transaction_size", fc::raw::pack(57) );
CALL_TEST_FUNCTION(*this, "test_transaction", "test_transaction_size", fc::raw::pack(55) );
control->push_deferred_transactions( true );
// test test_read_transaction
// this is a bit rough, but I couldn't figure out a better way to compare the hashes
auto tx_trace = CALL_TEST_FUNCTION( *this, "test_transaction", "test_read_transaction", {} );
string sha_expect = "274e873c8b2e4de20de06e53c99fe703b5099ce4faaf5d78195a4a2538caba15";
string sha_expect = "f899d4ec365702f99607bc640ec21a21b109eee01504011769a9fd4f41a5b72c";
BOOST_CHECK_EQUAL(tx_trace.action_traces.front().console == sha_expect, true);
// test test_tapos_block_num
CALL_TEST_FUNCTION(*this, "test_transaction", "test_tapos_block_num", fc::raw::pack(control->head_block_num()) );
......
......@@ -417,13 +417,11 @@ BOOST_FIXTURE_TEST_CASE( dice_test, dice_tester ) try {
// No games in table
auto* game_tid = find_table(N(dice), N(dice), N(game));
BOOST_CHECK(game_tid != nullptr);
BOOST_CHECK(game_tid->count == 0);
BOOST_CHECK(game_tid == nullptr);
// No offers in table
auto* offer_tid = find_table(N(dice), N(dice), N(offer));
BOOST_CHECK(offer_tid != nullptr);
BOOST_CHECK(offer_tid->count == 0);
BOOST_CHECK(offer_tid == nullptr);
// 2 records in account table (Bob & Carol)
auto* account_tid = find_table(N(dice), N(dice), N(account));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册