CMSIS-RTOS2 Validation  Version 0.9.0-dev77
Validates RTOS2 API Implementation
Thread Functions

Thread Functions Test Cases. More...

Functions

void TC_osThreadNew_1 (void)
 Test case: TC_osThreadNew_1. More...
 
void TC_osThreadNew_2 (void)
 Test case: TC_osThreadNew_2. More...
 
void TC_osThreadNew_3 (void)
 Test case: TC_osThreadNew_3. More...
 
void TC_osThreadNew_4 (void)
 Test case: TC_osThreadNew_4. More...
 
void TC_osThreadNew_5 (void)
 Test case: TC_osThreadNew_5. More...
 
void TC_osThreadNew_6 (void)
 Test case: TC_osThreadNew_6. More...
 
void TC_osThreadNew_7 (void)
 Test case: TC_osThreadNew_7. More...
 
void TC_osThreadGetName_1 (void)
 Test case: TC_osThreadGetName_1. More...
 
void TC_osThreadGetId_1 (void)
 Test case: TC_osThreadGetId_1. More...
 
void TC_osThreadGetState_1 (void)
 Test case: TC_osThreadGetState_1. More...
 
void TC_osThreadGetState_2 (void)
 Test case: TC_osThreadGetState_2. More...
 
void TC_osThreadGetState_3 (void)
 Test case: TC_osThreadGetState_3. More...
 
void TC_osThreadSetPriority_1 (void)
 Test case: TC_osThreadSetPriority_1. More...
 
void TC_osThreadSetPriority_2 (void)
 Test case: TC_osThreadSetPriority_2. More...
 
void TC_osThreadGetPriority_1 (void)
 Test case: TC_osThreadGetPriority_1. More...
 
void TC_osThreadYield_1 (void)
 Test case: TC_osThreadYield_1. More...
 
void TC_osThreadSuspend_1 (void)
 Test case: TC_osThreadSuspend_1. More...
 
void TC_osThreadResume_1 (void)
 Test case: TC_osThreadResume_1. More...
 
void TC_osThreadResume_2 (void)
 Test case: TC_osThreadResume_2. More...
 
void TC_osThreadDetach_1 (void)
 TC_osThreadDetach_1. More...
 
void TC_osThreadDetach_2 (void)
 Test case: TC_osThreadDetach_2. More...
 
void TC_osThreadJoin_1 (void)
 Test case: TC_osThreadJoin_1. More...
 
void TC_osThreadJoin_2 (void)
 Test case: TC_osThreadJoin_2. More...
 
void TC_osThreadJoin_3 (void)
 Test case: TC_osThreadJoin_3. More...
 
void TC_osThreadExit_1 (void)
 Test case: TC_osThreadExit_1. More...
 
void TC_osThreadTerminate_1 (void)
 Test case: TC_osThreadTerminate_1. More...
 
void TC_osThreadGetStackSize_1 (void)
 Test case: TC_osThreadGetStackSize_1. More...
 
void TC_osThreadGetStackSpace_1 (void)
 Test case: TC_osThreadGetStackSpace_1. More...
 
void TC_osThreadGetCount_1 (void)
 Test case: TC_osThreadGetCount_1. More...
 
void TC_osThreadEnumerate_1 (void)
 Test case: TC_osThreadEnumerate_1. More...
 
void TC_ThreadNew (void)
 Test case: TC_ThreadNew. More...
 
void TC_ThreadMultiInstance (void)
 Test case: TC_ThreadMultiInstance. More...
 
void TC_ThreadTerminate (void)
 Test case: TC_ThreadTerminate. More...
 
void TC_ThreadRestart (void)
 Test case: TC_ThreadRestart. More...
 
void TC_ThreadPriorityExec (void)
 Test case: TC_ThreadPriorityExec. More...
 
void TC_ThreadYield (void)
 Test case: TC_ThreadYield. More...
 
void TC_ThreadSuspendResume (void)
 Test case: TC_ThreadSuspendResume. More...
 
void TC_ThreadReturn (void)
 Test case: TC_ThreadReturn. More...
 
void TC_ThreadAllocation (void)
 Test case: TC_ThreadAllocation. More...
 

Description

The test cases check the osThread* functions.

Function Documentation

◆ TC_osThreadDetach_1()

void TC_osThreadDetach_1 ( void  )
  • Call osThreadDetach
  • Call osThreadJoin
  • Create a joinable thread and terminate it
  • Verify that thread was terminated
  • Call osThreadDetach with terminated object and verify that thread was invalidated

