mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
test: refactor: Give unit test functions access to test state
Add unit test subclasses as needed so unit test functions that need to access members like m_rng can reference it directly.
This commit is contained in:
parent
fab023e177
commit
3dc527f460
16 changed files with 145 additions and 81 deletions
|
|
@ -256,8 +256,9 @@ BOOST_AUTO_TEST_CASE(versionbits_test)
|
|||
}
|
||||
}
|
||||
|
||||
struct BlockVersionTest : BasicTestingSetup {
|
||||
/** Check that ComputeBlockVersion will set the appropriate bit correctly */
|
||||
static void check_computeblockversion(VersionBitsCache& versionbitscache, const Consensus::Params& params, Consensus::DeploymentPos dep)
|
||||
void check_computeblockversion(VersionBitsCache& versionbitscache, const Consensus::Params& params, Consensus::DeploymentPos dep)
|
||||
{
|
||||
// Clear the cache every time
|
||||
versionbitscache.Clear();
|
||||
|
|
@ -412,8 +413,9 @@ static void check_computeblockversion(VersionBitsCache& versionbitscache, const
|
|||
// Check that we don't signal after activation
|
||||
BOOST_CHECK_EQUAL(versionbitscache.ComputeBlockVersion(lastBlock, params) & (1 << bit), 0);
|
||||
}
|
||||
}; // struct BlockVersionTest
|
||||
|
||||
BOOST_AUTO_TEST_CASE(versionbits_computeblockversion)
|
||||
BOOST_FIXTURE_TEST_CASE(versionbits_computeblockversion, BlockVersionTest)
|
||||
{
|
||||
VersionBitsCache vbcache;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue