mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:29:40 +00:00
test: Remove BOOST_FAIL and add info in descriptor_tests #36772
Labels
No labels
Android
Backport
Block storage
Brainstorming
Bug
Build system
CI failed
Consensus
Data corruption
Descriptors
Docs
DrahtBot Guix build requested
Feature
Fuzzing
GUI
Good First Review
IPC
Insufficient Review
Kernel
Linux/Unix
Mempool
Mining
Needs Backport (31.x)
Needs Backport (32.x)
Needs Benchmark
Needs Conceptual Review
Needs backport (30.x)
Needs rebase
Needs release note
Net
P2P
PSBT
Privacy
Private Broadcast
Questions and Help
RPC/REST/ZMQ
Refactoring
Resource usage
Review club
Scripts and tools
Settings
TX fees and policy
Tests
Tracking Issue
UTXO Db and Indexes
Up for grabs
Upstream
Utils/log/libs
Validation
Waiting for author
Wallet
Windows
good first issue
interfaces
macOS
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin/bitcoin!36772
Loading…
Reference in a new issue
No description provided.
Delete branch "nov-5-boost-macros"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The
BOOST_FAILhere is used to exit the test based on a condition, but we can useREQUIREdirectly. The context string is only printed on failure to my knowledge and this is not called on a child thread so there is no behavior change.The
descriptor_testsusesBOOST_TEST_INFOto add the descriptor if the next condition fails, but there are some other places that also print the public or private descriptor. Seems useful throughout this whole funciton body to attach the private and public descriptor as context.Found in #35713 as low usage macros
ref:
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
External sites
Reviews
See the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste
<!--meta-tag:bot-skip-->into the comment that the bot should ignore.Conflicts
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
🔵 Suggestion · Descriptor test context hides the apostrophe-to-h pass
Failures relying on the new scoped context show the original apostrophe form even during the converted
hpass, losing diagnostic detail previously supplied by the removed messages.Location:
src/test/descriptor_tests.cpp:186(head).Review coverage was incomplete.
Reviewed:
f5a887c19961· Full review report · Previous reportspermalink
ACK
6fe87a36e7Seems fine to change
BOOST_FAILtoBOOST_REQUIRE_MESSAGE.I think the
BOOST_TEST_INFOaddition is not necessary, but also won't hurt so fine with me.Left a few suggestions to extend descriptor context to the parsing checks and simplify assertions.
Changing
BOOST_CHECK_MESSAGEto remove failure context is surprising in a PR framed around removingBOOST_FAILand adding info.To include the parsing checks in the context too, we could wrap the whole
DoCheckbody inBOOST_TEST_CONTEXT("Priv desc: " << prv, "Pub desc: " << pub).The message now just restates the assertion. We could use a conditional
BOOST_CHECK_EQUALinstead:(
.value()also makes a missing size fail explicitly.)Wouldn't
BOOST_CHECK_NEbe simpler here?These are in the scope of
BOOST_TEST_INFO_SCOPEabove so both descriptors are printed on failure. Theprvaddition would be redundant in this line but I can move theINFO_SCOPEabove theParseif you prefer.The
!is implicitly casting theintto a bool on the RHS so removing!(...)and usingNEdoesn't have the same behavior if I replaced it withflags & SIGNABLE_FAILS. I can replace it withbool(flags & SIGNABLE_FAILS)to useNEbut not sure if that makes things any simplerACK
6fe87a36e7My previous quick review turned out to be a bit shallow: the new scoped context correctly covers the removed failure info. The
ScriptSize()suggestion still stands, but it's just a nit. If you touch this again, movingINFO_SCOPEabove theParsecalls would be useful too, though the current version already preserves the existing failure context.You're right, having clean bools on both sides is simpler, please resolve
Took that thanks
f5a887c199moved above parse, also suggestions either resolved or takenACK
f5a887c199review ACK
f5a887c199🎲Show signature
Signature:
ACK
f5a887c199