diff options
Diffstat (limited to 'tests/unit/stubs')
| -rw-r--r-- | tests/unit/stubs/freertos/FreeRTOS.h | 2 | ||||
| -rw-r--r-- | tests/unit/stubs/freertos/semphr.h | 7 | ||||
| -rw-r--r-- | tests/unit/stubs/mint_health.h | 44 |
3 files changed, 52 insertions, 1 deletions
diff --git a/tests/unit/stubs/freertos/FreeRTOS.h b/tests/unit/stubs/freertos/FreeRTOS.h index 41426c8..2d2b967 100644 --- a/tests/unit/stubs/freertos/FreeRTOS.h +++ b/tests/unit/stubs/freertos/FreeRTOS.h | |||
| @@ -7,7 +7,7 @@ static inline uint32_t xTaskGetTickCount(void) { return 0; } | |||
| 7 | static inline void vTaskDelay(uint32_t ticks) { (void)ticks; } | 7 | static inline void vTaskDelay(uint32_t ticks) { (void)ticks; } |
| 8 | #define pdMS_TO_TICKS(ms) ((ms) / 10) | 8 | #define pdMS_TO_TICKS(ms) ((ms) / 10) |
| 9 | #define portTICK_PERIOD_MS 10 | 9 | #define portTICK_PERIOD_MS 10 |
| 10 | #define configTICK_RATE_HZ 100 | ||
| 11 | #define portMAX_DELAY 0xFFFFFFFF | 10 | #define portMAX_DELAY 0xFFFFFFFF |
| 11 | #define pdTRUE 1 | ||
| 12 | 12 | ||
| 13 | #endif | 13 | #endif |
diff --git a/tests/unit/stubs/freertos/semphr.h b/tests/unit/stubs/freertos/semphr.h new file mode 100644 index 0000000..0389b11 --- /dev/null +++ b/tests/unit/stubs/freertos/semphr.h | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | #ifndef STUBS_FREERTOS_SEMPHR_H | ||
| 2 | #define STUBS_FREERTOS_SEMPHR_H | ||
| 3 | |||
| 4 | #include "FreeRTOS.h" | ||
| 5 | #include "task.h" | ||
| 6 | |||
| 7 | #endif | ||
diff --git a/tests/unit/stubs/mint_health.h b/tests/unit/stubs/mint_health.h new file mode 100644 index 0000000..7248042 --- /dev/null +++ b/tests/unit/stubs/mint_health.h | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | #ifndef MINT_HEALTH_H | ||
| 2 | #define MINT_HEALTH_H | ||
| 3 | |||
| 4 | #include <stdbool.h> | ||
| 5 | #include <stdint.h> | ||
| 6 | |||
| 7 | #define MINT_HEALTH_MAX 8 | ||
| 8 | #define MINT_HEALTH_PROBE_INTERVAL_S 300 | ||
| 9 | #define MINT_HEALTH_PROBE_TIMEOUT_MS 15000 | ||
| 10 | #define MINT_HEALTH_RECOVERY_THRESHOLD 3 | ||
| 11 | |||
| 12 | typedef struct { | ||
| 13 | char url[256]; | ||
| 14 | bool reachable; | ||
| 15 | uint8_t consecutive_successes; | ||
| 16 | int64_t last_probe_ms; | ||
| 17 | int last_http_status; | ||
| 18 | } mint_status_t; | ||
| 19 | |||
| 20 | typedef void (*mint_health_changed_cb)(void); | ||
| 21 | |||
| 22 | static inline bool mint_health_is_reachable(const char *url) { | ||
| 23 | (void)url; | ||
| 24 | return true; | ||
| 25 | } | ||
| 26 | |||
| 27 | static inline void mint_health_mark_unreachable(const char *url) { | ||
| 28 | (void)url; | ||
| 29 | } | ||
| 30 | |||
| 31 | static inline esp_err_t mint_health_init(const char urls[][256], int count) { | ||
| 32 | (void)urls; (void)count; return 0; | ||
| 33 | } | ||
| 34 | |||
| 35 | static inline void mint_health_start(void) {} | ||
| 36 | static inline void mint_health_stop(void) {} | ||
| 37 | static inline const mint_status_t *mint_health_get_all(int *out_count) { | ||
| 38 | *out_count = 0; return NULL; | ||
| 39 | } | ||
| 40 | static inline void mint_health_register_callback(mint_health_changed_cb cb) { | ||
| 41 | (void)cb; | ||
| 42 | } | ||
| 43 | |||
| 44 | #endif | ||