|
Zephyr API Documentation 4.1.99
A Scalable Open Source RTOS
|
Functions | |
| void | test_mutex_recursive (void) |
| Test recursive mutex. | |
| void | test_mutex_priority_inheritance (void) |
| Test mutex's priority inheritance mechanism. | |
| void | test_mutex_timeout_race_during_priority_inversion (void) |
| Test fix for subtle race during priority inversion. | |
| void | test_mutex_init_null (void) |
| Test initializing mutex with a NULL pointer. | |
| void | test_mutex_init_invalid_obj (void) |
| Test initialize mutex with a invalid kernel object. | |
| void | test_mutex_lock_null (void) |
| Test locking mutex with a NULL pointer. | |
| void | test_mutex_lock_invalid_obj (void) |
| Test locking mutex with a invalid kernel object. | |
| void | test_mutex_unlock_null (void) |
| Test unlocking mutex with a NULL pointer. | |
| void | test_mutex_unlock_invalid_obj (void) |
| Test unlocking mutex with a invalid kernel object. | |
| void test_mutex_init_invalid_obj | ( | void | ) |
#include </home/runner/work/safety-doc/zephyr/tests/kernel/mutex/mutex_error_case/src/test_mutex_error.c>
Test initialize mutex with a invalid kernel object.
Pass a invalid kobject as parameter, then see if the expected error happens.
| void test_mutex_init_null | ( | void | ) |
#include </home/runner/work/safety-doc/zephyr/tests/kernel/mutex/mutex_error_case/src/test_mutex_error.c>
Test initializing mutex with a NULL pointer.
Pass a null pointer as parameter, then see if the expected error happens.
| void test_mutex_lock_invalid_obj | ( | void | ) |
#include </home/runner/work/safety-doc/zephyr/tests/kernel/mutex/mutex_error_case/src/test_mutex_error.c>
Test locking mutex with a invalid kernel object.
Pass a invalid kobject as parameter, then see if the expected error happens.
| void test_mutex_lock_null | ( | void | ) |
#include </home/runner/work/safety-doc/zephyr/tests/kernel/mutex/mutex_error_case/src/test_mutex_error.c>
Test locking mutex with a NULL pointer.
Pass a null pointer as parameter, then see if the expected error happens.
| void test_mutex_priority_inheritance | ( | void | ) |
#include </home/runner/work/safety-doc/zephyr/tests/kernel/mutex/mutex_api/src/test_mutex_apis.c>
Test mutex's priority inheritance mechanism.
To verify mutex provide priority inheritance to prevent priority inversion, and there are 3 cases need to run. The thread T1 hold the mutex first and cases list as below:
TESTPOINT: run test case 1, given priority T1 < T2
TESTPOINT: The current thread does not own the mutex.
TESTPOINT: run test case 2, given priority T1 > T2, this means priority inheritance won't happen.
TESTPOINT: run test case 3, given priority T1 < T3 < T2, but t2 do not get mutex due to timeout.
| void test_mutex_recursive | ( | void | ) |
#include </home/runner/work/safety-doc/zephyr/tests/kernel/mutex/mutex_api/src/test_mutex_apis.c>
Test recursive mutex.
To verify that getting a lock of a mutex already locked will succeed and waiters will be unblocked only when the number of locks reaches zero.
TESTPOINT: when mutex has no owner, we cannot unlock it
TESTPOINT: lock the mutex recursively
TESTPOINT: unlock the mutex recursively
TESTPOINT: waiter thread got the mutex
| void test_mutex_timeout_race_during_priority_inversion | ( | void | ) |
#include </home/runner/work/safety-doc/zephyr/tests/kernel/mutex/mutex_api/src/test_mutex_apis.c>
Test fix for subtle race during priority inversion.
| void test_mutex_unlock_invalid_obj | ( | void | ) |
#include </home/runner/work/safety-doc/zephyr/tests/kernel/mutex/mutex_error_case/src/test_mutex_error.c>
Test unlocking mutex with a invalid kernel object.
Pass a invalid kobject as parameter, then see if the expected error happens.
| void test_mutex_unlock_null | ( | void | ) |
#include </home/runner/work/safety-doc/zephyr/tests/kernel/mutex/mutex_error_case/src/test_mutex_error.c>
Test unlocking mutex with a NULL pointer.
Pass a null pointer as parameter, then see if the expected error happens.