AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 15 Bitcoin

Merge bitcoin/bitcoin#36091: test: Add debug output to common tested types

Public commit record

What the developer wrote

Authored by merge-script

91/100 · Strong
Merge bitcoin/bitcoin#36091: test: Add debug output to common tested types

722d08e03980c359bae4e3b65551d6b8ba615a7a test: Convert `BOOST_CHECK` macros with known debug string (rustaceanrob)
d735b94803a6d6e1ae8a3716a2ca7b1a63e1ca1e test: Add display `operator<<` overloads to `common.{h,cpp}` (rustaceanrob)

Pull request description:

If the `<<` operator exists, boost can use this as a debug output when a check fails (besides `BOOST_CHECK`). This adds `<<` for types commonly used across the unit tests that do not yet have a display output. Each callsite that uses these types are then updated to use macros that will print the debug output on failure. All of these display strings would be used as part of #35713, but we can also use them with boost today.

What this PR does:
- Adds debug output for types used across multiple files, or types that have a clear debug string, and migrates the `BOOST_CHECK` calls. This covers the majority of custom types that did not yet have a debug string.

What this PR does _not_ do:
- Migrate `BOOST_CHECK` callsites for types that already _do_ have a debug output (all primitive type comparisons, `CFeeRate`, etc). This would be a much larger refactor and could perhaps be done after.
- Add debug output for `std::vector<T>` where `T` is streamable. These can be migrated to `BOOST_CHECK_EQUAL_COLLECTIONS`, but is a similar refactor to the one above.
- Add debug output for `std::vector<unsigned char>` and related. Also a large refactor, and could use discussion.
- Add debug output for types that would require a `friend` method in the source code (`ByRatio`)

ACKs for top commit:
maflcko:
review ACK 722d08e03980c359bae4e3b65551d6b8ba615a7a 🍟
ismaelsadeeq:
reACK 722d08e03980c359bae4e3b65551d6b8ba615a7a

Tree-SHA512: 0ee1fdfa354195c87b428705758568843eee16fe72b42263adb2855045a1fe2163f62b8bf62734b0a1ba16411aca0df2348c29f9163e9b004f315fe90b3905b4
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit only changes Bitcoin Core's test code. It adds pretty-printing helpers for common data types and updates test assertions to use macros that print more helpful failure messages. There is no change to the actual Bitcoin node software that users run, so it cannot affect live wallets, transactions, or network behavior.

Recommended action

No security action required. Treat as normal test-quality improvement.

Security signals we found

01

No production code changes

02

Test-only refactoring

03

No cryptographic, consensus, network, or wallet logic changes

04

No bug fixes or vulnerability patches present in diff

Risk score

Why this scored 15/100

Our methodology →
Potential impact 0/30
Exploitability 0/25
Stealth signal 0/15
Affected reach 0/15
Confidence 10/10
Evidence quality 5/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.