]> granicus.if.org Git - esp-idf/blob - components/nvs_flash/test_nvs_host/esp_error_check_stub.cpp
ESP_ERROR_CHECK converts error code to text
[esp-idf] / components / nvs_flash / test_nvs_host / esp_error_check_stub.cpp
1 #include "catch.hpp"
2 #include "esp_err.h"
3 #include "sdkconfig.h"
4
5 void _esp_error_check_failed(esp_err_t rc, const char *file, int line, const char *function, const char *expression)
6 {
7     printf("ESP_ERROR_CHECK failed: esp_err_t 0x%x", rc);
8 #ifdef CONFIG_ESP_ERR_TO_NAME_LOOKUP
9     printf(" (%s)", esp_err_to_name(rc));
10 #endif //CONFIG_ESP_ERR_TO_NAME_LOOKUP
11     printf(" at %p\n", __builtin_return_address(0));
12     printf("file: \"%s\" line %d\nfunc: %s\nexpression: %s\n", file, line, function, expression);
13     abort();
14 }