aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_bitcoin.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2013-12-08 13:51:53 +0100
committerWladimir J. van der Laan <[email protected]>2013-12-08 13:52:48 +0100
commit05e27c66411caa622815cc7cc7136dfd85370ab4 (patch)
tree983fe8073153218c28d756873daeaf4ec2293b16 /src/test/test_bitcoin.cpp
parentMerge pull request #3365 from gmaxwell/hexify (diff)
parentSplit off rpc_wallet_tests (diff)
downloaddiscoin-05e27c66411caa622815cc7cc7136dfd85370ab4.tar.xz
discoin-05e27c66411caa622815cc7cc7136dfd85370ab4.zip
Merge pull request #3332
5094f8d Split off rpc_wallet_tests (Wladimir J. van der Laan) 829c920 Move CCryptoKeyStore to crypter.cpp (Wladimir J. van der Laan) ae6ea5a Update build-unix.md to mention --disable-wallet (Wladimir J. van der Laan) 4f9e993 Add --disable-wallet option to build system (Wladimir J. van der Laan) d004d72 Move CAddrDB frrom db to net (Wladimir J. van der Laan) 48ba56c Delimit code with #ifdef ENABLE_WALLET (Wladimir J. van der Laan) 991685d Move getinfo to rpcnet.cpp (Wladimir J. van der Laan) bbb0936 Move HelpExample* from rpcwallet to rpcserver (Wladimir J. van der Laan)
Diffstat (limited to 'src/test/test_bitcoin.cpp')
-rw-r--r--src/test/test_bitcoin.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp
index 443e7735d..a804ff380 100644
--- a/src/test/test_bitcoin.cpp
+++ b/src/test/test_bitcoin.cpp
@@ -7,7 +7,9 @@
#include "txdb.h"
#include "ui_interface.h"
#include "util.h"
+#ifdef ENABLE_WALLET
#include "wallet.h"
+#endif
#include <boost/filesystem.hpp>
#include <boost/test/unit_test.hpp>
@@ -26,7 +28,9 @@ struct TestingSetup {
TestingSetup() {
fPrintToDebugger = true; // don't want to write to debug.log file
noui_connect();
+#ifdef ENABLE_WALLET
bitdb.MakeMock();
+#endif
pathTemp = GetTempPath() / strprintf("test_bitcoin_%lu_%i", (unsigned long)GetTime(), (int)(GetRand(100000)));
boost::filesystem::create_directories(pathTemp);
mapArgs["-datadir"] = pathTemp.string();
@@ -34,10 +38,12 @@ struct TestingSetup {
pcoinsdbview = new CCoinsViewDB(1 << 23, true);
pcoinsTip = new CCoinsViewCache(*pcoinsdbview);
InitBlockIndex();
+#ifdef ENABLE_WALLET
bool fFirstRun;
pwalletMain = new CWallet("wallet.dat");
pwalletMain->LoadWallet(fFirstRun);
RegisterWallet(pwalletMain);
+#endif
nScriptCheckThreads = 3;
for (int i=0; i < nScriptCheckThreads-1; i++)
threadGroup.create_thread(&ThreadScriptCheck);
@@ -46,12 +52,16 @@ struct TestingSetup {
{
threadGroup.interrupt_all();
threadGroup.join_all();
+#ifdef ENABLE_WALLET
delete pwalletMain;
pwalletMain = NULL;
+#endif
delete pcoinsTip;
delete pcoinsdbview;
delete pblocktree;
+#ifdef ENABLE_WALLET
bitdb.Flush(true);
+#endif
boost::filesystem::remove_all(pathTemp);
}
};