From 84b0973e35dae63cd1b60199b481e24d54e58c97 Mon Sep 17 00:00:00 2001 From: Ryan Ofsky Date: Mon, 7 Mar 2022 13:29:46 -0500 Subject: test: Add tests for GetArg methods / settings.json type coercion Just add tests. No changes to application behavior. Tests will be updated in the next commit changing & improving current behavior. Include a Qt test for GUI startup crash reported by Rspigler in https://github.com/bitcoin/bitcoin/issues/24457 caused by GetArg behavior that happens if settings.json contains an integer value for any of the configuration options which GUI settings can currently clash with (-dbcache, -par, -spendzeroconfchange, -signer, -upnp, -natpmp, -listen, -server, -proxy, -proxy, -onion, -onion, -lang, and -prune). --- src/test/getarg_tests.cpp | 112 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) (limited to 'src/test/getarg_tests.cpp') diff --git a/src/test/getarg_tests.cpp b/src/test/getarg_tests.cpp index 76a65ec528..4dc12ec7d7 100644 --- a/src/test/getarg_tests.cpp +++ b/src/test/getarg_tests.cpp @@ -3,6 +3,8 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include +#include +#include #include #include @@ -41,6 +43,116 @@ void SetupArgs(ArgsManager& local_args, const std::vector