From df596d799df3ffa05107078bdcdc1d046e5b3514 Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Wed, 12 Oct 2022 12:19:51 +0200 Subject: [PATCH] fixed warnings in core tests --- tests/core_tests/chaingen.cpp | 1 - tests/core_tests/checkpoints_tests.cpp | 2 +- tests/core_tests/escrow_wallet_tests.cpp | 4 ++-- tests/core_tests/hard_fork_1.cpp | 4 ++-- tests/core_tests/hard_fork_2.cpp | 8 ++++---- tests/core_tests/wallet_tests.cpp | 3 --- tests/core_tests/zarcanum_test.cpp | 2 +- 7 files changed, 10 insertions(+), 14 deletions(-) diff --git a/tests/core_tests/chaingen.cpp b/tests/core_tests/chaingen.cpp index 94ce0211..1ad68d41 100644 --- a/tests/core_tests/chaingen.cpp +++ b/tests/core_tests/chaingen.cpp @@ -1003,7 +1003,6 @@ bool init_output_indices(map_output_idx_t& outs, map_output_t& outs_mine, const { for (const block& blk : blockchain) { - volatile uint64_t height = get_block_height(blk); std::vector vtx; vtx.push_back(&blk.miner_tx); diff --git a/tests/core_tests/checkpoints_tests.cpp b/tests/core_tests/checkpoints_tests.cpp index 918615c9..3e7b0b76 100644 --- a/tests/core_tests/checkpoints_tests.cpp +++ b/tests/core_tests/checkpoints_tests.cpp @@ -927,7 +927,7 @@ bool gen_checkpoints_set_after_switching_to_altchain::generate(std::vector& events) const REWIND_BLOCKS_N_WITH_TIME(events, blk_0r, blk_0, miner_acc, CURRENCY_MINED_MONEY_UNLOCK_WINDOW); m_alice_bob_start_amount = MK_TEST_COINS(200); - uint64_t amount_chunks = 10; + //uint64_t amount_chunks = 10; m_alice_bob_start_chunk_amount = m_alice_bob_start_amount / 10; transaction tx_0 = AUTO_VAL_INIT(tx_0); @@ -3159,7 +3159,7 @@ bool escrow_balance::generate(std::vector& events) const bool escrow_balance::c1(currency::core& c, size_t ev_index, const std::vector& events) { - bool r = false, stub_bool = false; + bool r = false; CHECK_AND_ASSERT_MES(c.get_pool_transactions_count() == 0, false, "Incorrect txs count in the pool: " << c.get_pool_transactions_count()); std::shared_ptr alice_wlt = init_playtime_test_wallet(events, c, m_accounts[ALICE_ACC_IDX]); diff --git a/tests/core_tests/hard_fork_1.cpp b/tests/core_tests/hard_fork_1.cpp index ab49fb94..9134c831 100644 --- a/tests/core_tests/hard_fork_1.cpp +++ b/tests/core_tests/hard_fork_1.cpp @@ -186,7 +186,7 @@ bool hard_fork_1_unlock_time_2_in_coinbase::generate(std::vector& { // Test idea: make sure chain switches without PoS before and after hardfork - bool r = false; + //bool r = false; GENERATE_ACCOUNT(miner_acc); GENERATE_ACCOUNT(alice_acc); MAKE_GENESIS_BLOCK(events, blk_0, miner_acc, test_core_time::get_time()); diff --git a/tests/core_tests/hard_fork_2.cpp b/tests/core_tests/hard_fork_2.cpp index fbe68459..f61ff753 100644 --- a/tests/core_tests/hard_fork_2.cpp +++ b/tests/core_tests/hard_fork_2.cpp @@ -76,7 +76,7 @@ bool hard_fork_2_tx_payer_in_wallet::generate(std::vector& eve bool hard_fork_2_tx_payer_in_wallet::c1(currency::core& c, size_t ev_index, const std::vector& events) { - bool r = false, stub_bool = false; + bool r = false; CHECK_AND_ASSERT_MES(c.get_pool_transactions_count() == 0, false, "Incorrect txs count in the pool: " << c.get_pool_transactions_count()); std::shared_ptr miner_wlt = init_playtime_test_wallet(events, c, m_accounts[MINER_ACC_IDX]); std::shared_ptr alice_wlt = init_playtime_test_wallet(events, c, m_accounts[ALICE_ACC_IDX]); @@ -324,7 +324,7 @@ bool hard_fork_2_tx_receiver_in_wallet::generate(std::vector& bool hard_fork_2_tx_receiver_in_wallet::c1(currency::core& c, size_t ev_index, const std::vector& events) { - bool r = false, stub_bool = false; + bool r = false; CHECK_AND_ASSERT_MES(c.get_pool_transactions_count() == 0, false, "Incorrect txs count in the pool: " << c.get_pool_transactions_count()); std::shared_ptr miner_wlt = init_playtime_test_wallet(events, c, m_accounts[MINER_ACC_IDX]); std::shared_ptr alice_wlt = init_playtime_test_wallet(events, c, m_accounts[ALICE_ACC_IDX]); @@ -468,7 +468,7 @@ bool hard_fork_2_tx_extra_alias_entry_in_wallet::generate(std::vector& events) { - bool r = false, stub_bool = false; + bool r = false; CHECK_AND_ASSERT_MES(c.get_pool_transactions_count() == 0, false, "Incorrect txs count in the pool: " << c.get_pool_transactions_count()); std::shared_ptr alice_wlt = init_playtime_test_wallet(events, c, m_accounts[ALICE_ACC_IDX]); std::shared_ptr miner_wlt = init_playtime_test_wallet(events, c, m_accounts[MINER_ACC_IDX]); @@ -670,7 +670,7 @@ bool hard_fork_2_auditable_addresses_basics::generate(std::vector& events) { - bool r = false, stub_bool = false; + bool r = false; CHECK_AND_ASSERT_MES(c.get_pool_transactions_count() == 0, false, "Incorrect txs count in the pool: " << c.get_pool_transactions_count()); std::shared_ptr alice_wlt = init_playtime_test_wallet(events, c, m_accounts[ALICE_ACC_IDX]); std::shared_ptr bob_wlt = init_playtime_test_wallet(events, c, m_accounts[BOB_ACC_IDX]); diff --git a/tests/core_tests/wallet_tests.cpp b/tests/core_tests/wallet_tests.cpp index ae2620bc..3d891568 100644 --- a/tests/core_tests/wallet_tests.cpp +++ b/tests/core_tests/wallet_tests.cpp @@ -3290,7 +3290,6 @@ bool wallet_unconfimed_tx_balance::generate(std::vector& event bool wallet_unconfimed_tx_balance::c1(currency::core& c, size_t ev_index, const std::vector& events) { - bool r = false; std::shared_ptr alice_wlt = init_playtime_test_wallet(events, c, ALICE_ACC_IDX); CHECK_AND_ASSERT_MES(refresh_wallet_and_check_balance("", "Alice", alice_wlt, MK_TEST_COINS(100), false, UINT64_MAX, MK_TEST_COINS(100)), false, ""); @@ -3505,7 +3504,6 @@ wallet_watch_only_and_chain_switch::wallet_watch_only_and_chain_switch() bool wallet_watch_only_and_chain_switch::generate(std::vector& events) const { - bool r = false; m_accounts.resize(TOTAL_ACCS_COUNT); account_base& miner_acc = m_accounts[MINER_ACC_IDX]; miner_acc.generate(); @@ -3602,7 +3600,6 @@ wallet_spend_form_auditable_and_track::wallet_spend_form_auditable_and_track() bool wallet_spend_form_auditable_and_track::generate(std::vector& events) const { - bool r = false; m_accounts.resize(TOTAL_ACCS_COUNT); account_base& miner_acc = m_accounts[MINER_ACC_IDX]; miner_acc.generate(); diff --git a/tests/core_tests/zarcanum_test.cpp b/tests/core_tests/zarcanum_test.cpp index 73760667..a6b74490 100644 --- a/tests/core_tests/zarcanum_test.cpp +++ b/tests/core_tests/zarcanum_test.cpp @@ -86,7 +86,7 @@ bool zarcanum_basic_test::c1(currency::core& c, size_t ev_index, const std::vect //miner_wlt->refresh(); alice_wlt->refresh(); - uint64_t unlocked = 0; + //uint64_t unlocked = 0; //uint64_t balance = alice_wlt->balance(unlocked); CHECK_AND_ASSERT_MES(check_balance_via_wallet(*alice_wlt, "Alice", transfer_amount * 4, UINT64_MAX, transfer_amount * 4), false, "");