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/platform_test.h" |
6 #include "base/sys_info.h" | 7 #include "base/sys_info.h" |
7 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
8 | 9 |
9 TEST(SysInfoTest, NumProcs) { | 10 typedef PlatformTest SysInfoTest; |
| 11 |
| 12 TEST_F(SysInfoTest, NumProcs) { |
10 // 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. |
11 EXPECT_GE(base::SysInfo::NumberOfProcessors(), 1); | 14 EXPECT_GE(base::SysInfo::NumberOfProcessors(), 1); |
12 } | 15 } |
13 | 16 |
14 TEST(SysInfoTest, AmountOfMem) { | 17 TEST_F(SysInfoTest, AmountOfMem) { |
15 // 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. |
16 EXPECT_GT(base::SysInfo::AmountOfPhysicalMemory(), 0); | 19 EXPECT_GT(base::SysInfo::AmountOfPhysicalMemory(), 0); |
17 EXPECT_GT(base::SysInfo::AmountOfPhysicalMemoryMB(), 0); | 20 EXPECT_GT(base::SysInfo::AmountOfPhysicalMemoryMB(), 0); |
18 } | 21 } |
19 | 22 |
20 TEST(SysInfoTest, AmountOfFreeDiskSpace) { | 23 TEST_F(SysInfoTest, AmountOfFreeDiskSpace) { |
21 // 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. |
22 std::wstring tmp_path; | 25 std::wstring tmp_path; |
23 ASSERT_TRUE(file_util::GetTempDir(&tmp_path)); | 26 ASSERT_TRUE(file_util::GetTempDir(&tmp_path)); |
24 EXPECT_GT(base::SysInfo::AmountOfFreeDiskSpace(tmp_path), 0); | 27 EXPECT_GT(base::SysInfo::AmountOfFreeDiskSpace(tmp_path), 0); |
25 } | 28 } |
OLD | NEW |