diff options
author | redfish <redfish@galactica.pw> | 2018-07-21 21:30:39 -0400 |
---|---|---|
committer | redfish <redfish@galactica.pw> | 2018-07-22 14:14:54 -0400 |
commit | 68b1197f5db8b4410c25c5188d666edb0c4d938c (patch) | |
tree | 8471015d657fd47e9e4c36fb7e0297d2d7f47498 /tests/unit_tests | |
parent | Merge pull request #4088 (diff) | |
download | monero-68b1197f5db8b4410c25c5188d666edb0c4d938c.tar.xz |
tests: ringdb: use system's temporary dir path
Fixes failing test during Arch package build (due to attempt to write to
~/.bitmonero/...).
Prefix temp dir path with "monero-" because we are not putting it on the
system, so good to identify ourselves in case the dir gets left over due
to crash, etc.
Diffstat (limited to 'tests/unit_tests')
-rw-r--r-- | tests/unit_tests/ringdb.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/unit_tests/ringdb.cpp b/tests/unit_tests/ringdb.cpp index d50d61b0f..ef954fda2 100644 --- a/tests/unit_tests/ringdb.cpp +++ b/tests/unit_tests/ringdb.cpp @@ -76,13 +76,13 @@ public: private: std::string make_filename() { - boost::filesystem::path path = tools::get_default_data_dir(); - path /= "fake"; + boost::filesystem::path path = + boost::filesystem::temp_directory_path(); #if defined(__MINGW32__) || defined(__MINGW__) - filename = tempnam(path.string().c_str(), "ringdb-test-"); + filename = tempnam(path.string().c_str(), "monero-ringdb-test-"); EXPECT_TRUE(filename != NULL); #else - path /= "ringdb-test-XXXXXX"; + path /= "monero-ringdb-test-XXXXXX"; filename = strdup(path.string().c_str()); EXPECT_TRUE(mkdtemp(filename) != NULL); #endif |