upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/tests/unit/stubs/esp_err.h
blob: 84c37344b9b172609110435d1861679d0ca777b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#ifndef STUBS_ESP_ERR_H
#define STUBS_ESP_ERR_H

#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>

typedef int esp_err_t;

#define ESP_OK          0
#define ESP_FAIL        -1
#define ESP_ERR_INVALID_ARG  0x102
#define ESP_ERR_NO_MEM       0x101
#define ESP_ERR_NOT_FOUND    0x104

#define ESP_ERROR_CHECK(x) do { if ((x) != 0) { fprintf(stderr, "ESP_ERROR_CHECK failed: 0x%x\n", (int)(x)); abort(); } } while(0)

#endif