forked from lthn/blockchain
unittests: added db_accessor_tests.dtor_without_init (exposes a minor bug)
This commit is contained in:
parent
10ea355ae9
commit
cd1e3c115d
1 changed files with 20 additions and 0 deletions
|
|
@ -428,3 +428,23 @@ TEST(db_accessor_tests, median_db_cache_test)
|
|||
|
||||
m_naive_median.print_to_file(folder_name + "/naive_median_2.txt");
|
||||
}
|
||||
|
||||
|
||||
TEST(db_accessor_tests, dtor_without_init)
|
||||
{
|
||||
epee::shared_recursive_mutex m_rw_lock;
|
||||
|
||||
{
|
||||
tools::db::basic_db_accessor m_db(nullptr, m_rw_lock);
|
||||
ASSERT_FALSE(m_db.is_open());
|
||||
}
|
||||
|
||||
// make sure dtor called successfully with no exceptions
|
||||
|
||||
{
|
||||
tools::db::basic_db_accessor m_db(nullptr, m_rw_lock);
|
||||
m_db.close();
|
||||
ASSERT_FALSE(m_db.is_open());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue