Semaphore Functions Test Cases.
More...
The test cases check the osSemaphore* functions.
◆ TC_osSemaphoreAcquire_1()
void TC_osSemaphoreAcquire_1 |
( |
void |
| ) |
|
- Call osSemaphoreAcquire to acquire binary semaphore
- Call osSemaphoreAcquire to acquire counting semaphore
- Call osSemaphoreAcquire from ISR (non-zero timeout)
- Call osSemaphoreAcquire with null semaphore object
◆ TC_osSemaphoreDelete_1()
void TC_osSemaphoreDelete_1 |
( |
void |
| ) |
|
- Call osSemaphoreDelete to delete a semaphore
- Call osSemaphoreDelete from ISR
- Call osSemaphoreDelete with null object
◆ TC_osSemaphoreGetCount_1()
void TC_osSemaphoreGetCount_1 |
( |
void |
| ) |
|
- Call osSemaphoreGetCount to get token count of an initialized semaphore
- Call osSemaphoreGetCount to get token count of an acquired semaphore
- Call osSemaphoreGetCount from ISR
- Call osSemaphoreGetCount with a null object id
◆ TC_osSemaphoreGetName_1()
void TC_osSemaphoreGetName_1 |
( |
void |
| ) |
|
- Call osSemaphoreGetName to retrieve a name of an unnamed semaphore
- Call osSemaphoreGetName to retrieve a name of a semaphore with assigned name
- Call osSemaphoreGetName from ISR
- Call osSemaphoreGetName with null object
◆ TC_osSemaphoreNew_1()
void TC_osSemaphoreNew_1 |
( |
void |
| ) |
|
- Call osSemaphoreNew to create a binary semaphore object with initial token cleared
- Call osSemaphoreNew to create a binary semaphore object with initial token set
- Call osSemaphoreNew to create a counting semaphore object with initial token count cleared
- Call osSemaphoreNew to create a counting semaphore object with initial token count set to max count={UINT8_MAX, UINT16_MAX, UINT32_MAX}
- Call osSemaphoreNew from ISR
◆ TC_osSemaphoreNew_2()
void TC_osSemaphoreNew_2 |
( |
void |
| ) |
|
- Call osSemaphoreNew to create semaphore object and assign a name to it
◆ TC_osSemaphoreNew_3()
void TC_osSemaphoreNew_3 |
( |
void |
| ) |
|
- Call osSemaphoreNew to create semaphore object by specifying memory for control block in attributes
◆ TC_osSemaphoreRelease_1()
void TC_osSemaphoreRelease_1 |
( |
void |
| ) |
|
- Call osSemaphoreRelease to release acquired binary semaphore
- Call osSemaphoreRelease to release acquired counting semaphore
- Call osSemaphoreRelease to release binary semaphore that was not acquired
- Call osSemaphoreRelease to release counting semaphore that was not acquired
- Call osSemaphoreRelease from ISR
- Call osSemaphoreRelease with null semaphore object
◆ TC_SemaphoreAllocation()
void TC_SemaphoreAllocation |
( |
void |
| ) |
|
- Test semaphore object allocation
◆ TC_SemaphoreCheckTimeout()
void TC_SemaphoreCheckTimeout |
( |
void |
| ) |
|
- Set time thresholds
- Create wakeup thread to release a semaphore after 10 ticks
- Wait for a semaphore with a defined timeout
- Check if the semaphore is acquired between the minimum and maximum thresholds
- Wait for a semaphore with an infinite timeout
- Check if the semaphore is acquired between the minimum and maximum thresholds
◆ TC_SemaphoreCreateAndDelete()
void TC_SemaphoreCreateAndDelete |
( |
void |
| ) |
|
- Create a semaphore with initial count parameter equal to zero
- Delete created semaphore object
- Create a semaphore with initial count parameter equal to MAX_SEMAPHORE_TOKEN_CNT
- Delete created semaphore object
◆ TC_SemaphoreObtainBinary()
void TC_SemaphoreObtainBinary |
( |
void |
| ) |
|
- Create a binary semaphore object
- Obtain available token
- Verify that there is no available tokens left
- Release obtained token
- Verify that no more tokens can be released
- Delete a binary semaphore object
◆ TC_SemaphoreObtainCounting()
void TC_SemaphoreObtainCounting |
( |
void |
| ) |
|
- Create a counting semaphore object
- Obtain all available tokens
- Verify that all available tokens are obtained
- Release all tokens
- Delete a counting semaphore object
◆ TC_SemaphoreWaitForBinary()
void TC_SemaphoreWaitForBinary |
( |
void |
| ) |
|
- Create a binary semaphore
- Create multiple instances of a test thread that obtains semaphore
- Wait until thread instances finish
- Check if semaphore was acquired
- Check if only one thread got semaphore object
- Release and delete a semaphore
- Only one thread instance must acquire semaphore object
◆ TC_SemaphoreWaitForCounting()
void TC_SemaphoreWaitForCounting |
( |
void |
| ) |
|
- Create semaphore with index count parameter equal to 3
- Create multiple instances of a test thread that acquires semaphore
- Wait until thread instances finish
- Check if only available resources were acquired
- Release and delete a semaphore object
- Only one thread instance must acquire semaphore object
◆ TC_SemaphoreWaitTimeout()
void TC_SemaphoreWaitTimeout |
( |
void |
| ) |
|
- Obtain a semaphore object
- Create a thread that waits for a semaphore
- Delay parent thread to allow child thread wait for semaphore
- Check if child thread was able to obtain a semaphore or not
◆ TC_SemaphoreZeroCount()
void TC_SemaphoreZeroCount |
( |
void |
| ) |
|
- Create a semaphore with initial count zero
- Try to obtain a semaphore token
- Try to release a semaphore token
- Delete a semaphore object