test: Avoid BOOST_ASSERT macro

The `BOOST_ASSERT` macro is defined in the `boost/assert.hpp` header.
This change allows to skip `#include <boost/assert.hpp>`.
This commit is contained in:
Hennadii Stepanov 2023-05-31 15:42:40 +01:00
parent f08bde7f71
commit fade2adb5b
No known key found for this signature in database
GPG Key ID: 410108112E7EA81F
4 changed files with 5 additions and 6 deletions

View File

@ -432,7 +432,7 @@ BOOST_AUTO_TEST_CASE(bnb_search_test)
CAmount selection_target = 16 * CENT; CAmount selection_target = 16 * CENT;
const auto& no_res = SelectCoinsBnB(GroupCoins(available_coins.All(), /*subtract_fee_outputs*/true), const auto& no_res = SelectCoinsBnB(GroupCoins(available_coins.All(), /*subtract_fee_outputs*/true),
selection_target, /*cost_of_change=*/0, MAX_STANDARD_TX_WEIGHT); selection_target, /*cost_of_change=*/0, MAX_STANDARD_TX_WEIGHT);
BOOST_ASSERT(!no_res); BOOST_REQUIRE(!no_res);
BOOST_CHECK(util::ErrorString(no_res).original.find("The inputs size exceeds the maximum weight") != std::string::npos); BOOST_CHECK(util::ErrorString(no_res).original.find("The inputs size exceeds the maximum weight") != std::string::npos);
// Now add same coin value with a good size and check that it gets selected // Now add same coin value with a good size and check that it gets selected

View File

@ -938,11 +938,10 @@ BOOST_FIXTURE_TEST_CASE(wallet_sync_tx_invalid_state_test, TestingSetup)
} }
// Add tx to wallet // Add tx to wallet
const auto& op_dest = wallet.GetNewDestination(OutputType::BECH32M, ""); const auto op_dest{*Assert(wallet.GetNewDestination(OutputType::BECH32M, ""))};
BOOST_ASSERT(op_dest);
CMutableTransaction mtx; CMutableTransaction mtx;
mtx.vout.push_back({COIN, GetScriptForDestination(*op_dest)}); mtx.vout.push_back({COIN, GetScriptForDestination(op_dest)});
mtx.vin.push_back(CTxIn(g_insecure_rand_ctx.rand256(), 0)); mtx.vin.push_back(CTxIn(g_insecure_rand_ctx.rand256(), 0));
const auto& tx_id_to_spend = wallet.AddToWallet(MakeTransactionRef(mtx), TxStateInMempool{})->GetHash(); const auto& tx_id_to_spend = wallet.AddToWallet(MakeTransactionRef(mtx), TxStateInMempool{})->GetHash();

View File

@ -39,7 +39,7 @@ BOOST_AUTO_TEST_CASE(walletdb_read_write_deadlock)
DatabaseStatus status; DatabaseStatus status;
bilingual_str error_string; bilingual_str error_string;
std::unique_ptr<WalletDatabase> db = MakeDatabase(m_path_root / strprintf("wallet_%d_.dat", db_format).c_str(), options, status, error_string); std::unique_ptr<WalletDatabase> db = MakeDatabase(m_path_root / strprintf("wallet_%d_.dat", db_format).c_str(), options, status, error_string);
BOOST_ASSERT(status == DatabaseStatus::SUCCESS); BOOST_CHECK_EQUAL(status, DatabaseStatus::SUCCESS);
std::shared_ptr<CWallet> wallet(new CWallet(m_node.chain.get(), "", std::move(db))); std::shared_ptr<CWallet> wallet(new CWallet(m_node.chain.get(), "", std::move(db)));
wallet->m_keypool_size = 4; wallet->m_keypool_size = 4;

View File

@ -169,7 +169,7 @@ BOOST_FIXTURE_TEST_CASE(wallet_load_ckey, TestingSetup)
// Fourth test case: // Fourth test case:
// Verify that loading up a 'ckey' with an invalid pubkey throws an error // Verify that loading up a 'ckey' with an invalid pubkey throws an error
CPubKey invalid_key; CPubKey invalid_key;
BOOST_ASSERT(!invalid_key.IsValid()); BOOST_CHECK(!invalid_key.IsValid());
SerializeData key = MakeSerializeData(DBKeys::CRYPTED_KEY, invalid_key); SerializeData key = MakeSerializeData(DBKeys::CRYPTED_KEY, invalid_key);
records[key] = ckey_record_value; records[key] = ckey_record_value;