Mutex Functions Test Cases.
More...
The test cases check the osMutex* functions.
◆ TC_MutexAllocation()
void TC_MutexAllocation |
( |
void |
| ) |
|
- Test mutex object allocation
◆ TC_MutexCheckTimeout()
void TC_MutexCheckTimeout |
( |
void |
| ) |
|
- Set time thresholds
- Create wakeup thread to acquire and release a mutex after 10 ticks
- Wait for a mutex with a defined timeout
- Check if the mutex is acquired between the minimum and maximum thresholds
- Wait for a mutex with an infinite timeout
- Check if the mutex is acquired between the minimum and maximum thresholds
◆ TC_MutexNestedAcquire()
void TC_MutexNestedAcquire |
( |
void |
| ) |
|
- Create a mutex object
- Obtain a mutex object
- Create a high priority thread that waits for the same mutex
- Recursively acquire and release a mutex object
- Release a mutex
- Verify that every subsequent call released the mutex
- Delete a mutex object
- Mutex object must be released after each acquisition
◆ TC_MutexOwnership()
void TC_MutexOwnership |
( |
void |
| ) |
|
- Create a mutex object
- Create a child thread and wait until acquires mutex
- Create a child thread that tries to release a mutex
- Only thread that obtains a mutex can release it.
◆ TC_MutexPrioInherit()
void TC_MutexPrioInherit |
( |
void |
| ) |
|
- Test mutex prio inherit attribute
◆ TC_MutexPriorityInversion()
void TC_MutexPriorityInversion |
( |
void |
| ) |
|
- Set priority of the control thread to normal
- Create low priority thread, which will acquire mutex
- Wait until low priority thread acquires mutex
- Raise priority of the control thread
- Create high priority thread, which will wait for a mutex
- Allow high priority job to wait for mutex
- Create medium priority thread
- Set priority of the control thread to be the lowest of all
- Wait until all jobs finish
- Verify thread execution order
- Thread execution order must be: Low, High, Medium
◆ TC_MutexRobust()
void TC_MutexRobust |
( |
void |
| ) |
|
- Test mutex robust attribute
◆ TC_osMutexAcquire_1()
void TC_osMutexAcquire_1 |
( |
void |
| ) |
|
- Call osMutexAcquire to acquire the mutex from the running thread
- Call osMutexAcquire from ISR
- Call osMutexAcquire with null mutex object
◆ TC_osMutexAcquire_2()
void TC_osMutexAcquire_2 |
( |
void |
| ) |
|
- Call osMutexAcquire without timeout and try to acquire already owned mutex
- Call osMutexAcquire with timeout and wait to acquire already owned mutex
◆ TC_osMutexDelete_1()
void TC_osMutexDelete_1 |
( |
void |
| ) |
|
- Call osMutexDelete to delete a mutex
- Call osMutexDelete from ISR
- Call osMutexDelete with null object
◆ TC_osMutexGetName_1()
void TC_osMutexGetName_1 |
( |
void |
| ) |
|
- Call osMutexGetName to retrieve a name of an unnamed mutex
- Call osMutexGetName to retrieve a name of a mutex with assigned name
- Call osMutexGetName from ISR
- Call osMutexGetName with null object
◆ TC_osMutexGetOwner_1()
void TC_osMutexGetOwner_1 |
( |
void |
| ) |
|
- Call osMutexGetOwner when the mutex is not locked
- Call osMutexGetOwner when the mutex is locked
- Call osMutexGetOwner from ISR
- Call osMutexGetOwner with null object
◆ TC_osMutexNew_1()
void TC_osMutexNew_1 |
( |
void |
| ) |
|
- Call osMutexNew to create a mutex object
- Call osMutexNew from ISR
◆ TC_osMutexNew_2()
void TC_osMutexNew_2 |
( |
void |
| ) |
|
- Call osMutexNew to create a recursive mutex object
◆ TC_osMutexNew_3()
void TC_osMutexNew_3 |
( |
void |
| ) |
|
- Call osMutexNew to create a mutex object that uses priority inheritance protocol
◆ TC_osMutexNew_4()
void TC_osMutexNew_4 |
( |
void |
| ) |
|
- Call osMutexNew to create a robust mutex object
◆ TC_osMutexNew_5()
void TC_osMutexNew_5 |
( |
void |
| ) |
|
- Call osMutexNew to create mutex object and assign a name to it
◆ TC_osMutexNew_6()
void TC_osMutexNew_6 |
( |
void |
| ) |
|
- Call osMutexNew to create mutex object by specifying memory for control block in attributes
◆ TC_osMutexRelease_1()
void TC_osMutexRelease_1 |
( |
void |
| ) |
|
- Call osMutexRelease to release acquired mutex
- Call osMutexRelease to release mutex that was not acquired
- Call osMutexRelease from ISR
- Call osMutexRelease with null mutex object