| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <sys/stat.h> | 5 #include <sys/stat.h> |
| 6 #include <sys/types.h> | 6 #include <sys/types.h> |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 #include <gtest/gtest.h> | 10 #include <gtest/gtest.h> |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 TEST(UtilsTest, IsRemovableDeviceTest) { | 150 TEST(UtilsTest, IsRemovableDeviceTest) { |
| 151 EXPECT_FALSE(utils::IsRemovableDevice("")); | 151 EXPECT_FALSE(utils::IsRemovableDevice("")); |
| 152 EXPECT_FALSE(utils::IsRemovableDevice("/dev/non-existent-device")); | 152 EXPECT_FALSE(utils::IsRemovableDevice("/dev/non-existent-device")); |
| 153 } | 153 } |
| 154 | 154 |
| 155 TEST(UtilsTest, PartitionNumberTest) { | 155 TEST(UtilsTest, PartitionNumberTest) { |
| 156 EXPECT_EQ("3", utils::PartitionNumber("/dev/sda3")); | 156 EXPECT_EQ("3", utils::PartitionNumber("/dev/sda3")); |
| 157 EXPECT_EQ("3", utils::PartitionNumber("/dev/mmc0p3")); | 157 EXPECT_EQ("3", utils::PartitionNumber("/dev/mmc0p3")); |
| 158 } | 158 } |
| 159 | 159 |
| 160 TEST(UtilsTest, ComparePriorities) { |
| 161 EXPECT_LT(utils::ComparePriorities(utils::kProcessPriorityLow, |
| 162 utils::kProcessPriorityNormal), 0); |
| 163 EXPECT_GT(utils::ComparePriorities(utils::kProcessPriorityNormal, |
| 164 utils::kProcessPriorityLow), 0); |
| 165 EXPECT_EQ(utils::ComparePriorities(utils::kProcessPriorityNormal, |
| 166 utils::kProcessPriorityNormal), 0); |
| 167 EXPECT_GT(utils::ComparePriorities(utils::kProcessPriorityHigh, |
| 168 utils::kProcessPriorityNormal), 0); |
| 169 } |
| 170 |
| 160 } // namespace chromeos_update_engine | 171 } // namespace chromeos_update_engine |
| OLD | NEW |