Changeset View
Changeset View
Standalone View
Standalone View
src/test/coins_tests.cpp
Show First 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | void SelfTest() const { | ||||
it != cacheCoins.end(); it++) { | it != cacheCoins.end(); it++) { | ||||
ret += it->second.coin.DynamicMemoryUsage(); | ret += it->second.coin.DynamicMemoryUsage(); | ||||
count++; | count++; | ||||
} | } | ||||
BOOST_CHECK_EQUAL(GetCacheSize(), count); | BOOST_CHECK_EQUAL(GetCacheSize(), count); | ||||
BOOST_CHECK_EQUAL(DynamicMemoryUsage(), ret); | BOOST_CHECK_EQUAL(DynamicMemoryUsage(), ret); | ||||
} | } | ||||
CCoinsMap &map() { return cacheCoins; } | CCoinsMap &map() const { return cacheCoins; } | ||||
size_t &usage() { return cachedCoinsUsage; } | size_t &usage() const { return cachedCoinsUsage; } | ||||
}; | }; | ||||
} // namespace | } // namespace | ||||
BOOST_FIXTURE_TEST_SUITE(coins_tests, BasicTestingSetup) | BOOST_FIXTURE_TEST_SUITE(coins_tests, BasicTestingSetup) | ||||
static const unsigned int NUM_SIMULATION_ITERATIONS = 40000; | static const unsigned int NUM_SIMULATION_ITERATIONS = 40000; | ||||
// This is a large randomized insert/remove simulation test on a variable-size | // This is a large randomized insert/remove simulation test on a variable-size | ||||
▲ Show 20 Lines • Show All 793 Lines • Show Last 20 Lines |