Add CConnmanTest to mutate g_connman in tests

This commit is contained in:
João Barbosa
2017-10-24 09:26:05 +01:00
committed by Suhas Daftuar
parent ac7b37cd2b
commit 83df25736e
3 changed files with 20 additions and 0 deletions
+12
View File
@@ -25,6 +25,18 @@
#include <memory>
void CConnmanTest::AddNode(CNode& node)
{
LOCK(g_connman->cs_vNodes);
g_connman->vNodes.push_back(&node);
}
void CConnmanTest::ClearNodes()
{
LOCK(g_connman->cs_vNodes);
g_connman->vNodes.clear();
}
uint256 insecure_rand_seed = GetRandHash();
FastRandomContext insecure_rand_ctx(insecure_rand_seed);