lib: tests: Add test for spinlocks
authorIvan Orlov <ivan.orlov0322@gmail.com>
Tue, 23 Apr 2024 15:52:45 +0000 (16:52 +0100)
committerAnup Patel <anup@brainfault.org>
Tue, 7 May 2024 05:57:30 +0000 (11:27 +0530)
commit7b1ed968e4afc63d2ca54f6bdf1b42ef2b6576fa
tree9019ebdff137f00d68ed86187a099e62628cb24d
parent7bdf41ad1eb189820507c7699ee6a44df086ca70
lib: tests: Add test for spinlocks

Implement the test which covers some of the functions from the
`riscv_locks.h` file. This test consists of 3 test cases:

1) For lock/unlock functions
2) Unsuccessful trylock (the lock was previously taken)
3) Successful trylock (the lock is free and can be taken)

Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
lib/sbi/tests/objects.mk
lib/sbi/tests/riscv_locks_test.c [new file with mode: 0644]