MCPcopy Create free account
hub / github.com/Simple-XX/SimpleKernel / test_affinity_get_self

Function test_affinity_get_self

tests/system_test/affinity_test.cpp:28–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26// ===========================================================================
27
28void test_affinity_get_self(void* /*arg*/) {
29 klog::Info("=== Affinity Get Self Test ===");
30
31 bool passed = true;
32 uint64_t mask = 0;
33
34 int ret = sys_sched_getaffinity(0, sizeof(uint64_t), &mask);
35 if (ret != 0) {
36 klog::Err("test_affinity_get_self: getaffinity returned {}, expected 0",
37 ret);
38 passed = false;
39 }
40
41 if (passed && mask != UINT64_MAX) {
42 klog::Err("test_affinity_get_self: mask={:#x}, expected {:#x}", mask,
43 static_cast<uint64_t>(UINT64_MAX));
44 passed = false;
45 }
46
47 if (passed) {
48 klog::Info("Affinity Get Self Test: PASSED");
49 } else {
50 klog::Err("Affinity Get Self Test: FAILED");
51 g_tests_failed++;
52 }
53
54 g_tests_completed++;
55 sys_exit(passed ? 0 : 1);
56}
57
58// ===========================================================================
59// test_affinity_set_get

Callers

nothing calls this directly

Calls 4

InfoFunction · 0.85
sys_sched_getaffinityFunction · 0.85
ErrFunction · 0.85
sys_exitFunction · 0.85

Tested by

no test coverage detected