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

Function test_wait_non_child

tests/system_test/stress_test.cpp:105–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103// ---------------------------------------------------------------------------
104
105void test_wait_non_child(void* /*arg*/) {
106 klog::Info("=== Stress: Wait Non-Child Test ===");
107
108 auto& tm = TaskManagerSingleton::instance();
109
110 int status = 0;
111 auto result = tm.Wait(99999, &status, false, false);
112
113 bool passed = true;
114 if (result.has_value() && result.value() > 0) {
115 klog::Err(
116 "test_wait_non_child: FAIL - Wait(99999) should fail but got pid={}",
117 result.value());
118 passed = false;
119 } else {
120 klog::Info("test_wait_non_child: Wait(99999) correctly failed");
121 }
122
123 if (passed) {
124 klog::Info("Stress: Wait Non-Child Test: PASSED");
125 } else {
126 klog::Err("Stress: Wait Non-Child Test: FAILED");
127 g_tests_failed++;
128 }
129
130 g_tests_completed++;
131 sys_exit(passed ? 0 : 1);
132}
133
134// ---------------------------------------------------------------------------
135// test_rapid_create_exit

Callers

nothing calls this directly

Calls 4

InfoFunction · 0.85
ErrFunction · 0.85
sys_exitFunction · 0.85
WaitMethod · 0.80

Tested by

no test coverage detected