diff options
author | winder <wwinder.unh@gmail.com> | 2018-07-11 23:44:12 -0400 |
---|---|---|
committer | winder <wwinder.unh@gmail.com> | 2018-07-11 23:44:12 -0400 |
commit | 075429a482392050c8e9008d9c990d185054a597 (patch) | |
tree | e0bec3da4d66f83fc994a73c2523a55959df6476 /src/test/util_tests.cpp | |
parent | 43ae5ee9e4c274c402ebb9a73795593a6c18c157 (diff) | |
download | bitcoin-075429a482392050c8e9008d9c990d185054a597.tar.xz |
Use common SetDataDir method to create temp directory in tests.
Diffstat (limited to 'src/test/util_tests.cpp')
-rw-r--r-- | src/test/util_tests.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index 611ccc9b77..d535f74e91 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -1100,7 +1100,7 @@ static void TestOtherProcess(fs::path dirname, std::string lockname, int fd) BOOST_AUTO_TEST_CASE(test_LockDirectory) { - fs::path dirname = fs::temp_directory_path() / fs::unique_path(); + fs::path dirname = SetDataDir("test_LockDirectory") / fs::unique_path(); const std::string lockname = ".lock"; #ifndef WIN32 // Revert SIGCHLD to default, otherwise boost.test will catch and fail on @@ -1188,12 +1188,12 @@ BOOST_AUTO_TEST_CASE(test_LockDirectory) BOOST_AUTO_TEST_CASE(test_DirIsWritable) { - // Should be able to write to the system tmp dir. - fs::path tmpdirname = fs::temp_directory_path(); + // Should be able to write to the data dir. + fs::path tmpdirname = SetDataDir("test_DirIsWritable"); BOOST_CHECK_EQUAL(DirIsWritable(tmpdirname), true); // Should not be able to write to a non-existent dir. - tmpdirname = fs::temp_directory_path() / fs::unique_path(); + tmpdirname = tmpdirname / fs::unique_path(); BOOST_CHECK_EQUAL(DirIsWritable(tmpdirname), false); fs::create_directory(tmpdirname); |