Changeset View
Changeset View
Standalone View
Standalone View
src/test/coins_tests.cpp
Show First 20 Lines • Show All 807 Lines • ▼ Show 20 Lines | for (const Amount &base_value : {ABSENT, SPENT, VALUE1}) { | ||||
CheckAddCoinBase(base_value, std::forward<Args>(args)...); | CheckAddCoinBase(base_value, std::forward<Args>(args)...); | ||||
} | } | ||||
} | } | ||||
BOOST_AUTO_TEST_CASE(coin_add) { | BOOST_AUTO_TEST_CASE(coin_add) { | ||||
/** | /** | ||||
* Check AddCoin behavior, requesting a new coin from a cache view, writing | * Check AddCoin behavior, requesting a new coin from a cache view, writing | ||||
* a modification to the coin, and then checking the resulting entry in the | * a modification to the coin, and then checking the resulting entry in the | ||||
* cache after the modification. Verify behavior with the with the AddCoin | * cache after the modification. Verify behavior with the AddCoin | ||||
* potential_overwrite argument set to false, and to true. | * possible_overwrite argument set to false, and to true. | ||||
* | * | ||||
* Cache Write Result Cache Result potential_overwrite | * Cache Write Result Cache Result possible_overwrite | ||||
* Value Value Value Flags Flags | * Value Value Value Flags Flags | ||||
*/ | */ | ||||
CheckAddCoin(ABSENT, VALUE3, VALUE3, NO_ENTRY, DIRTY | FRESH, false); | CheckAddCoin(ABSENT, VALUE3, VALUE3, NO_ENTRY, DIRTY | FRESH, false); | ||||
CheckAddCoin(ABSENT, VALUE3, VALUE3, NO_ENTRY, DIRTY, true); | CheckAddCoin(ABSENT, VALUE3, VALUE3, NO_ENTRY, DIRTY, true); | ||||
CheckAddCoin(SPENT, VALUE3, VALUE3, 0, DIRTY | FRESH, false); | CheckAddCoin(SPENT, VALUE3, VALUE3, 0, DIRTY | FRESH, false); | ||||
CheckAddCoin(SPENT, VALUE3, VALUE3, 0, DIRTY, true); | CheckAddCoin(SPENT, VALUE3, VALUE3, 0, DIRTY, true); | ||||
CheckAddCoin(SPENT, VALUE3, VALUE3, FRESH, DIRTY | FRESH, false); | CheckAddCoin(SPENT, VALUE3, VALUE3, FRESH, DIRTY | FRESH, false); | ||||
CheckAddCoin(SPENT, VALUE3, VALUE3, FRESH, DIRTY | FRESH, true); | CheckAddCoin(SPENT, VALUE3, VALUE3, FRESH, DIRTY | FRESH, true); | ||||
▲ Show 20 Lines • Show All 113 Lines • Show Last 20 Lines |