test: Use clang-tidy named args for create_chainman
What changed, and why it matters
This commit only changes test code comments. It adds named labels (like /*reindex=*/true) to function arguments in Bitcoin Core's kernel tests so the code is easier to read and can be checked by a style tool called clang-tidy. It does not change any real Bitcoin node behavior or fix a security issue.
No security action needed. This is a routine test-code style cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies src/test/kernel/test_kernel.cpp to use clang-tidy-style named argument comments for all create_chainman() calls in the kernel test suite. The actual argument values and call order are unchanged. This is a pure readability/style change in test code with no functional or security impact.
Changed components
src/test/kernel/test_kernel.cppInspect captured patch +21 / −7
diff --git a/src/test/kernel/test_kernel.cpp b/src/test/kernel/test_kernel.cpp
index 0b86cf80..2afc588c 100644
--- a/src/test/kernel/test_kernel.cpp
+++ b/src/test/kernel/test_kernel.cpp
@@ -792,7 +792,9 @@ void chainman_reindex_test(TestDirectory& test_directory)
{
auto notifications{std::make_shared<TestKernelNotifications>()};
auto context{create_context(notifications, ChainType::MAINNET)};
- auto chainman{create_chainman(test_directory, true, false, false, false, context)};
+ auto chainman{create_chainman(
+ test_directory, /*reindex=*/true, /*wipe_chainstate=*/false,
+ /*block_tree_db_in_memory=*/false, /*chainstate_db_in_memory=*/false, context)};
std::vector<std::string> import_files;
BOOST_CHECK(chainman->ImportBlocks(import_files));
@@ -835,7 +837,9 @@ void chainman_reindex_chainstate_test(TestDirectory& test_directory)
{
auto notifications{std::make_shared<TestKernelNotifications>()};
auto context{create_context(notifications, ChainType::MAINNET)};
- auto chainman{create_chainman(test_directory, false, true, false, false, context)};
+ auto chainman{create_chainman(
+ test_directory, /*reindex=*/false, /*wipe_chainstate=*/true,
+ /*block_tree_db_in_memory=*/false, /*chainstate_db_in_memory=*/false, context)};
std::vector<std::string> import_files;
import_files.push_back((test_directory.m_directory / "blocks" / "blk00000.dat").string());
@@ -847,7 +851,9 @@ void chainman_mainnet_validation_test(TestDirectory& test_directory)
auto notifications{std::make_shared<TestKernelNotifications>()};
auto validation_interface{std::make_shared<TestValidationInterface>()};
auto context{create_context(notifications, ChainType::MAINNET, validation_interface)};
- auto chainman{create_chainman(test_directory, false, false, false, false, context)};
+ auto chainman{create_chainman(
+ test_directory, /*reindex=*/false, /*wipe_chainstate=*/false,
+ /*block_tree_db_in_memory=*/false, /*chainstate_db_in_memory=*/false, context)};
// mainnet block 1
auto raw_block = hex_string_to_byte_vec("010000006fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d6190000000000982051fd1e4ba744bbbe680e1fee14677ba1a3c3540bf7b1cdb606e857233e0e61bc6649ffff001d01e362990101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0704ffff001d0104ffffffff0100f2052a0100000043410496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858eeac00000000");
@@ -975,7 +981,9 @@ BOOST_AUTO_TEST_CASE(btck_chainman_in_memory_tests)
auto notifications{std::make_shared<TestKernelNotifications>()};
auto context{create_context(notifications, ChainType::REGTEST)};
- auto chainman{create_chainman(in_memory_test_directory, false, false, true, true, context)};
+ auto chainman{create_chainman(
+ in_memory_test_directory, /*reindex=*/false, /*wipe_chainstate=*/false,
+ /*block_tree_db_in_memory=*/true, /*chainstate_db_in_memory=*/true, context)};
for (auto& raw_block : REGTEST_BLOCK_DATA) {
Block block{hex_string_to_byte_vec(raw_block)};
@@ -999,7 +1007,9 @@ BOOST_AUTO_TEST_CASE(btck_chainman_regtest_tests)
auto context{create_context(notifications, ChainType::REGTEST)};
{
- auto chainman{create_chainman(test_directory, false, false, false, false, context)};
+ auto chainman{create_chainman(
+ test_directory, /*reindex=*/false, /*wipe_chainstate=*/false,
+ /*block_tree_db_in_memory=*/false, /*chainstate_db_in_memory=*/false, context)};
for (const auto& data : REGTEST_BLOCK_DATA) {
Block block{hex_string_to_byte_vec(data)};
BlockHeader header = block.GetHeader();
@@ -1021,7 +1031,9 @@ BOOST_AUTO_TEST_CASE(btck_chainman_regtest_tests)
const size_t mid{REGTEST_BLOCK_DATA.size() / 2};
{
- auto chainman{create_chainman(test_directory, false, false, false, false, context)};
+ auto chainman{create_chainman(
+ test_directory, /*reindex=*/false, /*wipe_chainstate=*/false,
+ /*block_tree_db_in_memory=*/false, /*chainstate_db_in_memory=*/false, context)};
for (size_t i{0}; i < mid; i++) {
Block block{hex_string_to_byte_vec(REGTEST_BLOCK_DATA[i])};
bool new_block{false};
@@ -1030,7 +1042,9 @@ BOOST_AUTO_TEST_CASE(btck_chainman_regtest_tests)
}
}
- auto chainman{create_chainman(test_directory, false, false, false, false, context)};
+ auto chainman{create_chainman(
+ test_directory, /*reindex=*/false, /*wipe_chainstate=*/false,
+ /*block_tree_db_in_memory=*/false, /*chainstate_db_in_memory=*/false, context)};
for (size_t i{mid}; i < REGTEST_BLOCK_DATA.size(); i++) {
Block block{hex_string_to_byte_vec(REGTEST_BLOCK_DATA[i])};
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.