| 79 | explicit CCoinsViewCacheTest(CCoinsView* _base) : CCoinsViewCache(_base) {} |
| 80 | |
| 81 | void SelfTest() const |
| 82 | { |
| 83 | // Manually recompute the dynamic usage of the whole data, and compare it. |
| 84 | size_t ret = memusage::DynamicUsage(cacheCoins); |
| 85 | size_t count = 0; |
| 86 | for (const auto& entry : cacheCoins) { |
| 87 | ret += entry.second.coin.DynamicMemoryUsage(); |
| 88 | ++count; |
| 89 | } |
| 90 | BOOST_CHECK_EQUAL(GetCacheSize(), count); |
| 91 | BOOST_CHECK_EQUAL(DynamicMemoryUsage(), ret); |
| 92 | } |
| 93 | |
| 94 | CCoinsMap& map() const { return cacheCoins; } |
| 95 | size_t& usage() const { return cachedCoinsUsage; } |
no test coverage detected