From be7859ad43c587970a17075d3272440a7196ddb8 Mon Sep 17 00:00:00 2001 From: Jakob Hasse Date: Mon, 13 Mar 2023 16:58:09 +0800 Subject: [PATCH 1/2] pthread: fixed wrong deletion of condvar in unit test --- .../pthread_unity_tests/main/test_pthread_cond_var.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/pthread/test_apps/pthread_unity_tests/main/test_pthread_cond_var.c b/components/pthread/test_apps/pthread_unity_tests/main/test_pthread_cond_var.c index 00ad4d4f3a..d281e7203c 100644 --- a/components/pthread/test_apps/pthread_unity_tests/main/test_pthread_cond_var.c +++ b/components/pthread/test_apps/pthread_unity_tests/main/test_pthread_cond_var.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Unlicense OR CC0-1.0 */ @@ -115,6 +115,6 @@ TEST_CASE("pthread cond wait", "[pthread]") TEST_ASSERT_EQUAL_INT(0, r); } - pthread_mutex_destroy(&cond); - pthread_mutex_destroy(&mutex); + TEST_ASSERT_EQUAL_INT(ESP_OK, pthread_cond_destroy(&cond)); + TEST_ASSERT_EQUAL_INT(ESP_OK, pthread_mutex_destroy(&mutex)); } From 8e2e61ad833e8250d3de57c0dc5975e4e60d0533 Mon Sep 17 00:00:00 2001 From: Jakob Hasse Date: Mon, 13 Mar 2023 17:02:04 +0800 Subject: [PATCH 2/2] pthread: unit test builds only necessary components --- components/pthread/test_apps/pthread_unity_tests/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/components/pthread/test_apps/pthread_unity_tests/CMakeLists.txt b/components/pthread/test_apps/pthread_unity_tests/CMakeLists.txt index 510842cb6b..479850e764 100644 --- a/components/pthread/test_apps/pthread_unity_tests/CMakeLists.txt +++ b/components/pthread/test_apps/pthread_unity_tests/CMakeLists.txt @@ -5,4 +5,5 @@ cmake_minimum_required(VERSION 3.16) set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/unit-test-app/components") include($ENV{IDF_PATH}/tools/cmake/project.cmake) +set(COMPONENTS main) project(test_pthread)