Files
bitcoin/src
merge-script aa0e0f793f Merge bitcoin/bitcoin#35729: refactor: test: Unroll && conditions in macros
e8691056c0 test: Unroll `&&` conditions in macros (rustaceanrob)

Pull request description:

  Picked from #35713. Given that I think this is a strict debugging improvement, I opened as a separate pull:

  Using `&&` in `BOOST_CHECK` is problematic as failures will not indicate which condition failed. By unrolling these checks, the user knows exactly which expression is the failing case.

  As an example, here is a line that would be particularly hard to debug if it failed:

  ```
  src/test/net_tests.cpp

  BOOST_CHECK((*ret)[1] && (*ret)[1]->m_type == "headers" && std::ranges::equal((*ret)[1]->m_recv, MakeByteSpan(msg_data_2)));
  ```

  If any one of these conditions fail, the whole expression fails, with no values printed or indication as to which condition failed.

  This is also required when using test macros that support value decomposition, which requires `&&` and `||` are `delete`. Examples include `BOOST_TEST`, doctest, Catch2, etc.

  ref: https://catch2-temp.readthedocs.io/en/latest/assertions.html#other-limitations
  ref: https://fekir.info/post/decomposing-an-expression/

ACKs for top commit:
  maflcko:
    re-ACK e8691056c0 🌽
  ismaelsadeeq:
    reACK e8691056c0
  sedited:
    ACK e8691056c0

Tree-SHA512: 9eb74cecd47ee4fdc3f53beb7d50d5056d543303d023c68b8d47cbe52d37f1156488c8b943faf68dd52c192c43626037bbf08172e7cc24753e0f6070db6e3ab2
2026-08-11 17:17:53 +02:00
..
2026-08-03 12:03:56 -07:00
2026-07-22 12:38:13 -07:00
2026-07-23 12:06:32 +02:00
2026-07-23 12:06:32 +02:00
2026-08-03 12:03:56 -07:00
2026-08-10 16:02:20 +03:00
2026-08-05 21:41:49 +02:00