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.
pull/826/head
Kiminuo 4 years ago
parent 32e59fc371
commit 66576c4fd5

@ -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);
}

Loading…
Cancel
Save