is_hdd update

This commit is contained in:
p8p 2018-08-25 04:16:01 -07:00
parent 91c7d68b2d
commit 9d6539923e
No known key found for this signature in database
GPG key ID: F7078EC66F3061EE
5 changed files with 61 additions and 53 deletions

View file

@ -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