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

Function test_lock_guard

tests/system_test/spinlock_test.cpp:59–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59auto test_lock_guard() -> bool {
60 klog::Info("Running test_lock_guard...");
61 TestSpinLock lock("guard");
62 {
63 LockGuard<TestSpinLock> guard(lock);
64 EXPECT_TRUE(lock.IsLockedByCurrentCore(), "LockGuard failed to lock");
65 }
66 EXPECT_TRUE(!lock.IsLockedByCurrentCore(), "LockGuard failed to unlock");
67 klog::Info("test_lock_guard passed");
68 return true;
69}
70
71auto test_interrupt_restore() -> bool {
72 klog::Info("Running test_interrupt_restore...");

Callers 1

spinlock_testFunction · 0.85

Calls 2

InfoFunction · 0.85
IsLockedByCurrentCoreMethod · 0.80

Tested by

no test coverage detected