Changeset View
Changeset View
Standalone View
Standalone View
src/test/coins_tests.cpp
Show First 20 Lines • Show All 271 Lines • ▼ Show 20 Lines | UtxoData::iterator FindRandomFrom(const std::set<COutPoint> &utxoSet) { | ||||
assert(utxoDataIt != utxoData.end()); | assert(utxoDataIt != utxoData.end()); | ||||
return utxoDataIt; | return utxoDataIt; | ||||
} | } | ||||
// This test is similar to the previous test except the emphasis is on testing | // This test is similar to the previous test except the emphasis is on testing | ||||
// the functionality of UpdateCoins random txs are created and UpdateCoins is | // the functionality of UpdateCoins random txs are created and UpdateCoins is | ||||
// used to update the cache stack. In particular it is tested that spending a | // used to update the cache stack. In particular it is tested that spending a | ||||
// duplicate coinbase tx has the expected effect (the other duplicate is | // duplicate coinbase tx has the expected effect (the other duplicate is | ||||
// overwitten at all cache levels) | // overwritten at all cache levels) | ||||
BOOST_AUTO_TEST_CASE(updatecoins_simulation_test) { | BOOST_AUTO_TEST_CASE(updatecoins_simulation_test) { | ||||
bool spent_a_duplicate_coinbase = false; | bool spent_a_duplicate_coinbase = false; | ||||
// A simple map to track what we expect the cache stack to represent. | // A simple map to track what we expect the cache stack to represent. | ||||
std::map<COutPoint, Coin> result; | std::map<COutPoint, Coin> result; | ||||
// The cache stack. | // The cache stack. | ||||
// A CCoinsViewTest at the bottom. | // A CCoinsViewTest at the bottom. | ||||
CCoinsViewTest base; | CCoinsViewTest base; | ||||
▲ Show 20 Lines • Show All 612 Lines • Show Last 20 Lines |