lbrycrd/src/test/test_bitcoin.cpp

45 lines
841 B
C++
Raw Normal View History

#define BOOST_TEST_MODULE Bitcoin Test Suite
#include <boost/test/unit_test.hpp>
2012-05-22 21:51:13 +02:00
#include "db.h"
#include "main.h"
#include "wallet.h"
CWallet* pwalletMain;
CClientUIInterface uiInterface;
extern bool fPrintToConsole;
extern void noui_connect();
struct TestingSetup {
TestingSetup() {
fPrintToConsole = true; // don't want to write to debug.log file
noui_connect();
2012-05-22 21:51:13 +02:00
bitdb.MakeMock();
LoadBlockIndex(true);
bool fFirstRun;
pwalletMain = new CWallet("wallet.dat");
pwalletMain->LoadWallet(fFirstRun);
RegisterWallet(pwalletMain);
}
~TestingSetup()
{
delete pwalletMain;
pwalletMain = NULL;
2012-05-22 21:51:13 +02:00
bitdb.Flush(true);
}
};
BOOST_GLOBAL_FIXTURE(TestingSetup);
void Shutdown(void* parg)
{
exit(0);
}
void StartShutdown()
{
exit(0);
}