test(pthread): fixed memory leak in QEMU tests

This commit is contained in:
Marius Vikhammer 2024-07-11 10:22:41 +08:00
parent 7696f0f9b2
commit f23f425d96
2 changed files with 8 additions and 0 deletions

View File

@ -5,6 +5,8 @@
*/
#include <pthread.h>
#include "unity.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
typedef struct {
pthread_cond_t *cond;
@ -117,4 +119,7 @@ TEST_CASE("pthread cond wait", "[pthread]")
TEST_ASSERT_EQUAL_INT(ESP_OK, pthread_cond_destroy(&cond));
TEST_ASSERT_EQUAL_INT(ESP_OK, pthread_mutex_destroy(&mutex));
// Wait a few ticks to allow freertos idle task to free up memory
vTaskDelay(10);
}

View File

@ -179,6 +179,9 @@ TEST_CASE("wrlock reader waits", "[pthread][rwlock]")
TEST_ASSERT_EQUAL_INT(pthread_rwlock_destroy(&rwlock), 0);
vQueueDelete(wait_queue);
// Wait a few ticks to allow freertos idle task to free up memory
vTaskDelay(10);
}
TEST_CASE("wrlock multiple readers wait", "[pthread][rwlock]")