◆ TC_osThreadDetach_2()

void TC_osThreadDetach_2 ( void  )
  • Call osThreadDetach with a detached thread
  • Call osThreadDetach from ISR
  • Call osThreadDetach with null object

◆ TC_osThreadEnumerate_1()

void TC_osThreadEnumerate_1 ( void  )
  • Call osThreadEnumerate to retrieve IDs of all active threads
  • Call osThreadEnumerate from ISR

◆ TC_osThreadExit_1()

void TC_osThreadExit_1 ( void  )
  • Call osThreadExit to terminate the running thread

◆ TC_osThreadGetCount_1()

void TC_osThreadGetCount_1 ( void  )
  • Call osThreadGetCount to retrieve the number of active threads
  • Call osThreadGetCount from ISR

◆ TC_osThreadGetId_1()

void TC_osThreadGetId_1 ( void  )
  • Call osThreadGetId from multiple threads that exist at the same time
  • Call osThreadGetId from ISR

◆ TC_osThreadGetName_1()

void TC_osThreadGetName_1 ( void  )
  • Call osThreadGetName to retrieve a name of an unnamed thread
  • Call osThreadGetName to retrieve a name of a thread with assigned name
  • Call osThreadGetName from ISR
  • Call osThreadGetName with null object

◆ TC_osThreadGetPriority_1()

void TC_osThreadGetPriority_1 ( void  )
  • Call osThreadGetPriority to retrieve priority of a running thread
  • Call osThreadGetPriority from ISR
  • Call osThreadGetPriority with null object

◆ TC_osThreadGetStackSize_1()

void TC_osThreadGetStackSize_1 ( void  )
  • Call osThreadGetStackSize to retrieve the stack size of a running thread
  • Call osThreadGetStackSize to retrieve the stack size of a 'Ready' thread
  • Call osThreadGetStackSize from ISR
  • Call osThreadGetStackSize with null object id

◆ TC_osThreadGetStackSpace_1()

void TC_osThreadGetStackSpace_1 ( void  )
  • Call osThreadGetStackSpace to retrieve the unused stack space of a running thread
  • Call osThreadGetStackSpace to retrieve the unused stack space of a ready thread
  • Call osThreadGetStackSpace from ISR
  • Call osThreadGetStackSpace with null object

◆ TC_osThreadGetState_1()

void TC_osThreadGetState_1 ( void  )
  • Call osThreadGetState to retrieve the state of a running thread
  • Call osThreadGetState to retrieve the state of a ready thread
  • Call osThreadGetState from ISR
  • Call osThreadGetState to retrieve the state of a terminated thread
  • Call osThreadGetState with null object

◆ TC_osThreadGetState_2()

void TC_osThreadGetState_2 ( void  )
  • Call osThreadGetState to retrieve the state of a blocked thread

◆ TC_osThreadGetState_3()

void TC_osThreadGetState_3 ( void  )
  • Call osThreadGetState to retrieve the state of a terminated joinable thread

◆ TC_osThreadJoin_1()

void TC_osThreadJoin_1 ( void  )
  • Create a low priority joinable thread that terminates itself
  • Call osThreadJoin with the id of the created thread
  • Check that the created thread has terminated
  • Create four threads that are waiting to join each other in a chain
  • Check that all child threads were created and executed

◆ TC_osThreadJoin_2()

void TC_osThreadJoin_2 ( void  )
  • Call osThreadJoin with null object
  • Call osThreadJoin with a running thread
  • Call osThreadJoin with wrong object id
  • Call osThreadJoin from ISR
  • Call osThreadJoin with a joinable running thread
  • Call osThreadJoin with a joinable terminated thread

◆ TC_osThreadJoin_3()

void TC_osThreadJoin_3 ( void  )
  • Call osThreadJoin with a detached ready thread
  • Call osThreadJoin with a detached terminated thread (inactive object)

◆ TC_osThreadNew_1()

void TC_osThreadNew_1 ( void  )
  • Call osThreadNew to create a thread
  • Call osThreadNew with null thread function
  • Call osThreadNew from ISR

◆ TC_osThreadNew_2()

void TC_osThreadNew_2 ( void  )
  • Call osThreadNew and use attributes to create detached thread

◆ TC_osThreadNew_3()

void TC_osThreadNew_3 ( void  )
  • Call osThreadNew and use attributes to create joinable thread

◆ TC_osThreadNew_4()

void TC_osThreadNew_4 ( void  )
  • Call osThreadNew and use attributes to create thread with user specified memory for control block and stack

