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

Function BOOST_AUTO_TEST_CASE

src/test/utilfork_tests.cpp:48–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46BOOST_FIXTURE_TEST_SUITE(utilfork_tests, Workaround);
47
48BOOST_AUTO_TEST_CASE(is_uahf_activating_block_at_genesis) {
49
50 auto cfgPtr = new DummyArgGetter;
51 DummyArgGetter& cfg = *cfgPtr;
52 auto argraii = SetDummyArgGetter(std::unique_ptr<ArgGetter>(cfgPtr));
53
54 CBlockIndex genesis;
55 genesis.pprev = nullptr;
56 genesis.nTime = 11;
57
58 // UAHF activates after genesis
59 cfg.uahf = genesis.GetMedianTimePast() + 1;
60 BOOST_CHECK(!isActivating(genesis));
61
62 // UAHF activates on genesis
63 cfg.uahf = genesis.GetMedianTimePast();
64 BOOST_CHECK(isActivating(genesis));
65
66 // UAHF is disabled.
67 cfg.uahf = 0;
68 BOOST_CHECK(!isActivating(genesis));
69}
70
71BOOST_AUTO_TEST_CASE(is_uahf_activating_block_normal) {
72 // normal case, activation is somewhere in the chain (not at genesis)

Callers

nothing calls this directly

Calls 3

SetDummyArgGetterFunction · 0.85
isActivatingFunction · 0.85
GetMedianTimePastMethod · 0.80

Tested by

no test coverage detected