216 | @@ -217,29 +217,37 @@ BOOST_AUTO_TEST_CASE(util_ParseParameters)
217 | const char *argv_test[] = {"-ignored", "-a", "-b", "-ccc=argument", "-ccc=multiple", "f", "-d=e"};
218 |
219 | std::string error;
220 | - LOCK(testArgs.cs_args);
221 | testArgs.SetupArgs({a, b, ccc, d});
222 | BOOST_CHECK(testArgs.ParseParameters(0, argv_test, error));
223 | - BOOST_CHECK(testArgs.m_settings.command_line_options.empty() && testArgs.m_settings.ro_config.empty());
Seems these could all use LockSettings() instead of having to mess with the internal mutex?
With these changed, I believe you can pretty easily change almost all of the the protected: parts of ArgsManager (including cs_args) to private:, just leaving ReadConfigStream() and ReadConfigString() as protected, test-only, methods for testing the behaviour of ReadConfigFiles(). See https://github.com/ajtowns/bitcoin/commits/202603-argsman-private/
Done. Added a new commit fdc64114dd22d259503a6ac63846e9f4b803854b for this and you as co-author.