15#include <boost/test/unit_test.hpp>
26 *(
vHash[n].begin() + (bit>>3)) ^= 1<<(bit&7);
36 static const unsigned int tx_counts[] = {1, 4, 7, 17, 56, 100, 127, 256, 312, 513, 1000, 4095};
38 for (
int i = 0; i < 12; i++) {
43 for (
unsigned int j=0;
j<nTx;
j++) {
51 std::vector<Txid>
vTxid(nTx);
52 for (
unsigned int j=0;
j<nTx;
j++)
63 std::vector<bool>
vMatch(nTx,
false);
65 for (
unsigned int j=0;
j<nTx;
j++) {
89 std::vector<unsigned int>
vIndex;
100 for (
int j=0;
j<4;
j++) {
113 std::vector<Txid>
vTxid{
121 std::vector<bool>
vMatch = {
false,
false,
false,
false,
false,
false,
false,
false,
false,
true,
true,
false};
124 std::vector<unsigned int>
vIndex;
std::vector< CTransactionRef > vtx
Data structure that represents a partial merkle tree.
std::vector< uint256 > vHash
txids and internal hashes
CPartialMerkleTreeTester(FastRandomContext &rng)
FastRandomContext & m_rng
Double ended buffer combining vector and stream-like interfaces.
I randrange(I range) noexcept
Generate a random integer in the range [0..range), with range > 0.
uint64_t randbits(int bits) noexcept
Generate a random (bits)-bit integer.
static transaction_identifier FromUint256(const uint256 &id)
uint256 BlockMerkleRoot(const CBlock &block, bool *mutated)
BOOST_FIXTURE_TEST_SUITE(cuckoocache_tests, BasicTestingSetup)
Test Suite for CuckooCache.
BOOST_AUTO_TEST_SUITE_END()
#define BOOST_CHECK(expr)
BOOST_AUTO_TEST_CASE(pmt_test1)
static CTransactionRef MakeTransactionRef(Tx &&txIn)
A mutable version of CTransaction.
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.