Bitcoin Core 28.99.0
P2P Digital Currency
|
Public Member Functions | |
template<typename Cache > | |
void | test_cache_erase (size_t megabytes) |
This helper checks that erased elements are preferentially inserted onto and that the hit rate of "fresher" keys is reasonable. More... | |
Public Member Functions inherited from BasicTestingSetup | |
void | SeedRandomForTest (SeedRand seed) |
Seed the global RNG state and m_rng for testing and log the seed value. More... | |
BasicTestingSetup (const ChainType chainType=ChainType::MAIN, TestOpts={}) | |
~BasicTestingSetup () | |
Additional Inherited Members | |
Public Attributes inherited from BasicTestingSetup | |
util::SignalInterrupt | m_interrupt |
node::NodeContext | m_node |
FastRandomContext | m_rng |
fs::path | m_path_root |
fs::path | m_path_lock |
bool | m_has_custom_datadir {false} |
ArgsManager | m_args |
Test-specific arguments and settings. More... | |
Definition at line 125 of file cuckoocache_tests.cpp.
|
inline |
This helper checks that erased elements are preferentially inserted onto and that the hit rate of "fresher" keys is reasonable.
We make a copy of the hashes because future optimizations of the cuckoocache may overwrite the inserted element, so the test is "future proofed".
Insert the first half
Erase the first quarter
Insert the second half
elements that we marked as erased but are still there
elements that we did not erase but are older
elements that were most recently inserted
Definition at line 129 of file cuckoocache_tests.cpp.