1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 #include "base/sys_info.h"
8 #include "testing/gtest/include/gtest/gtest.h"
13 TEST(SysUtils
, AmountOfPhysicalMemory
) {
14 // Check that the RAM size reported by sysconf() matches the one
15 // computed by base::SysInfo::AmountOfPhysicalMemory().
17 static_cast<size_t>(sysconf(_SC_PHYS_PAGES
) * PAGE_SIZE
);
18 EXPECT_EQ(sys_ram_size
,
19 static_cast<size_t>(SysInfo::AmountOfPhysicalMemory()));
22 } // namespace android