MCPcopy Create free account
hub / github.com/LUX-Core/lux / TestingSetup

Method TestingSetup

src/test/test_lux.cpp:32–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30 boost::thread_group threadGroup;
31
32 TestingSetup() {
33 SetupEnvironment();
34 fPrintToDebugLog = false; // don't want to write to debug.log file
35 fCheckBlockIndex = true;
36 SelectParams(CBaseChainParams::UNITTEST);
37 noui_connect();
38#ifdef ENABLE_WALLET
39 bitdb.MakeMock();
40#endif
41 pathTemp = GetTempPath() / strprintf("test_lux_%lu_%i", (unsigned long)GetTime(), (int)(GetRand(100000)));
42 boost::filesystem::create_directories(pathTemp);
43 mapArgs["-datadir"] = pathTemp.string();
44 pblocktree = new CBlockTreeDB(1 << 20, true);
45 pcoinsdbview = new CCoinsViewDB(1 << 23, true);
46 pcoinsTip = new CCoinsViewCache(pcoinsdbview);
47 InitBlockIndex(Params());
48#ifdef ENABLE_WALLET
49 bool fFirstRun;
50 pwalletMain = new CWallet("wallet.dat");
51 pwalletMain->LoadWallet(fFirstRun);
52 RegisterValidationInterface(pwalletMain);
53#endif
54 nScriptCheckThreads = 3;
55 for (int i=0; i < nScriptCheckThreads-1; i++)
56 threadGroup.create_thread(&ThreadScriptCheck);
57 RegisterNodeSignals(GetNodeSignals());
58 }
59 ~TestingSetup()
60 {
61 threadGroup.interrupt_all();

Callers

nothing calls this directly

Calls 12

SetupEnvironmentFunction · 0.85
SelectParamsFunction · 0.85
noui_connectFunction · 0.85
GetTempPathFunction · 0.85
GetTimeFunction · 0.85
GetRandFunction · 0.85
InitBlockIndexFunction · 0.85
RegisterNodeSignalsFunction · 0.85
MakeMockMethod · 0.80
ParamsClass · 0.50
LoadWalletMethod · 0.45

Tested by

no test coverage detected