Test that no values not inserted into the cache are read out of it. * * There are no repeats in the first 200000 insecure_GetRandHash calls */
| 34 | * There are no repeats in the first 200000 insecure_GetRandHash calls |
| 35 | */ |
| 36 | BOOST_AUTO_TEST_CASE(test_cuckoocache_no_fakes) |
| 37 | { |
| 38 | SeedInsecureRand(SeedRand::ZEROS); |
| 39 | CuckooCache::cache<uint256, SignatureCacheHasher> cc{}; |
| 40 | size_t megabytes = 4; |
| 41 | cc.setup_bytes(megabytes << 20); |
| 42 | for (int x = 0; x < 100000; ++x) { |
| 43 | cc.insert(InsecureRand256()); |
| 44 | } |
| 45 | for (int x = 0; x < 100000; ++x) { |
| 46 | BOOST_CHECK(!cc.contains(InsecureRand256(), false)); |
| 47 | } |
| 48 | }; |
| 49 | |
| 50 | /** This helper returns the hit rate when megabytes*load worth of entries are |
| 51 | * inserted into a megabytes sized cache |
nothing calls this directly
no test coverage detected