Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(514)

Side by Side Diff: utils_unittest.cc

Issue 3053049: Nice automatic updates up to a point, then renice if necessary. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: better documentation Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « utils.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698