5#include <boost/test/unit_test.hpp>
18 while (
a->nHeight > height) {
47 std::vector<std::unique_ptr<CBlockIndex>>
block_index;
49 for (
int i = 0; i < 10; ++i) {
52 auto genesis = std::make_unique<CBlockIndex>();
56 for (
int b = 0; b < 10000; ++b) {
57 auto new_index = std::make_unique<CBlockIndex>();
69 for (
int q = 0; q < 10000; ++q) {
76 for (
int q = 0; q < 10000; ++q) {
const CBlockIndex * LastCommonAncestor(const CBlockIndex *pa, const CBlockIndex *pb)
Find the last common ancestor two blocks have.
BOOST_AUTO_TEST_CASE(chain_test)
The block chain is a tree shaped structure starting with the genesis block at the root,...
CBlockIndex * pprev
pointer to the index of the predecessor of this block
CBlockIndex * GetAncestor(int height)
Efficiently find an ancestor of this block.
int nHeight
height of the entry in the chain. The genesis block has height 0
I randrange(I range) noexcept
Generate a random integer in the range [0..range), with range > 0.
BOOST_FIXTURE_TEST_SUITE(cuckoocache_tests, BasicTestingSetup)
Test Suite for CuckooCache.
BOOST_AUTO_TEST_SUITE_END()
#define BOOST_CHECK(expr)
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.