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

Function test_tick_increments

tests/system_test/tick_test.cpp:23–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21std::atomic<int> g_tests_failed{0};
22
23void test_tick_increments(void*) {
24 klog::Info("=== Tick Increments Test ===");
25
26 auto* sched_data = per_cpu::GetCurrentCore().sched_data;
27 uint64_t tick_before = sched_data->local_tick;
28
29 (void)sys_sleep(200);
30
31 uint64_t tick_after = sched_data->local_tick;
32
33 if (tick_after <= tick_before) {
34 klog::Err(
35 "test_tick_increments: FAIL -- local_tick did not increase "
36 "(before={}, after={})",
37 tick_before, tick_after);
38 g_tests_failed++;
39 } else {
40 klog::Info("Tick Increments Test: PASSED (before={}, after={}, delta={})",
41 tick_before, tick_after, tick_after - tick_before);
42 }
43
44 g_tests_completed++;
45 sys_exit(0);
46}
47
48void test_sleep_timing(void*) {
49 klog::Info("=== Sleep Timing 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