Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/test/walletdb_tests.cpp
| Show All 29 Lines | BOOST_CHECK_MESSAGE(fs::create_directory(dir), | ||||
| "Unable to create a directory for test " + testname); | "Unable to create a directory for test " + testname); | ||||
| fs::path path = | 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(GetConfig())); | ||||
| DBErrors res = db->LoadWallet(wallet.get()); | DBErrors res = db->LoadWallet(wallet.get()); | ||||
| BOOST_CHECK(res == DB_LOAD_OK); | BOOST_CHECK(res == DB_LOAD_OK); | ||||
| return wallet; | return wallet; | ||||
| } | } | ||||
| } // namespace | } // namespace | ||||
| BOOST_FIXTURE_TEST_SUITE(walletdb_tests, WalletDBTestingSetup); | BOOST_FIXTURE_TEST_SUITE(walletdb_tests, WalletDBTestingSetup); | ||||
| ▲ Show 20 Lines • Show All 97 Lines • Show Last 20 Lines | |||||