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

Function test_sleep_timing

tests/system_test/tick_test.cpp:48–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48void test_sleep_timing(void*) {
49 klog::Info("=== Sleep Timing Test ===");
50
51 auto* sched_data = per_cpu::GetCurrentCore().sched_data;
52 uint64_t tick_before = sched_data->local_tick;
53
54 (void)sys_sleep(500);
55
56 uint64_t tick_after = sched_data->local_tick;
57 uint64_t delta = tick_after - tick_before;
58
59 if (delta == 0) {
60 klog::Err(
61 "test_sleep_timing: FAIL -- tick delta is 0 after 500ms sleep "
62 "(before={}, after={})",
63 tick_before, tick_after);
64 g_tests_failed++;
65 } else {
66 klog::Info("Sleep Timing Test: PASSED (before={}, after={}, delta={})",
67 tick_before, tick_after, delta);
68 }
69
70 g_tests_completed++;
71 sys_exit(0);
72}
73
74void test_runtime_tracking(void*) {
75 klog::Info("=== Runtime Tracking Test ===");

Callers

nothing calls this directly

Calls 5

InfoFunction · 0.85
GetCurrentCoreFunction · 0.85
sys_sleepFunction · 0.85
ErrFunction · 0.85
sys_exitFunction · 0.85

Tested by

no test coverage detected