Index: utils_unittest.cc |
diff --git a/utils_unittest.cc b/utils_unittest.cc |
index b67114a9df8472056be784f46c1bf205154c8880..575d91fbb99bee3a244b3c2fe4f3fdd5a6e2e0f3 100644 |
--- a/utils_unittest.cc |
+++ b/utils_unittest.cc |
@@ -133,6 +133,23 @@ TEST(UtilsTest, TempFilenameTest) { |
TEST(UtilsTest, RootDeviceTest) { |
EXPECT_EQ("/dev/sda", utils::RootDevice("/dev/sda3")); |
EXPECT_EQ("/dev/mmc0", utils::RootDevice("/dev/mmc0p3")); |
+ EXPECT_EQ("", utils::RootDevice("/dev/foo/bar")); |
+ EXPECT_EQ("", utils::RootDevice("/")); |
+ EXPECT_EQ("", utils::RootDevice("")); |
+} |
+ |
+TEST(UtilsTest, SysfsBlockDeviceTest) { |
+ EXPECT_EQ("/sys/block/sda", utils::SysfsBlockDevice("/dev/sda")); |
+ EXPECT_EQ("", utils::SysfsBlockDevice("/foo/sda")); |
+ EXPECT_EQ("", utils::SysfsBlockDevice("/dev/foo/bar")); |
+ EXPECT_EQ("", utils::SysfsBlockDevice("/")); |
+ EXPECT_EQ("", utils::SysfsBlockDevice("./")); |
+ EXPECT_EQ("", utils::SysfsBlockDevice("")); |
+} |
+ |
+TEST(UtilsTest, IsRemovableDeviceTest) { |
+ EXPECT_FALSE(utils::IsRemovableDevice("")); |
+ EXPECT_FALSE(utils::IsRemovableDevice("/dev/non-existent-device")); |
} |
TEST(UtilsTest, PartitionNumberTest) { |