mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-05 04:29:36 +01:00
fa43897c1ddoc: Fix LLM nits in net_processing.cpp (MarcoFalke)bbbba0fd4bscripted-diff: Use references when nullptr is not possible (MarcoFalke)fac5415466refactor: Separate peer/maybe_peer in ProcessMessages and SendMessages (MarcoFalke)fac529188erefactor: Pass Peer& to ProcessMessage (MarcoFalke)fa376095a0refactor: Pass CNode& to ProcessMessages and SendMessages (MarcoFalke)fada838014refactor: Make ProcessMessage private again (MarcoFalke)fa80cd3ceetest: [refactor] Avoid calling private ProcessMessage() function (MarcoFalke) Pull request description: There is a single unit test, which calls the internal `ProcessMessage` function. This is problematic, because it makes future changes harder, since they will need to carry over this public internal interface each time. Also, there is a mixed use of pointers and references in p2p code, where just based on context, a pointer may sometimes assumed to be null, or non-null. This is confusing when reading the code, or making or reading future changes. Fix both issues in a series of commits, to: * refactor the single unit test to call higher-level functions * Make `ProcessMessage` private again * Use references instead of implicit non-null pointers, mostly in a scripted-diff ACKs for top commit: optout21: reACKfa43897c1dajtowns: ACKfa43897c1dCrypt-iQ: crACKfa43897c1dachow101: ACKfa43897c1dTree-SHA512: d03d8ea35490a995f121be3d2f3e4a22d1aadfeab30bc42c4f8383dab0e6e27046260e792d9e5a94faa6777490ba036e39c71c50611a38f70b90e3a01f002c9e
Test library
This contains files for the test library, which is used by the test binaries (unit tests, benchmarks, fuzzers, gui tests).
Generally, the files in this folder should be well-separated modules. New code should be added to existing modules or (when in doubt) a new module should be created.
The utilities in here are compiled into a library, which does not hold any state. However, the main file setup_common
defines the common test setup for all test binaries. The test binaries will handle the global state when they
instantiate the BasicTestingSetup (or one of its derived classes).