bcf09078712f638f11ca77a776ab65c007b2d477
[novacoin.git] / src / test / test_bitcoin.cpp
1 #define BOOST_TEST_MODULE Bitcoin Test Suite
2 #include <boost/test/unit_test.hpp>
3
4 #include "db.h"
5 #include "main.h"
6 #include "wallet.h"
7
8 CWallet* pwalletMain;
9 CClientUIInterface uiInterface;
10
11 extern bool fPrintToConsole;
12 extern void noui_connect();
13
14 struct TestingSetup {
15     TestingSetup() {
16         fPrintToDebugger = true; // don't want to write to debug.log file
17         noui_connect();
18         bitdb.MakeMock();
19         LoadBlockIndex(true);
20         bool fFirstRun;
21         pwalletMain = new CWallet("wallet.dat");
22         pwalletMain->LoadWallet(fFirstRun);
23         RegisterWallet(pwalletMain);
24     }
25     ~TestingSetup()
26     {
27         delete pwalletMain;
28         pwalletMain = NULL;
29         bitdb.Flush(true);
30     }
31 };
32
33 BOOST_GLOBAL_FIXTURE(TestingSetup);
34
35 void Shutdown(void* parg)
36 {
37   exit(0);
38 }
39
40 void StartShutdown()
41 {
42   exit(0);
43 }
44