diff options
author | Elliott Hughes <enh@google.com> | 2021-06-21 13:12:52 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2021-06-21 16:50:13 -0700 |
commit | 40c8a8b1ba7f6890709526cb2463fe19f3139b31 (patch) | |
tree | fd8b48fc689e73d79cb118cba5e625038a1b7897 | |
parent | 39259a9b19d82fe0eda96d9803872fb9c38a9629 (diff) | |
download | bionic-40c8a8b1ba7f6890709526cb2463fe19f3139b31.tar.gz |
Extend <sys/sysinfo.h> tests slightly.
We know game developers (and the Games SDK) look at this stuff, so make
a bit more of an effort to ensure it's not completely broken.
Test: treehugger
Change-Id: I20b1c167faa1d9f4f39a94a723dabb848ce34269
-rw-r--r-- | tests/sys_sysinfo_test.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/sys_sysinfo_test.cpp b/tests/sys_sysinfo_test.cpp index ea35b4ea3..cca2f445d 100644 --- a/tests/sys_sysinfo_test.cpp +++ b/tests/sys_sysinfo_test.cpp @@ -42,4 +42,10 @@ TEST(sys_sysinfo, sysinfo) { struct sysinfo si; memset(&si, 0, sizeof(si)); ASSERT_EQ(0, sysinfo(&si)); + + ASSERT_GT(si.uptime, 10); // You're not running CTS within 10s of booting! + ASSERT_GT(uint64_t(si.totalram) * si.mem_unit, uint64_t(512 * 1024 * 1024)); + ASSERT_GE(si.totalram, si.freeram); + ASSERT_GE(si.totalswap, si.freeswap); + ASSERT_GT(si.procs, 2); // There's at least this test and init running! } |