File indexing completed on 2024-12-01 04:29:45

0001 /*
0002     SPDX-FileCopyrightText: 2022 Eric Jiang <erjiang@alumni.iu.edu>
0003     SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0004 */
0005 #include "catch.hpp"
0006 
0007 #include "utils/sysinfo.hpp"
0008 
0009 TEST_CASE("Get system memory stats", "[Utils]")
0010 {
0011     SysMemInfo memInfo = SysMemInfo::getMemoryInfo();
0012 // this is only supported on some OSes right now
0013 #if defined(Q_OS_LINUX) || defined(Q_OS_MAC) || defined(Q_OS_WIN) || defined(Q_OS_FREEBSD)
0014     qDebug() << "sysinfotest:" << memInfo.freeMemory() << "MB free of" << memInfo.totalMemory() << "MB total";
0015     CHECK(memInfo.isSuccessful());
0016     CHECK(memInfo.freeMemory() > 0);
0017     CHECK(memInfo.totalMemory() > memInfo.freeMemory());
0018 #endif
0019 }