diff options
| author | Wladimir J. van der Laan <[email protected]> | 2016-04-19 10:49:40 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2016-04-19 10:49:48 +0200 |
| commit | 187186b0fe039010ea4b81edb671b9bdfc63d29a (patch) | |
| tree | 11e9815fe60f2fc8b3bdba86cec996cba30ae26d /src/wallet/test/wallet_test_fixture.cpp | |
| parent | Merge #7827: Speed up getchaintips. (diff) | |
| parent | test: Rename wallet.dat to wallet_test.dat (diff) | |
| download | discoin-187186b0fe039010ea4b81edb671b9bdfc63d29a.tar.xz discoin-187186b0fe039010ea4b81edb671b9bdfc63d29a.zip | |
Merge #7905: test: move accounting_tests and rpc_wallet_tests to wallet/test
b30fb42 test: Rename wallet.dat to wallet_test.dat (Wladimir J. van der Laan)
a25a4f5 wallet_ismine.h → script/ismine.h (Wladimir J. van der Laan)
f4eae2d test: Create test fixture for wallet (Wladimir J. van der Laan)
de39c95 test: move accounting_tests and rpc_wallet_tests to wallet/test (Wladimir J. van der Laan)
Diffstat (limited to 'src/wallet/test/wallet_test_fixture.cpp')
| -rw-r--r-- | src/wallet/test/wallet_test_fixture.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/wallet/test/wallet_test_fixture.cpp b/src/wallet/test/wallet_test_fixture.cpp new file mode 100644 index 000000000..9036ee26d --- /dev/null +++ b/src/wallet/test/wallet_test_fixture.cpp @@ -0,0 +1,28 @@ +#include "wallet/test/wallet_test_fixture.h" + +#include "rpc/server.h" +#include "wallet/db.h" +#include "wallet/wallet.h" + +WalletTestingSetup::WalletTestingSetup(const std::string& chainName): + TestingSetup(chainName) +{ + bitdb.MakeMock(); + + bool fFirstRun; + pwalletMain = new CWallet("wallet_test.dat"); + pwalletMain->LoadWallet(fFirstRun); + RegisterValidationInterface(pwalletMain); + + RegisterWalletRPCCommands(tableRPC); +} + +WalletTestingSetup::~WalletTestingSetup() +{ + UnregisterValidationInterface(pwalletMain); + delete pwalletMain; + pwalletMain = NULL; + + bitdb.Flush(true); + bitdb.Reset(); +} |