diff options
Diffstat (limited to 'tests/unit/stubs/esp_err.h')
| -rw-r--r-- | tests/unit/stubs/esp_err.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/unit/stubs/esp_err.h b/tests/unit/stubs/esp_err.h new file mode 100644 index 0000000..84c3734 --- /dev/null +++ b/tests/unit/stubs/esp_err.h | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | #ifndef STUBS_ESP_ERR_H | ||
| 2 | #define STUBS_ESP_ERR_H | ||
| 3 | |||
| 4 | #include <stdint.h> | ||
| 5 | #include <stdio.h> | ||
| 6 | #include <stdlib.h> | ||
| 7 | |||
| 8 | typedef int esp_err_t; | ||
| 9 | |||
| 10 | #define ESP_OK 0 | ||
| 11 | #define ESP_FAIL -1 | ||
| 12 | #define ESP_ERR_INVALID_ARG 0x102 | ||
| 13 | #define ESP_ERR_NO_MEM 0x101 | ||
| 14 | #define ESP_ERR_NOT_FOUND 0x104 | ||
| 15 | |||
| 16 | #define ESP_ERROR_CHECK(x) do { if ((x) != 0) { fprintf(stderr, "ESP_ERROR_CHECK failed: 0x%x\n", (int)(x)); abort(); } } while(0) | ||
| 17 | |||
| 18 | #endif | ||