From 9d6539923e615014189c9281a52fad080f09a64e Mon Sep 17 00:00:00 2001 From: p8p Date: Sat, 25 Aug 2018 04:16:01 -0700 Subject: is_hdd update --- tests/unit_tests/is_hdd.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/unit_tests/is_hdd.cpp (limited to 'tests/unit_tests/is_hdd.cpp') 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 +#include + +#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 -- cgit v1.2.3