fees: refactor: rename policy_fee_tests.cpp to feerounder_tests.cpp
What changed, and why it matters
This commit simply renames a test file and its internal test suite name to better describe what they actually test. No code behavior changes, no security fix or vulnerability is present.
No security action needed; this is a harmless refactor. Reviewers may verify the file content is unchanged apart from the rename.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit renames src/test/policy_fee_tests.cpp to src/test/feerounder_tests.cpp, updates the CMakeLists.txt build file accordingly, and changes the Boost.Test suite name from policy_fee_tests to fee_rounder_tests. The test logic, includes, and assertions are identical to the deleted file.
Changed components
src/test/policy_fee_tests.cppsrc/test/feerounder_tests.cppsrc/test/CMakeLists.txtInspect captured patch +36 / −36
diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt
index 3b9dafc5..b3f1e3c2 100644
--- a/src/test/CMakeLists.txt
+++ b/src/test/CMakeLists.txt
@@ -43,6 +43,7 @@ add_executable(test_bitcoin
descriptor_tests.cpp
disconnected_transactions.cpp
feefrac_tests.cpp
+ feerounder_tests.cpp
flatfile_tests.cpp
fs_tests.cpp
getarg_tests.cpp
@@ -72,7 +73,6 @@ add_executable(test_bitcoin
pcp_tests.cpp
peerman_tests.cpp
pmt_tests.cpp
- policy_fee_tests.cpp
policyestimator_tests.cpp
pool_tests.cpp
pow_tests.cpp
diff --git a/src/test/feerounder_tests.cpp b/src/test/feerounder_tests.cpp
new file mode 100644
index 00000000..400437e6
--- /dev/null
+++ b/src/test/feerounder_tests.cpp
@@ -0,0 +1,35 @@
+// Copyright (c) 2020-2021 The Bitcoin Core developers
+// Distributed under the MIT software license, see the accompanying
+// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+
+#include <consensus/amount.h>
+#include <policy/fees.h>
+
+#include <boost/test/unit_test.hpp>
+
+#include <set>
+
+BOOST_AUTO_TEST_SUITE(fee_rounder_tests)
+
+BOOST_AUTO_TEST_CASE(FeeRounder)
+{
+ FastRandomContext rng{/*fDeterministic=*/true};
+ FeeFilterRounder fee_rounder{CFeeRate{1000}, rng};
+
+ // check that 1000 rounds to 974 or 1071
+ std::set<CAmount> results;
+ while (results.size() < 2) {
+ results.emplace(fee_rounder.round(1000));
+ }
+ BOOST_CHECK_EQUAL(*results.begin(), 974);
+ BOOST_CHECK_EQUAL(*++results.begin(), 1071);
+
+ // check that negative amounts rounds to 0
+ BOOST_CHECK_EQUAL(fee_rounder.round(-0), 0);
+ BOOST_CHECK_EQUAL(fee_rounder.round(-1), 0);
+
+ // check that MAX_MONEY rounds to 9170997
+ BOOST_CHECK_EQUAL(fee_rounder.round(MAX_MONEY), 9170997);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
diff --git a/src/test/policy_fee_tests.cpp b/src/test/policy_fee_tests.cpp
deleted file mode 100644
index 29d70cb5..00000000
--- a/src/test/policy_fee_tests.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright (c) 2020-2021 The Bitcoin Core developers
-// Distributed under the MIT software license, see the accompanying
-// file COPYING or http://www.opensource.org/licenses/mit-license.php.
-
-#include <consensus/amount.h>
-#include <policy/fees.h>
-
-#include <boost/test/unit_test.hpp>
-
-#include <set>
-
-BOOST_AUTO_TEST_SUITE(policy_fee_tests)
-
-BOOST_AUTO_TEST_CASE(FeeRounder)
-{
- FastRandomContext rng{/*fDeterministic=*/true};
- FeeFilterRounder fee_rounder{CFeeRate{1000}, rng};
-
- // check that 1000 rounds to 974 or 1071
- std::set<CAmount> results;
- while (results.size() < 2) {
- results.emplace(fee_rounder.round(1000));
- }
- BOOST_CHECK_EQUAL(*results.begin(), 974);
- BOOST_CHECK_EQUAL(*++results.begin(), 1071);
-
- // check that negative amounts rounds to 0
- BOOST_CHECK_EQUAL(fee_rounder.round(-0), 0);
- BOOST_CHECK_EQUAL(fee_rounder.round(-1), 0);
-
- // check that MAX_MONEY rounds to 9170997
- BOOST_CHECK_EQUAL(fee_rounder.round(MAX_MONEY), 9170997);
-}
-
-BOOST_AUTO_TEST_SUITE_END()
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.