2011-08-02 17:34:23 +02:00
|
|
|
#define BOOST_TEST_MODULE Bitcoin Test Suite
|
2011-06-27 20:05:02 +02:00
|
|
|
#include <boost/test/unit_test.hpp>
|
|
|
|
|
2012-05-22 21:51:13 +02:00
|
|
|
#include "db.h"
|
2011-10-12 01:50:06 +02:00
|
|
|
#include "main.h"
|
|
|
|
#include "wallet.h"
|
2011-07-31 20:00:38 +02:00
|
|
|
|
2012-01-05 03:40:52 +01:00
|
|
|
CWallet* pwalletMain;
|
2012-05-19 09:35:26 +02:00
|
|
|
CClientUIInterface uiInterface;
|
2012-01-05 03:40:52 +01:00
|
|
|
|
2011-10-03 22:14:13 +02:00
|
|
|
extern bool fPrintToConsole;
|
2012-05-19 09:35:26 +02:00
|
|
|
extern void noui_connect();
|
|
|
|
|
2011-10-03 22:14:13 +02:00
|
|
|
struct TestingSetup {
|
|
|
|
TestingSetup() {
|
2012-08-20 17:33:20 +02:00
|
|
|
fPrintToDebugger = true; // don't want to write to debug.log file
|
2012-05-19 09:35:26 +02:00
|
|
|
noui_connect();
|
2012-05-22 21:51:13 +02:00
|
|
|
bitdb.MakeMock();
|
|
|
|
LoadBlockIndex(true);
|
|
|
|
bool fFirstRun;
|
|
|
|
pwalletMain = new CWallet("wallet.dat");
|
|
|
|
pwalletMain->LoadWallet(fFirstRun);
|
2012-01-05 03:40:52 +01:00
|
|
|
RegisterWallet(pwalletMain);
|
|
|
|
}
|
|
|
|
~TestingSetup()
|
|
|
|
{
|
|
|
|
delete pwalletMain;
|
|
|
|
pwalletMain = NULL;
|
2012-05-22 21:51:13 +02:00
|
|
|
bitdb.Flush(true);
|
2011-10-03 22:14:13 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
BOOST_GLOBAL_FIXTURE(TestingSetup);
|
|
|
|
|
2011-07-31 20:00:38 +02:00
|
|
|
void Shutdown(void* parg)
|
|
|
|
{
|
2011-09-27 20:16:07 +02:00
|
|
|
exit(0);
|
2011-07-31 20:00:38 +02:00
|
|
|
}
|
2012-06-14 09:41:11 +02:00
|
|
|
|
|
|
|
void StartShutdown()
|
|
|
|
{
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
|