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

Side by Side Diff: utils_unittest.cc

Issue 6098008: AU: Include a bit flag (bit 31) in error codes to indicate non-normal boot mode. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git@master
Patch Set: Created 9 years, 11 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
« utils.cc ('K') | « 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 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 11 matching lines...) Expand all
22 22
23 namespace chromeos_update_engine { 23 namespace chromeos_update_engine {
24 24
25 class UtilsTest : public ::testing::Test { }; 25 class UtilsTest : public ::testing::Test { };
26 26
27 TEST(UtilsTest, IsOfficialBuild) { 27 TEST(UtilsTest, IsOfficialBuild) {
28 // Pretty lame test... 28 // Pretty lame test...
29 EXPECT_TRUE(utils::IsOfficialBuild()); 29 EXPECT_TRUE(utils::IsOfficialBuild());
30 } 30 }
31 31
32 TEST(UtilsTest, IsNormalBootMode) {
33 // Pretty lame test...
34 EXPECT_FALSE(utils::IsNormalBootMode());
35 }
36
32 TEST(UtilsTest, NormalizePathTest) { 37 TEST(UtilsTest, NormalizePathTest) {
33 EXPECT_EQ("", utils::NormalizePath("", false)); 38 EXPECT_EQ("", utils::NormalizePath("", false));
34 EXPECT_EQ("", utils::NormalizePath("", true)); 39 EXPECT_EQ("", utils::NormalizePath("", true));
35 EXPECT_EQ("/", utils::NormalizePath("/", false)); 40 EXPECT_EQ("/", utils::NormalizePath("/", false));
36 EXPECT_EQ("", utils::NormalizePath("/", true)); 41 EXPECT_EQ("", utils::NormalizePath("/", true));
37 EXPECT_EQ("/", utils::NormalizePath("//", false)); 42 EXPECT_EQ("/", utils::NormalizePath("//", false));
38 EXPECT_EQ("", utils::NormalizePath("//", true)); 43 EXPECT_EQ("", utils::NormalizePath("//", true));
39 EXPECT_EQ("foo", utils::NormalizePath("foo", false)); 44 EXPECT_EQ("foo", utils::NormalizePath("foo", false));
40 EXPECT_EQ("foo", utils::NormalizePath("foo", true)); 45 EXPECT_EQ("foo", utils::NormalizePath("foo", true));
41 EXPECT_EQ("/foo/", utils::NormalizePath("/foo//", false)); 46 EXPECT_EQ("/foo/", utils::NormalizePath("/foo//", false));
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 img.c_str()))); 254 img.c_str())));
250 EXPECT_EQ(20 * 1024 * 1024, utils::FileSize(img)); 255 EXPECT_EQ(20 * 1024 * 1024, utils::FileSize(img));
251 int block_count = 0; 256 int block_count = 0;
252 int block_size = 0; 257 int block_size = 0;
253 EXPECT_TRUE(utils::GetFilesystemSize(img, &block_count, &block_size)); 258 EXPECT_TRUE(utils::GetFilesystemSize(img, &block_count, &block_size));
254 EXPECT_EQ(4096, block_size); 259 EXPECT_EQ(4096, block_size);
255 EXPECT_EQ(10 * 1024 * 1024 / 4096, block_count); 260 EXPECT_EQ(10 * 1024 * 1024 / 4096, block_count);
256 } 261 }
257 262
258 } // namespace chromeos_update_engine 263 } // namespace chromeos_update_engine
OLDNEW
« utils.cc ('K') | « utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698