| 791 | } |
| 792 | |
| 793 | static void CheckWriteCoins(const MaybeCoin& parent, const MaybeCoin& child, const CoinOrError& expected) |
| 794 | { |
| 795 | SingleEntryCacheTest test{ABSENT, parent}; |
| 796 | auto write_coins{[&] { WriteCoinsViewEntry(test.cache, child); }}; |
| 797 | if (auto* expected_coin{std::get_if<MaybeCoin>(&expected)}) { |
| 798 | write_coins(); |
| 799 | test.cache.SelfTest(/*sanity_check=*/false); |
| 800 | BOOST_CHECK_EQUAL(GetCoinsMapEntry(test.cache.map()), *expected_coin); |
| 801 | } else { |
| 802 | BOOST_CHECK_EXCEPTION(write_coins(), std::logic_error, HasReason(std::get<std::string>(expected))); |
| 803 | } |
| 804 | } |
| 805 | |
| 806 | BOOST_AUTO_TEST_CASE(ccoins_write) |
| 807 | { |
no test coverage detected