Added test case for broken merge on empty undo_db
This commit is contained in:
parent
7d0d61ab43
commit
731338f03c
1 changed files with 19 additions and 0 deletions
|
|
@ -59,3 +59,22 @@ BOOST_AUTO_TEST_CASE( undo_test )
|
|||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( merge_test )
|
||||
{
|
||||
try {
|
||||
database db;
|
||||
auto ses = db._undo_db.start_undo_session();
|
||||
const auto& bal_obj1 = db.create<account_balance_object>( [&]( account_balance_object& obj ){
|
||||
obj.balance = 42;
|
||||
});
|
||||
ses.merge();
|
||||
|
||||
auto balance = db.get_balance( account_id_type(), asset_id_type() );
|
||||
BOOST_CHECK_EQUAL( 42, balance.amount.value );
|
||||
} catch ( const fc::exception& e )
|
||||
{
|
||||
edump( (e.to_detail_string()) );
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue