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 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 13 matching lines...) Expand all Loading... |
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) { | 32 TEST(UtilsTest, IsNormalBootMode) { |
33 // Pretty lame test... | 33 // Pretty lame test... |
34 EXPECT_FALSE(utils::IsNormalBootMode()); | 34 EXPECT_TRUE(utils::IsNormalBootMode()); |
35 } | 35 } |
36 | 36 |
37 TEST(UtilsTest, NormalizePathTest) { | 37 TEST(UtilsTest, NormalizePathTest) { |
38 EXPECT_EQ("", utils::NormalizePath("", false)); | 38 EXPECT_EQ("", utils::NormalizePath("", false)); |
39 EXPECT_EQ("", utils::NormalizePath("", true)); | 39 EXPECT_EQ("", utils::NormalizePath("", true)); |
40 EXPECT_EQ("/", utils::NormalizePath("/", false)); | 40 EXPECT_EQ("/", utils::NormalizePath("/", false)); |
41 EXPECT_EQ("", utils::NormalizePath("/", true)); | 41 EXPECT_EQ("", utils::NormalizePath("/", true)); |
42 EXPECT_EQ("/", utils::NormalizePath("//", false)); | 42 EXPECT_EQ("/", utils::NormalizePath("//", false)); |
43 EXPECT_EQ("", utils::NormalizePath("//", true)); | 43 EXPECT_EQ("", utils::NormalizePath("//", true)); |
44 EXPECT_EQ("foo", utils::NormalizePath("foo", false)); | 44 EXPECT_EQ("foo", utils::NormalizePath("foo", false)); |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 // Not much to test. At least this tests for memory leaks, crashes, | 272 // Not much to test. At least this tests for memory leaks, crashes, |
273 // log errors. | 273 // log errors. |
274 GMainLoop* loop = g_main_loop_new(g_main_context_default(), FALSE); | 274 GMainLoop* loop = g_main_loop_new(g_main_context_default(), FALSE); |
275 utils::ScheduleCrashReporterUpload(); | 275 utils::ScheduleCrashReporterUpload(); |
276 g_timeout_add_seconds(1, &TerminateScheduleCrashReporterUploadTest, loop); | 276 g_timeout_add_seconds(1, &TerminateScheduleCrashReporterUploadTest, loop); |
277 g_main_loop_run(loop); | 277 g_main_loop_run(loop); |
278 g_main_loop_unref(loop); | 278 g_main_loop_unref(loop); |
279 } | 279 } |
280 | 280 |
281 } // namespace chromeos_update_engine | 281 } // namespace chromeos_update_engine |
OLD | NEW |