Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/test/walletdb_tests.cpp
Show All 31 Lines | fs::path path = | ||||
dir / strprintf("testwallet%i", static_cast<int>(GetRand(1000000))); | dir / strprintf("testwallet%i", static_cast<int>(GetRand(1000000))); | ||||
return std::unique_ptr<CWalletDBWrapper>( | return std::unique_ptr<CWalletDBWrapper>( | ||||
new CWalletDBWrapper(&bitdb, path.string())); | new CWalletDBWrapper(&bitdb, path.string())); | ||||
} | } | ||||
static std::unique_ptr<CWallet> LoadWallet(CWalletDB *db) { | static std::unique_ptr<CWallet> LoadWallet(CWalletDB *db) { | ||||
std::unique_ptr<CWallet> wallet(new CWallet(Params())); | std::unique_ptr<CWallet> wallet(new CWallet(Params())); | ||||
DBErrors res = db->LoadWallet(wallet.get()); | DBErrors res = db->LoadWallet(wallet.get()); | ||||
BOOST_CHECK(res == DB_LOAD_OK); | BOOST_CHECK(res == DBErrors::LOAD_OK); | ||||
return wallet; | return wallet; | ||||
} | } | ||||
} // namespace | } // namespace | ||||
BOOST_FIXTURE_TEST_SUITE(walletdb_tests, WalletDBTestingSetup) | BOOST_FIXTURE_TEST_SUITE(walletdb_tests, WalletDBTestingSetup) | ||||
BOOST_AUTO_TEST_CASE(write_erase_name) { | BOOST_AUTO_TEST_CASE(write_erase_name) { | ||||
auto walletdbwrapper = TmpDB(pathTemp, "write_erase_name"); | auto walletdbwrapper = TmpDB(pathTemp, "write_erase_name"); | ||||
▲ Show 20 Lines • Show All 95 Lines • Show Last 20 Lines |