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>
pull/1318/head
Sudeep Mohanty 1 month ago committed by GitHub
parent dfb7b28f72
commit f430a10431
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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…
Cancel
Save