◆ TC_osThreadNew_5()

void TC_osThreadNew_5 ( void  )
  • Call osThreadNew and use attributes to create thread with user specified stack size

◆ TC_osThreadNew_6()

void TC_osThreadNew_6 ( void  )
  • Call osThreadNew and use attributes to create thread with user specified priority

◆ TC_osThreadNew_7()

void TC_osThreadNew_7 ( void  )
  • Call osThreadNew to create a thread and pass an argument to it

◆ TC_osThreadResume_1()

void TC_osThreadResume_1 ( void  )
  • Call osThreadResume to resume suspended thread
  • Call osThreadResume from ISR
  • Call osThreadResume with null object

◆ TC_osThreadResume_2()

void TC_osThreadResume_2 ( void  )
  • Call osThreadResume to resume delayed thread
  • Call osThreadResume to resume a thread that waits for mutex
  • Call osThreadResume to resume a thread that waits for semaphore
  • Call osThreadResume to resume a thread that waits for event flags
  • Call osThreadResume to resume a thread that waits for message queue
  • Call osThreadResume to resume a thread that waits for memory pool

◆ TC_osThreadSetPriority_1()

void TC_osThreadSetPriority_1 ( void  )
  • Call osThreadSetPriority to change priority of a running thread in steps from Low to Realtime
  • Call osThreadSetPriority to change priority of a child thread in steps from Low to Realtime

◆ TC_osThreadSetPriority_2()

void TC_osThreadSetPriority_2 ( void  )
  • Call osThreadSetPriority with priority lower than osPriorityIdle
  • Call osThreadSetPriority with priority higher than osPriorityISR
  • Call osThreadSetPriority from ISR
  • Call osThreadSetPriority with null object

◆ TC_osThreadSuspend_1()

void TC_osThreadSuspend_1 ( void  )
  • Call osThreadSuspend to suspend a thread when there is at least one other thread 'Ready'
  • Call osThreadSuspend to suspend a child thread which is in 'Ready' state
  • Call osThreadSuspend from ISR
  • Call osThreadSuspend with null object

◆ TC_osThreadTerminate_1()

void TC_osThreadTerminate_1 ( void  )
  • Call osThreadTerminate to terminate thread in state 'Ready'
  • Call osThreadTerminate to terminate thread in state 'Blocked' (delayed)
  • Call osThreadTerminate from ISR

◆ TC_osThreadYield_1()

void TC_osThreadYield_1 ( void  )
  • Call osThreadYield with no thread in state 'Ready'
  • Call osThreadYield from ISR

◆ TC_ThreadAllocation()

void TC_ThreadAllocation ( void  )
  • Test thread object allocation

◆ TC_ThreadMultiInstance()

void TC_ThreadMultiInstance ( void  )
  • Synchronise on time slice
  • Create all defined instances of a thread
  • Verify each instance id
  • Wait until all instances executed
  • Verify execution variable

◆ TC_ThreadNew()

void TC_ThreadNew ( void  )
  • Create threads with different priorities and pass NULL argument to them
  • Create threads with different priorities and pass valid argument to them

◆ TC_ThreadPriorityExec()

void TC_ThreadPriorityExec ( void  )
  • Raise main thread priority to osPriorityRealtime
  • Create multiple instances of the test thread
  • Set instance priorities from low to realtime
  • Lower main thread priority to allow execution of test threads
  • Check if threads were executed according to their priorities

◆ TC_ThreadRestart()

void TC_ThreadRestart ( void  )
  • Create a counting thread and verify that it runs
  • Terminate counting thread
  • Recreate a counting thread and verify that is runs again

◆ TC_ThreadReturn()

void TC_ThreadReturn ( void  )
  • Test thread return

◆ TC_ThreadSuspendResume()

void TC_ThreadSuspendResume ( void  )
  • Test thread suspend and resume

◆ TC_ThreadTerminate()

void TC_ThreadTerminate ( void  )
  • Initialize global counter variable to zero
  • Create and run a test thread which increments a global counter
  • Terminate test thread and remember counter value
  • Wait and verify that thread is terminated by checking global counter
  • Restart a thread and repeat the procedure
  • Counter must not increment after test thread is terminated

◆ TC_ThreadYield()

void TC_ThreadYield ( void  )
  • Raise priority of the main thread
  • Create child thread instances with normal priority
  • Lower priority of the main thread to allow child threads to run
  • When child threads terminate, check counter values
  • Restore priority of the main thread