Skip to content

Commit

Permalink
doc: doxygen comment for m_args usage in tests
Browse files Browse the repository at this point in the history
Closes: bitcoin#25055

Add doxygen comment to the m_args member in the unit test framework,
clarifying its purpose and providing usage guidelines.
  • Loading branch information
willcl-ark committed Oct 13, 2024
1 parent 48cf3da commit 76672a9
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/test/util/setup_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,23 @@ struct BasicTestingSetup {
fs::path m_path_root;
fs::path m_path_lock;
bool m_has_custom_datadir{false};
/**
* @brief Test-specific arguments and settings.
*
* This member is intended to be the primary source of settings for code being
* tested by unit tests. It exists to make tests more self-contained and reduce
* reliance on global state.
*
* Usage guidelines:
* 1. Prefer using m_args where possible in test code.
* 2. If m_args is not accessible, use m_node.args as a fallback.
* 3. Avoid direct references to gArgs in test code.
*
* Note: Currently, m_node.args points to gArgs for backwards compatibility.
* In the future, it will point to m_args to further isolate test environments.
*
* @see https://github.com/bitcoin/bitcoin/pull/21244#discussion_r615307465 for additional context.
*/
ArgsManager m_args;
};

Expand Down

0 comments on commit 76672a9

Please sign in to comment.