OLD | NEW |
---|---|
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 | 8 |
9 TEST(SysInfoTest, NumProcs) { | 9 TEST(SysInfoTest, NumProcs) { |
Mark Mentovai
2008/09/29 22:20:05
I moved these to TEST_F in r2603, I've updated the
| |
10 // We aren't actually testing that it's correct, just that it's sane. | 10 // We aren't actually testing that it's correct, just that it's sane. |
11 EXPECT_GE(base::SysInfo::NumberOfProcessors(), 1); | 11 EXPECT_GE(base::SysInfo::NumberOfProcessors(), 1); |
12 } | 12 } |
13 | 13 |
14 TEST(SysInfoTest, AmountOfMem) { | 14 TEST(SysInfoTest, AmountOfMem) { |
15 // We aren't actually testing that it's correct, just that it's sane. | 15 // We aren't actually testing that it's correct, just that it's sane. |
16 EXPECT_GT(base::SysInfo::AmountOfPhysicalMemory(), 0); | 16 EXPECT_GT(base::SysInfo::AmountOfPhysicalMemory(), 0); |
17 EXPECT_GT(base::SysInfo::AmountOfPhysicalMemoryMB(), 0); | 17 EXPECT_GT(base::SysInfo::AmountOfPhysicalMemoryMB(), 0); |
18 } | 18 } |
19 | 19 |
20 TEST(SysInfoTest, AmountOfFreeDiskSpace) { | 20 TEST(SysInfoTest, AmountOfFreeDiskSpace) { |
21 // We aren't actually testing that it's correct, just that it's sane. | 21 // We aren't actually testing that it's correct, just that it's sane. |
22 std::wstring tmp_path; | 22 std::wstring tmp_path; |
23 ASSERT_TRUE(file_util::GetTempDir(&tmp_path)); | 23 ASSERT_TRUE(file_util::GetTempDir(&tmp_path)); |
24 EXPECT_GT(base::SysInfo::AmountOfFreeDiskSpace(tmp_path), 0); | 24 EXPECT_GT(base::SysInfo::AmountOfFreeDiskSpace(tmp_path), 0); |
25 } | 25 } |
26 | |
27 TEST(SysInfoTest, GetEnvironmentVariable) { | |
28 // Every setup should have non-empty PATH... | |
29 EXPECT_NE(base::SysInfo::GetEnvironmentVariable("PATH"), L""); | |
30 } | |
31 | |
32 TEST(SysInfoTest, HasEnvironmentVariable) { | |
33 // Every setup should have PATH... | |
34 EXPECT_TRUE(base::SysInfo::HasEnvironmentVariable("PATH")); | |
35 } | |
OLD | NEW |