#include "gate/tests.hpp"
#include "gate/system/os.hpp"
using namespace gate;
using namespace gate::sys;
GATEXX_TEST_UNIT(OS)
{
GATEXX_TEST_CHECK_NOTHROW(OS::getAddressSpace());
GATEXX_TEST_CHECK_NOTHROW(OS::getBootTime());
GATEXX_TEST_CHECK_NOTHROW(OS::getHostDomain());
GATEXX_TEST_CHECK_NOTHROW(OS::getHostName());
GATEXX_TEST_CHECK_NOTHROW(OS::getOSName());
GATEXX_TEST_CHECK_NOTHROW(OS::getPlatformLabel(OS::getPlatform()));
GATEXX_TEST_CHECK_NOTHROW(OS::getProductName());
GATEXX_TEST_CHECK_NOTHROW(OS::getUid());
GATEXX_TEST_CHECK_NOTHROW(OS::getUpTimeSeconds());
GATEXX_TEST_CHECK_NOTHROW(OS::getVersion());
}
GATEXX_TEST_UNIT(CpuInfo)
{
SystemCpu::ArchEnum arch = SystemCpu::Arch_Unknown;<--- Variable 'arch' is reassigned a value before the old one has been used.
GATEXX_TEST_CHECK_NOTHROW(arch = SystemCpu::getArchitecture());<--- Variable 'arch' is reassigned a value before the old one has been used.
GATEXX_TEST_CHECK(!SystemCpu::getArchitectureLabel(arch).empty());
SystemCpuInfo info;
GATEXX_TEST_CHECK_NOTHROW(info = SystemCpu::getCpuInfo());
//GATEXX_TEST_CHECK_NOTHROW(SystemCpu::getCpuFeatures());
//SystemCpuActivation affinity;
//GATEXX_TEST_CHECK_NOTHROW(affinity = SystemCpu::getProcessAffinity());
//GATEXX_TEST_CHECK_NOTHROW(SystemCpu::setProcessAffinity(affinity));
}
GATEXX_TEST_UNIT(CpuInfoLoad)
{
SystemCpuLoad load;
real32_t percent = 0.0f;
GATEXX_TEST_CHECK_NOTHROW(load.updateState(percent));
}
GATEXX_TEST_UNIT(Memory)
{
uint64_t totalBytes = 0, availableBytes = 0;
GATEXX_TEST_CHECK_NOTHROW(SystemMemory::getPhysicalLoad(totalBytes, availableBytes));
GATEXX_TEST_CHECK_NOTHROW(SystemMemory::getVirtualLoad(totalBytes, availableBytes));
}