mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-10-14 00:37:44 -04:00
fix(freertos/tasks): Updated the xTaskGetIdleTaskHandle Test (#1314)
This commit updates the xTaskGetIdleTaskHandle unit test as per the idle task naming logic. Signed-off-by: Sudeep Mohanty <sudeep.mohanty@espressif.com> Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
This commit is contained in:
parent
dfb7b28f72
commit
f430a10431
1 changed files with 11 additions and 1 deletions
|
@ -3607,12 +3607,22 @@ void test_xTaskGetIdleTaskHandle_success( void )
|
|||
{
|
||||
TaskHandle_t ret_idle_handle;
|
||||
int ret;
|
||||
BaseType_t xIdleNameLen;
|
||||
BaseType_t xCopyLen;
|
||||
|
||||
start_scheduler();
|
||||
|
||||
/* The length of the idle task name is limited to the minimum of the length
|
||||
* of configIDLE_TASK_NAME and configMAX_TASK_NAME_LEN - 2, keeping space
|
||||
* for the core ID suffix and the null-terminator. */
|
||||
xIdleNameLen = sizeof( configIDLE_TASK_NAME ) - 1;
|
||||
xCopyLen = ( xIdleNameLen < configMAX_TASK_NAME_LEN - 2 ) ? xIdleNameLen : configMAX_TASK_NAME_LEN - 2;
|
||||
|
||||
/* Api Call */
|
||||
ret_idle_handle = xTaskGetIdleTaskHandle();
|
||||
ptcb = ret_idle_handle;
|
||||
ret = strncmp( ptcb->pcTaskName, configIDLE_TASK_NAME, configMAX_TASK_NAME_LEN - 1 );
|
||||
/* Verify the base name of the idle task. */
|
||||
ret = strncmp( ptcb->pcTaskName, configIDLE_TASK_NAME, xCopyLen );
|
||||
TEST_ASSERT_EQUAL( 0, ret );
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue