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

Side by Side Diff: src/platform/update_engine/utils_unittest.cc

Issue 1881001: AU: Many minor cleanup changes (Closed) Base URL: ssh://git@chromiumos-git/chromeos
Patch Set: fixes for review Created 10 years, 7 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
« no previous file with comments | « src/platform/update_engine/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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 } 118 }
119 119
120 TEST(UtilsTest, TempFilenameTest) { 120 TEST(UtilsTest, TempFilenameTest) {
121 const string original = "/foo.XXXXXX"; 121 const string original = "/foo.XXXXXX";
122 const string result = utils::TempFilename(original); 122 const string result = utils::TempFilename(original);
123 EXPECT_EQ(original.size(), result.size()); 123 EXPECT_EQ(original.size(), result.size());
124 EXPECT_TRUE(utils::StringHasPrefix(result, "/foo.")); 124 EXPECT_TRUE(utils::StringHasPrefix(result, "/foo."));
125 EXPECT_FALSE(utils::StringHasSuffix(result, "XXXXXX")); 125 EXPECT_FALSE(utils::StringHasSuffix(result, "XXXXXX"));
126 } 126 }
127 127
128 TEST(UtilsTest, RootDeviceTest) {
129 EXPECT_EQ("/dev/sda", utils::RootDevice("/dev/sda3"));
130 EXPECT_EQ("/dev/mmc0", utils::RootDevice("/dev/mmc0p3"));
131 }
132
133 TEST(UtilsTest, PartitionNumberTest) {
134 EXPECT_EQ("3", utils::PartitionNumber("/dev/sda3"));
135 EXPECT_EQ("3", utils::PartitionNumber("/dev/mmc0p3"));
136 }
137
128 } // namespace chromeos_update_engine 138 } // namespace chromeos_update_engine
OLDNEW
« no previous file with comments | « src/platform/update_engine/utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698