| 103 | // --------------------------------------------------------------------------- |
| 104 | |
| 105 | void 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 |