freertos tests: Enable test_freertos_task_delete
This commit is contained in:
parent
8de26e434c
commit
2230b2c8bc
1 changed files with 6 additions and 2 deletions
|
@ -10,13 +10,17 @@
|
||||||
static void task_delete_self(void *param)
|
static void task_delete_self(void *param)
|
||||||
{
|
{
|
||||||
printf("Task %p running on core %d. Deleting shortly...\n", xTaskGetCurrentTaskHandle(), xPortGetCoreID());
|
printf("Task %p running on core %d. Deleting shortly...\n", xTaskGetCurrentTaskHandle(), xPortGetCoreID());
|
||||||
|
vTaskDelay(5);
|
||||||
vTaskDelete(NULL);
|
vTaskDelete(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("FreeRTOS Delete Tasks", "[freertos][ignore]")
|
TEST_CASE("FreeRTOS Delete Tasks", "[freertos]")
|
||||||
{
|
{
|
||||||
|
uint32_t before_count = uxTaskGetNumberOfTasks();
|
||||||
|
|
||||||
xTaskCreatePinnedToCore(task_delete_self, "tsk_self_a", 4096, NULL, configMAX_PRIORITIES - 1, NULL, 0);
|
xTaskCreatePinnedToCore(task_delete_self, "tsk_self_a", 4096, NULL, configMAX_PRIORITIES - 1, NULL, 0);
|
||||||
xTaskCreatePinnedToCore(task_delete_self, "tsk_self_a", 4096, NULL, configMAX_PRIORITIES - 1, NULL, 0);
|
xTaskCreatePinnedToCore(task_delete_self, "tsk_self_a", 4096, NULL, configMAX_PRIORITIES - 1, NULL, 0);
|
||||||
|
TEST_ASSERT_EQUAL(before_count + 2, uxTaskGetNumberOfTasks());
|
||||||
vTaskDelay(200 / portTICK_PERIOD_MS);
|
vTaskDelay(200 / portTICK_PERIOD_MS);
|
||||||
printf("Done?\n");
|
TEST_ASSERT_EQUAL(before_count, uxTaskGetNumberOfTasks());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue