Review report

core: PR #35713

2 minor findings · 3 suggestions

Earlier concerns neither republished nor resolved: 7 major findings · 20 minor findings · 18 suggestions. See the Run archive for their assessments.

Findings

Link

[minor] · The documented core-dump option is rejected as an unknown argument

Following the unit-test README’s crash-debugging steps makes test_bitcoin exit before running any tests.

Location: src/test/util/framework.cpp:330 (head).

Details and suggested fix

The README still says Boost intercepts system errors by default and recommends --catch_system_errors=no to produce a core dump. The new runner accepts only the singular --catch_system_error option, so the documented plural spelling is rejected and the process exits with status 2 before running tests. The README’s description of the default is also outdated: the runner installs no system-error handler and rejects --catch_system_error=yes. Update the README to describe the new behavior, including that core-dump production depends on the operating system’s limits, and remove the obsolete Boost-specific wording. Alternatively, accept the plural spelling as an alias to preserve the documented command.


Link

[minor] · Range decomposition can override a type’s operator==

CHECK(a == b) can fail for equal unordered containers or pass for unequal CKey values; no current assertion was found that exercises either case.

Location: src/test/util/framework.h:365 (head).

Details and suggested fix

When both operands are ranges without operator<< or ToString(), the decomposer calls check_equal_ranges instead of using the type’s operator==. That helper compares elements position by position, so equal std::unordered_set values can fail if they iterate in different orders. The same branch applies to CKey, whose equality operator also compares fCompressed; compressed and uncompressed keys with identical bytes would therefore pass the decomposed check. No current assertion comparing unordered containers or CKey values was found, so the impact on the current suite is unconfirmed. When the operands support ==, use its result to determine whether the check passes and use check_equal_ranges only to describe failures. Retain element-wise comparison for types such as subrange that have no ==.


Optional improvements

Link

[suggestion] · The runner’s failure-accounting paths lack coverage

Without tests for assertion failures and exceptions, regressions could let failed unit tests pass silently.

Location: src/test/util/framework.cpp:416 (head).

Details and suggested fix

The runner is responsible for making failed CHECK and REQUIRE assertions and unexpected exceptions fail the test case and process. It assumes record_check has already counted a REQUIRE failure when it catches RequireFailed, and it relies on exception_occurred() for other exceptions. The migrated suites exercise only passing assertions, so they do not cover these paths. Add a separate test executable with a failing CHECK, a failing REQUIRE followed by a sentinel, and a thrown exception. A harness should verify the exit status and expected output, including with --log_level=nothing, without putting intentional failures in test_bitcoin.


Link

[suggestion] · Descriptor key-count failures omit the compared values

The replacement checks show the descriptor but not the mismatched key counts, reducing the usefulness of test failures.

Location: src/test/descriptor_tests.cpp:297 (head).

Details and suggested fix

These checks were previously BOOST_CHECK_EQUAL assertions with BOOST_TEST_INFO context, which reported both counts and the descriptor on failure. They now use BOOST_CHECK_MESSAGE, which maps to CHECK_NO_DISPLAY; that macro prints a generic message instead of decomposing the expression. Use a value-printing CHECK with the descriptor as context for the public-descriptor check, and do the same for the private-descriptor check.


Link

[suggestion] · Mixed-sign integer checks use different comparison semantics

For negative signed operands compared with unsigned operands, a CHECK or BOOST_CHECK_* shim can return a different result from the written C++ expression; the header does not document this behavior.

Location: src/test/util/framework.h:377 (head).

Details and suggested fix

When one integer operand is signed and the other unsigned, the decomposer uses std::cmp_equal, std::cmp_less, and related functions instead of the written operator. This also affects the BOOST_CHECK_EQUAL, BOOST_CHECK_LT, and other shims. For example, CHECK(-1 < 1u) passes even though the C++ expression is false, and CHECK(x == -1) fails when uint32_t x is 0xffffffff, although Boost’s native comparison passed. The behavior appears intentional, but the CHECK documentation shows ordinary expression syntax. Document at DECOMPOSE_OP and in the CHECK description that mixed-sign integer comparisons use mathematical-value semantics. No current assertion comparing a negative signed value with an unsigned one was found.


Coverage details

Earlier concerns

Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.