diff options
author | Kiminuo <kiminuo@protonmail.com> | 2021-01-15 07:26:51 +0000 |
---|---|---|
committer | Kiminuo <kiminuo@protonmail.com> | 2021-01-15 20:19:31 +0100 |
commit | 66576c4fd532ac18b8b355ea93d25581a2c15654 (patch) | |
tree | 236a50bffc8bc85f701ea877749d80231db20a4a | |
parent | 32e59fc371080def4b0be2adbe6486a4ba059972 (diff) | |
download | bitcoin-66576c4fd532ac18b8b355ea93d25581a2c15654.tar.xz |
test: Clear forced -walletdir setting after wallet init_tests
Leaving this value set interfered with the CreateWallet test if it happened to execute later in the test ordering. Specifically it would cause CreateWallet test to write data to the current directory instead of temporary test directory.
-rw-r--r-- | src/wallet/test/init_test_fixture.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/wallet/test/init_test_fixture.cpp b/src/wallet/test/init_test_fixture.cpp index aa7f1c83d8..f035a70a20 100644 --- a/src/wallet/test/init_test_fixture.cpp +++ b/src/wallet/test/init_test_fixture.cpp @@ -3,6 +3,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <fs.h> +#include <univalue.h> #include <util/check.h> #include <util/system.h> @@ -37,6 +38,9 @@ InitWalletDirTestingSetup::InitWalletDirTestingSetup(const std::string& chainNam InitWalletDirTestingSetup::~InitWalletDirTestingSetup() { + gArgs.LockSettings([&](util::Settings& settings) { + settings.forced_settings.erase("walletdir"); + }); fs::current_path(m_cwd); } |