diff options
author | Riccardo Spagni <ric@spagni.net> | 2015-07-27 10:43:49 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2015-07-27 10:44:36 +0200 |
commit | 0c85f3fa19d520473547edd92e46de59b8fc97fa (patch) | |
tree | 2622019477c1bedd6b7f0b3a375c25fdf7787c65 | |
parent | Merge pull request #352 (diff) | |
parent | Fix block_reward unit tests (diff) | |
download | monero-0c85f3fa19d520473547edd92e46de59b8fc97fa.tar.xz |
Merge pull request #353
16d71a3 Fix block_reward unit tests (Rostislav)
-rw-r--r-- | tests/unit_tests/block_reward.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/unit_tests/block_reward.cpp b/tests/unit_tests/block_reward.cpp index a572d2b75..7eed3a778 100644 --- a/tests/unit_tests/block_reward.cpp +++ b/tests/unit_tests/block_reward.cpp @@ -49,28 +49,28 @@ namespace #define TEST_ALREADY_GENERATED_COINS(already_generated_coins, expected_reward) \ m_block_not_too_big = get_block_reward(0, current_block_size, already_generated_coins, m_block_reward); \ ASSERT_TRUE(m_block_not_too_big); \ - ASSERT_EQ(m_block_reward, UINT64_C(expected_reward)); + ASSERT_EQ(m_block_reward, expected_reward); TEST_F(block_reward_and_already_generated_coins, handles_first_values) { // 17592186044415 from neozaru, confirmed by fluffypony - TEST_ALREADY_GENERATED_COINS(0, 17592186044415); - TEST_ALREADY_GENERATED_COINS(m_block_reward, 17592169267200); - TEST_ALREADY_GENERATED_COINS(UINT64_C(2756434948434199641), 14963444829249); + TEST_ALREADY_GENERATED_COINS(0, UINT64_C(17592186044415)); + TEST_ALREADY_GENERATED_COINS(m_block_reward, UINT64_C(17592169267200)); + TEST_ALREADY_GENERATED_COINS(UINT64_C(2756434948434199641), UINT64_C(14963444829249)); } TEST_F(block_reward_and_already_generated_coins, correctly_steps_from_2_to_1) { - TEST_ALREADY_GENERATED_COINS(MONEY_SUPPLY - ((2 << 20) + 1), 2); - TEST_ALREADY_GENERATED_COINS(MONEY_SUPPLY - (2 << 20) , 2); - TEST_ALREADY_GENERATED_COINS(MONEY_SUPPLY - ((2 << 20) - 1), 1); + TEST_ALREADY_GENERATED_COINS(MONEY_SUPPLY - ((2 << 20) + 1), FINAL_SUBSIDY_PER_MINUTE); + TEST_ALREADY_GENERATED_COINS(MONEY_SUPPLY - (2 << 20) , FINAL_SUBSIDY_PER_MINUTE); + TEST_ALREADY_GENERATED_COINS(MONEY_SUPPLY - ((2 << 20) - 1), FINAL_SUBSIDY_PER_MINUTE); } TEST_F(block_reward_and_already_generated_coins, handles_max) { - TEST_ALREADY_GENERATED_COINS(MONEY_SUPPLY - ((1 << 20) + 1), 1); - TEST_ALREADY_GENERATED_COINS(MONEY_SUPPLY - (1 << 20) , 1); - TEST_ALREADY_GENERATED_COINS(MONEY_SUPPLY - ((1 << 20) - 1), 0); + TEST_ALREADY_GENERATED_COINS(MONEY_SUPPLY - ((1 << 20) + 1), FINAL_SUBSIDY_PER_MINUTE); + TEST_ALREADY_GENERATED_COINS(MONEY_SUPPLY - (1 << 20) , FINAL_SUBSIDY_PER_MINUTE); + TEST_ALREADY_GENERATED_COINS(MONEY_SUPPLY - ((1 << 20) - 1), FINAL_SUBSIDY_PER_MINUTE); } //-------------------------------------------------------------------------------------------------------------------- |