Added test case for broken merge on empty undo_db

This commit is contained in:
Peter Conrad 2017-08-06 18:59:31 +02:00 committed by gladcow
parent 7d0d61ab43
commit 731338f03c

View file

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