diff options
Diffstat (limited to 'tests/unit/stubs')
| -rw-r--r-- | tests/unit/stubs/esp_log.h | 1 | ||||
| -rw-r--r-- | tests/unit/stubs/esp_system.h | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/tests/unit/stubs/esp_log.h b/tests/unit/stubs/esp_log.h index f353fe9..b9d44b3 100644 --- a/tests/unit/stubs/esp_log.h +++ b/tests/unit/stubs/esp_log.h | |||
| @@ -6,5 +6,6 @@ | |||
| 6 | #define ESP_LOGI(tag, fmt, ...) do { printf("I %s: " fmt "\n", tag, ##__VA_ARGS__); } while(0) | 6 | #define ESP_LOGI(tag, fmt, ...) do { printf("I %s: " fmt "\n", tag, ##__VA_ARGS__); } while(0) |
| 7 | #define ESP_LOGW(tag, fmt, ...) do { printf("W %s: " fmt "\n", tag, ##__VA_ARGS__); } while(0) | 7 | #define ESP_LOGW(tag, fmt, ...) do { printf("W %s: " fmt "\n", tag, ##__VA_ARGS__); } while(0) |
| 8 | #define ESP_LOGE(tag, fmt, ...) do { fprintf(stderr, "E %s: " fmt "\n", tag, ##__VA_ARGS__); } while(0) | 8 | #define ESP_LOGE(tag, fmt, ...) do { fprintf(stderr, "E %s: " fmt "\n", tag, ##__VA_ARGS__); } while(0) |
| 9 | #define ESP_LOGD(tag, fmt, ...) do { } while(0) | ||
| 9 | 10 | ||
| 10 | #endif | 11 | #endif |
diff --git a/tests/unit/stubs/esp_system.h b/tests/unit/stubs/esp_system.h index 8e63c80..cd54743 100644 --- a/tests/unit/stubs/esp_system.h +++ b/tests/unit/stubs/esp_system.h | |||
| @@ -1,4 +1,14 @@ | |||
| 1 | #ifndef STUBS_ESP_SYSTEM_H | 1 | #ifndef STUBS_ESP_SYSTEM_H |
| 2 | #define STUBS_ESP_SYSTEM_H | 2 | #define STUBS_ESP_SYSTEM_H |
| 3 | 3 | ||
| 4 | #include <stdlib.h> | ||
| 5 | #include <stdint.h> | ||
| 6 | |||
| 7 | static inline void esp_fill_random(uint8_t *buf, size_t len) | ||
| 8 | { | ||
| 9 | for (size_t i = 0; i < len; i++) { | ||
| 10 | buf[i] = (uint8_t)(rand() & 0xFF); | ||
| 11 | } | ||
| 12 | } | ||
| 13 | |||
| 4 | #endif | 14 | #endif |