diff options
author | Kiminuo <kiminuo@protonmail.com> | 2021-04-08 23:15:01 +0200 |
---|---|---|
committer | Kiminuo <kiminuo@protonmail.com> | 2021-04-17 20:09:01 +0200 |
commit | 1add318704108faa98f5b1b8e9c96d960e9d23a8 (patch) | |
tree | 0f1c4d6c1215508224c2ebbf74f47ded717b594c /src/test | |
parent | 70cdf679f8e665dbdc3301873a0267fe9faa72cd (diff) |
Move GetDataDir(fNetSpecific) implementation to ArgsManager.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/util_tests.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index a1ac9ead69..76ffdc598a 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -1143,21 +1143,23 @@ BOOST_AUTO_TEST_CASE(util_ReadWriteSettings) { // Test writing setting. TestArgsManager args1; + args1.ForceSetArg("-datadir", m_path_root.string()); args1.LockSettings([&](util::Settings& settings) { settings.rw_settings["name"] = "value"; }); args1.WriteSettingsFile(); // Test reading setting. TestArgsManager args2; + args2.ForceSetArg("-datadir", m_path_root.string()); args2.ReadSettingsFile(); args2.LockSettings([&](util::Settings& settings) { BOOST_CHECK_EQUAL(settings.rw_settings["name"].get_str(), "value"); }); // Test error logging, and remove previously written setting. { ASSERT_DEBUG_LOG("Failed renaming settings file"); - fs::remove(GetDataDir() / "settings.json"); - fs::create_directory(GetDataDir() / "settings.json"); + fs::remove(args1.GetDataDirPath() / "settings.json"); + fs::create_directory(args1.GetDataDirPath() / "settings.json"); args2.WriteSettingsFile(); - fs::remove(GetDataDir() / "settings.json"); + fs::remove(args1.GetDataDirPath() / "settings.json"); } } |