mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-02-08 05:04:24 +00:00
![Gavin Andresen](/assets/img/avatar_default.png)
This does two things: 1) Now does not output to debug.log if -printtodebugger flag is passed 2) Unit tests set -printtodebugger so only test results are output to stdout Note that -printtodebugger only actually prints to the debugger on Windows.
45 lines
842 B
C++
45 lines
842 B
C++
#define BOOST_TEST_MODULE Bitcoin Test Suite
|
|
#include <boost/test/unit_test.hpp>
|
|
|
|
#include "db.h"
|
|
#include "main.h"
|
|
#include "wallet.h"
|
|
|
|
CWallet* pwalletMain;
|
|
CClientUIInterface uiInterface;
|
|
|
|
extern bool fPrintToConsole;
|
|
extern void noui_connect();
|
|
|
|
struct TestingSetup {
|
|
TestingSetup() {
|
|
fPrintToDebugger = true; // don't want to write to debug.log file
|
|
noui_connect();
|
|
bitdb.MakeMock();
|
|
LoadBlockIndex(true);
|
|
bool fFirstRun;
|
|
pwalletMain = new CWallet("wallet.dat");
|
|
pwalletMain->LoadWallet(fFirstRun);
|
|
RegisterWallet(pwalletMain);
|
|
}
|
|
~TestingSetup()
|
|
{
|
|
delete pwalletMain;
|
|
pwalletMain = NULL;
|
|
bitdb.Flush(true);
|
|
}
|
|
};
|
|
|
|
BOOST_GLOBAL_FIXTURE(TestingSetup);
|
|
|
|
void Shutdown(void* parg)
|
|
{
|
|
exit(0);
|
|
}
|
|
|
|
void StartShutdown()
|
|
{
|
|
exit(0);
|
|
}
|
|
|