feat(esp_common): Support ESP_ERROR_CHECK_ macros on Linux

Closes https://github.com/espressif/esp-idf/issues/13893
This commit is contained in:
Konstantin Kondrashov
2024-06-04 09:40:53 +03:00
parent 13e5b6f335
commit 023d112cbf
7 changed files with 40 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -108,6 +108,27 @@ TEST_CASE("heap_size_stubs", "[esp_system]")
TEST_ASSERT_EQUAL(UINT32_MAX, esp_get_minimum_free_heap_size());
}
esp_err_t esp_ok_func(void)
{
return ESP_OK;
}
esp_err_t esp_fail_func(void)
{
return ESP_FAIL;
}
TEST_CASE("ESP_ERROR_CHECK_WITHOUT_ABORT", "[esp_system]")
{
ESP_ERROR_CHECK_WITHOUT_ABORT(esp_ok_func());
ESP_ERROR_CHECK_WITHOUT_ABORT(esp_fail_func());
}
TEST_CASE("ESP_ERROR_CHECK", "[esp_system]")
{
ESP_ERROR_CHECK(esp_ok_func());
}
void app_main(void)
{
printf("Running esp_system host test app");