MCPcopy Create free account
hub / github.com/ElementsProject/elements / SelfTest

Method SelfTest

src/test/coins_tests.cpp:81–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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; }

Callers 5

SimulationTestFunction · 0.80
CheckAccessCoinFunction · 0.80
CheckSpendCoinsFunction · 0.80
CheckAddCoinBaseFunction · 0.80
CheckWriteCoinsFunction · 0.80

Calls 2

DynamicUsageFunction · 0.85
DynamicMemoryUsageMethod · 0.45

Tested by

no test coverage detected