diff options
author | p8p <p8p@users.noreply.github.com> | 2018-08-25 04:16:01 -0700 |
---|---|---|
committer | p8p <p8p@users.noreply.github.com> | 2018-08-25 04:31:22 -0700 |
commit | 9d6539923e615014189c9281a52fad080f09a64e (patch) | |
tree | 969f60962c351ff93918b43af2634d1eb8bbd245 /tests/unit_tests | |
parent | Merge pull request #4223 (diff) | |
download | monero-9d6539923e615014189c9281a52fad080f09a64e.tar.xz |
is_hdd update
Diffstat (limited to 'tests/unit_tests')
-rw-r--r-- | tests/unit_tests/CMakeLists.txt | 3 | ||||
-rw-r--r-- | tests/unit_tests/is_hdd.cpp | 17 |
2 files changed, 19 insertions, 1 deletions
diff --git a/tests/unit_tests/CMakeLists.txt b/tests/unit_tests/CMakeLists.txt index 145e3820e..7cbf38424 100644 --- a/tests/unit_tests/CMakeLists.txt +++ b/tests/unit_tests/CMakeLists.txt @@ -76,7 +76,8 @@ set(unit_tests_sources output_selection.cpp vercmp.cpp ringdb.cpp - wipeable_string.cpp) + wipeable_string.cpp + is_hdd.cpp) set(unit_tests_headers unit_tests_utils.h) diff --git a/tests/unit_tests/is_hdd.cpp b/tests/unit_tests/is_hdd.cpp new file mode 100644 index 000000000..1be670e5e --- /dev/null +++ b/tests/unit_tests/is_hdd.cpp @@ -0,0 +1,17 @@ +#include "common/util.h" +#include <string> +#include <gtest/gtest.h> + +#if defined(__GLIBC__) +TEST(is_hdd, linux_os_root) +{ + std::string path = "/"; + EXPECT_TRUE(tools::is_hdd(path.c_str())); +} +#else +TEST(is_hdd, unknown_os) +{ + std::string path = ""; + EXPECT_FALSE(tools::is_hdd(path.c_str())); +} +#endif |