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

Side by Side Diff: base/sys_info_unittest.cc

Issue 8381022: check the return value of base::SysInfo::MaxSharedMemorySize(). (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix signedness error Created 9 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 | « no previous file | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #if defined(OS_POSIX) && !defined(OS_MACOSX)
13 TEST_F(SysInfoTest, MaxSharedMemorySize) {
14 // We aren't actually testing that it's correct, just that it's sane.
15 EXPECT_GT(base::SysInfo::MaxSharedMemorySize(), 0u);
16 }
17 #endif
18
12 TEST_F(SysInfoTest, NumProcs) { 19 TEST_F(SysInfoTest, NumProcs) {
13 // We aren't actually testing that it's correct, just that it's sane. 20 // We aren't actually testing that it's correct, just that it's sane.
14 EXPECT_GE(base::SysInfo::NumberOfProcessors(), 1); 21 EXPECT_GE(base::SysInfo::NumberOfProcessors(), 1);
15 } 22 }
16 23
17 TEST_F(SysInfoTest, AmountOfMem) { 24 TEST_F(SysInfoTest, AmountOfMem) {
18 // We aren't actually testing that it's correct, just that it's sane. 25 // We aren't actually testing that it's correct, just that it's sane.
19 EXPECT_GT(base::SysInfo::AmountOfPhysicalMemory(), 0); 26 EXPECT_GT(base::SysInfo::AmountOfPhysicalMemory(), 0);
20 EXPECT_GT(base::SysInfo::AmountOfPhysicalMemoryMB(), 0); 27 EXPECT_GT(base::SysInfo::AmountOfPhysicalMemoryMB(), 0);
21 } 28 }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 base::SysInfo::ParseLsbRelease(lsb_release, 90 base::SysInfo::ParseLsbRelease(lsb_release,
84 &os_major_version, 91 &os_major_version,
85 &os_minor_version, 92 &os_minor_version,
86 &os_bugfix_version); 93 &os_bugfix_version);
87 EXPECT_EQ(-1, os_major_version); 94 EXPECT_EQ(-1, os_major_version);
88 EXPECT_EQ(-1, os_minor_version); 95 EXPECT_EQ(-1, os_minor_version);
89 EXPECT_EQ(-1, os_bugfix_version); 96 EXPECT_EQ(-1, os_bugfix_version);
90 } 97 }
91 98
92 #endif // OS_CHROMEOS 99 #endif // OS_CHROMEOS
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698