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

Side by Side Diff: base/sys_info_unittest.cc

Issue 276012: Convert SysInfo::AmountOfFreeDiskSpace from wstring to FilePath. (Closed)
Patch Set: compile Created 11 years, 2 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 | « base/sys_info_posix.cc ('k') | base/sys_info_win.cc » ('j') | 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) 2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2008 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 "base/file_util.h" 5 #include "base/file_util.h"
6 #include "base/sys_info.h" 6 #include "base/sys_info.h"
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "testing/platform_test.h" 8 #include "testing/platform_test.h"
9 9
10 typedef PlatformTest SysInfoTest; 10 typedef PlatformTest SysInfoTest;
11 11
12 TEST_F(SysInfoTest, NumProcs) { 12 TEST_F(SysInfoTest, NumProcs) {
13 // We aren't actually testing that it's correct, just that it's sane. 13 // We aren't actually testing that it's correct, just that it's sane.
14 EXPECT_GE(base::SysInfo::NumberOfProcessors(), 1); 14 EXPECT_GE(base::SysInfo::NumberOfProcessors(), 1);
15 } 15 }
16 16
17 TEST_F(SysInfoTest, AmountOfMem) { 17 TEST_F(SysInfoTest, AmountOfMem) {
18 // We aren't actually testing that it's correct, just that it's sane. 18 // We aren't actually testing that it's correct, just that it's sane.
19 EXPECT_GT(base::SysInfo::AmountOfPhysicalMemory(), 0); 19 EXPECT_GT(base::SysInfo::AmountOfPhysicalMemory(), 0);
20 EXPECT_GT(base::SysInfo::AmountOfPhysicalMemoryMB(), 0); 20 EXPECT_GT(base::SysInfo::AmountOfPhysicalMemoryMB(), 0);
21 } 21 }
22 22
23 TEST_F(SysInfoTest, AmountOfFreeDiskSpace) { 23 TEST_F(SysInfoTest, AmountOfFreeDiskSpace) {
24 // We aren't actually testing that it's correct, just that it's sane. 24 // We aren't actually testing that it's correct, just that it's sane.
25 FilePath tmp_path; 25 FilePath tmp_path;
26 ASSERT_TRUE(file_util::GetTempDir(&tmp_path)); 26 ASSERT_TRUE(file_util::GetTempDir(&tmp_path));
27 EXPECT_GT(base::SysInfo::AmountOfFreeDiskSpace(tmp_path.ToWStringHack()), 0) 27 EXPECT_GT(base::SysInfo::AmountOfFreeDiskSpace(tmp_path), 0)
28 << tmp_path.value(); 28 << tmp_path.value();
29 } 29 }
30 30
31 TEST_F(SysInfoTest, GetEnvVar) { 31 TEST_F(SysInfoTest, GetEnvVar) {
32 // Every setup should have non-empty PATH... 32 // Every setup should have non-empty PATH...
33 EXPECT_NE(base::SysInfo::GetEnvVar(L"PATH"), L""); 33 EXPECT_NE(base::SysInfo::GetEnvVar(L"PATH"), L"");
34 } 34 }
35 35
36 TEST_F(SysInfoTest, HasEnvVar) { 36 TEST_F(SysInfoTest, HasEnvVar) {
37 // Every setup should have PATH... 37 // Every setup should have PATH...
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 base::SysInfo::ParseLsbRelease(lsb_release, 93 base::SysInfo::ParseLsbRelease(lsb_release,
94 &os_major_version, 94 &os_major_version,
95 &os_minor_version, 95 &os_minor_version,
96 &os_bugfix_version); 96 &os_bugfix_version);
97 EXPECT_EQ(os_major_version, -1); 97 EXPECT_EQ(os_major_version, -1);
98 EXPECT_EQ(os_minor_version, -1); 98 EXPECT_EQ(os_minor_version, -1);
99 EXPECT_EQ(os_bugfix_version, -1); 99 EXPECT_EQ(os_bugfix_version, -1);
100 } 100 }
101 101
102 #endif // OS_CHROMEOS 102 #endif // OS_CHROMEOS
OLDNEW
« no previous file with comments | « base/sys_info_posix.cc ('k') | base/sys_info_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698