MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / SelfTest

Method SelfTest

src/test/coins_tests.cpp:79–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 5

BOOST_AUTO_TEST_CASEFunction · 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