Run BDB disk-less for test_bitcoin

This commit is contained in:
Luke Dashjr
2012-05-22 19:51:13 +00:00
parent fbf99a9cdc
commit 148e107da6
3 changed files with 60 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
#define BOOST_TEST_MODULE Bitcoin Test Suite
#include <boost/test/unit_test.hpp>
#include "db.h"
#include "main.h"
#include "wallet.h"
@@ -14,13 +15,18 @@ struct TestingSetup {
TestingSetup() {
fPrintToConsole = true; // don't want to write to debug.log file
noui_connect();
pwalletMain = new CWallet();
bitdb.MakeMock();
LoadBlockIndex(true);
bool fFirstRun;
pwalletMain = new CWallet("wallet.dat");
pwalletMain->LoadWallet(fFirstRun);
RegisterWallet(pwalletMain);
}
~TestingSetup()
{
delete pwalletMain;
pwalletMain = NULL;
bitdb.Flush(true);
}
};