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

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

Issue 492008: AU: Try delta updates first, then full updates (Closed)
Patch Set: use mkstemp Created 11 years 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 <vector> 9 #include <vector>
9 #include <gtest/gtest.h> 10 #include <gtest/gtest.h>
10 #include "update_engine/utils.h" 11 #include "update_engine/utils.h"
11 12
13 using std::string;
12 using std::vector; 14 using std::vector;
13 15
14 namespace chromeos_update_engine { 16 namespace chromeos_update_engine {
15 17
16 class UtilsTest : public ::testing::Test { }; 18 class UtilsTest : public ::testing::Test { };
17 19
18 TEST(UtilsTest, NormalizePathTest) { 20 TEST(UtilsTest, NormalizePathTest) {
19 EXPECT_EQ("", utils::NormalizePath("", false)); 21 EXPECT_EQ("", utils::NormalizePath("", false));
20 EXPECT_EQ("", utils::NormalizePath("", true)); 22 EXPECT_EQ("", utils::NormalizePath("", true));
21 EXPECT_EQ("/", utils::NormalizePath("/", false)); 23 EXPECT_EQ("/", utils::NormalizePath("/", false));
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 105
104 TEST(UtilsTest, TempFilenameTest) { 106 TEST(UtilsTest, TempFilenameTest) {
105 const string original = "/foo.XXXXXX"; 107 const string original = "/foo.XXXXXX";
106 const string result = utils::TempFilename(original); 108 const string result = utils::TempFilename(original);
107 EXPECT_EQ(original.size(), result.size()); 109 EXPECT_EQ(original.size(), result.size());
108 EXPECT_TRUE(utils::StringHasPrefix(result, "/foo.")); 110 EXPECT_TRUE(utils::StringHasPrefix(result, "/foo."));
109 EXPECT_FALSE(utils::StringHasSuffix(result, "XXXXXX")); 111 EXPECT_FALSE(utils::StringHasSuffix(result, "XXXXXX"));
110 } 112 }
111 113
112 } // namespace chromeos_update_engine 114 } // 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