diff options
| author | luigi1111 <luigi1111w@gmail.com> | 2018-09-10 15:07:02 -0500 |
|---|---|---|
| committer | luigi1111 <luigi1111w@gmail.com> | 2018-09-10 15:07:02 -0500 |
| commit | ab85b924c907587aaf52a4b14febdc78f6f2c041 (patch) | |
| tree | 5020be4cef3124b75e0082af5f3ff5da76e13c26 /tests | |
| parent | 46bcd91db469ef6704075de4c04f113f26dbe9b7 (diff) | |
| parent | 9d6539923e615014189c9281a52fad080f09a64e (diff) | |
| download | monzero-core-ab85b924c907587aaf52a4b14febdc78f6f2c041.tar.gz monzero-core-ab85b924c907587aaf52a4b14febdc78f6f2c041.tar.xz monzero-core-ab85b924c907587aaf52a4b14febdc78f6f2c041.zip | |
Merge pull request #4293
9d65399 is_hdd update (p8p)
Diffstat (limited to '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 076a4a873..7366990ad 100644 --- a/tests/unit_tests/CMakeLists.txt +++ b/tests/unit_tests/CMakeLists.txt @@ -77,7 +77,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 |
