7 #include <boost/test/unit_test.hpp> 17 std::list<CoinsCachePair> nodes;
21 auto node{std::prev(nodes.end())};
39 sentinel.second.SelfRef(sentinel);
43 auto node{sentinel.second.Next()};
44 for (
const auto& expected : nodes) {
52 node = sentinel.second.Next();
53 for (
const auto& expected : nodes) {
55 auto next =
node->second.Next();
56 node->second.ClearFlags();
65 for (
auto it{nodes.begin()}; it != nodes.end(); it = nodes.erase(it)) {
73 sentinel.second.SelfRef(sentinel);
79 auto node{sentinel.second.Next()};
80 for (
auto expected{nodes.begin()}; expected != nodes.end(); expected = nodes.erase(expected)) {
94 sentinel.second.SelfRef(sentinel);
98 auto n1{nodes.begin()};
99 auto n2{std::next(n1)};
100 auto n3{std::next(n2)};
101 auto n4{std::next(n3)};
145 sentinel.second.SelfRef(sentinel);
150 n1.second.AddFlags(0, n1, sentinel);
172 n1.second.AddFlags(0, n1, sentinel);
188 n1.second.ClearFlags();
196 n1.second.ClearFlags();
204 n1.second.AddFlags(0, n1, sentinel);
BOOST_AUTO_TEST_CASE(linked_list_iteration)
DIRTY means the CCoinsCacheEntry is potentially different from the version in the parent cache...
std::pair< const COutPoint, CCoinsCacheEntry > CoinsCachePair
BOOST_AUTO_TEST_SUITE_END()
static constexpr auto NUM_NODES
std::list< CoinsCachePair > CreatePairs(CoinsCachePair &sentinel)
FRESH means the parent cache does not have this coin or that it is a spent coin in the parent cache...
#define BOOST_CHECK_EQUAL(v1, v2)
BOOST_AUTO_TEST_SUITE(cuckoocache_tests)
Test Suite for CuckooCache.