Electroneum
is_hdd.cpp
Go to the documentation of this file.
1 #include "common/util.h"
2 #include <string>
3 #include <gtest/gtest.h>
4 
5 #if defined(__GLIBC__)
6 TEST(is_hdd, linux_os_root)
7 {
8  std::string path = "/";
9  EXPECT_TRUE(tools::is_hdd(path.c_str()) != boost::none);
10 }
11 #else
12 TEST(is_hdd, unknown_os)
13 {
14  std::string path = "";
15  EXPECT_FALSE(tools::is_hdd(path.c_str()) != boost::none);
16 }
17 #endif
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
::std::string string
Definition: gtest-port.h:1097
TEST(is_hdd, unknown_os)
Definition: is_hdd.cpp:12
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
boost::optional< bool > is_hdd(const char *file_path)
Definition: util.cpp:813