aboutsummaryrefslogtreecommitdiff
path: root/tests/unit_tests/is_hdd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit_tests/is_hdd.cpp')
-rw-r--r--tests/unit_tests/is_hdd.cpp17
1 files changed, 17 insertions, 0 deletions
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