Replace INT_MAX with INT32_MAX to avoid compile err
[novacoin.git] / src / test / test_bitcoin.cpp
index a21801b..bcf0907 100644 (file)
@@ -1,21 +1,36 @@
 #define BOOST_TEST_MODULE Bitcoin Test Suite
 #include <boost/test/unit_test.hpp>
 
-#include "../main.h"
-#include "../wallet.h"
-
-#include "uint160_tests.cpp"
-#include "uint256_tests.cpp"
-#include "script_tests.cpp"
-#include "transaction_tests.cpp"
-#include "DoS_tests.cpp"
-#include "base64_tests.cpp"
-#include "util_tests.cpp"
-#include "base58_tests.cpp"
-#include "miner_tests.cpp"
-#include "Checkpoints_tests.cpp"
+#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)
 {