MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / TestingSetup

Method TestingSetup

src/test/test_bitcoin.cpp:46–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46TestingSetup::TestingSetup()
47{
48#ifdef ENABLE_WALLET
49 bitdb.MakeMock();
50#endif
51 ClearDatadirCache();
52 pathTemp = GetTempPath() / strprintf("test_bitcoin_%lu_%i", (unsigned long)GetTime(), (int)(GetRand(100000)));
53 boost::filesystem::create_directories(pathTemp);
54 mapArgs["-datadir"] = pathTemp.string();
55 mempool.setSanityCheck(1.0);
56 bool isObfuscated;
57 pblocktree = new CBlockTreeDB(1 << 20, isObfuscated, true);
58 pcoinsdbview = new CCoinsViewDB(1 << 23, isObfuscated, true);
59 pcoinsTip = new CCoinsViewCache(pcoinsdbview);
60 InitBlockIndex();
61#ifdef ENABLE_WALLET
62 bool fFirstRun;
63 pwalletMain = new CWallet("wallet.dat");
64 pwalletMain->LoadWallet(fFirstRun);
65 RegisterValidationInterface(pwalletMain);
66#endif
67 mapArgs["-par"] = "3";
68 for (int i=0; i < Opt().ScriptCheckThreads()-1; i++)
69 threadGroup.create_thread(&ThreadScriptCheck);
70 RegisterNodeSignals(GetNodeSignals());
71}
72
73TestingSetup::~TestingSetup()
74{

Callers

nothing calls this directly

Calls 12

ClearDatadirCacheFunction · 0.85
GetTempPathFunction · 0.85
GetTimeFunction · 0.85
GetRandFunction · 0.85
InitBlockIndexFunction · 0.85
OptClass · 0.85
RegisterNodeSignalsFunction · 0.85
MakeMockMethod · 0.80
setSanityCheckMethod · 0.80
ScriptCheckThreadsMethod · 0.80
LoadWalletMethod · 0.45

Tested by

no test coverage detected