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

Function test_basic_lock

tests/system_test/spinlock_test.cpp:24–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22};
23
24auto test_basic_lock() -> bool {
25 klog::Info("Running test_basic_lock...");
26 TestSpinLock lock("basic");
27 EXPECT_TRUE(lock.Lock(), "Basic lock failed");
28 EXPECT_TRUE(lock.IsLockedByCurrentCore(),
29 "IsLockedByCurrentCore failed after lock");
30 EXPECT_TRUE(lock.UnLock(), "Basic unlock failed");
31 EXPECT_TRUE(!lock.IsLockedByCurrentCore(),
32 "IsLockedByCurrentCore failed after unlock");
33 klog::Info("test_basic_lock passed");
34 return true;
35}
36
37auto test_recursive_lock() -> bool {
38 klog::Info("Running test_recursive_lock...");

Callers 1

spinlock_testFunction · 0.85

Calls 4

InfoFunction · 0.85
IsLockedByCurrentCoreMethod · 0.80
LockMethod · 0.45
UnLockMethod · 0.45

Tested by

no test coverage detected