From 347d29658959c7e4b368a15134c183f4ce7a25bc Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 17 May 2026 01:31:49 +0530 Subject: Testing infrastructure: AGENTS.md rules + unit test framework + geohash tests (11/11 pass) - Add AGENTS.md: full project context + mandatory testing rules for AI sessions - Add tests/unit/ with host-compiled C unit test infrastructure - Clean stubs approach: ESP-IDF type stubs in tests/unit/stubs/, no source modifications - Fix geohash.c bit extraction bug (3-byte span) found by unit tests - test_geohash: 11/11 passing with reference vectors (Munich, NYC, origin, boundaries) --- tests/unit/stubs/freertos/task.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/unit/stubs/freertos/task.h (limited to 'tests/unit/stubs/freertos/task.h') diff --git a/tests/unit/stubs/freertos/task.h b/tests/unit/stubs/freertos/task.h new file mode 100644 index 0000000..3855d41 --- /dev/null +++ b/tests/unit/stubs/freertos/task.h @@ -0,0 +1,19 @@ +#ifndef STUBS_FREERTOS_TASK_H +#define STUBS_FREERTOS_TASK_H + +#include +#include + +typedef void *TaskHandle_t; +typedef void *SemaphoreHandle_t; + +static inline void vTaskDelete(TaskHandle_t t) { (void)t; } +static inline SemaphoreHandle_t xSemaphoreCreateMutex(void) { return (SemaphoreHandle_t)malloc(1); } +static inline void vSemaphoreDelete(SemaphoreHandle_t s) { free(s); } +static inline int xSemaphoreTake(SemaphoreHandle_t s, uint32_t blk) { (void)s; (void)blk; return 1; } +static inline int xSemaphoreGive(SemaphoreHandle_t s) { (void)s; return 1; } +static inline int xTaskCreate(void (*fn)(void*), const char *n, uint32_t st, void *p, uint32_t pri, TaskHandle_t *h) { + (void)fn; (void)n; (void)st; (void)p; (void)pri; (void)h; return 1; +} + +#endif -- cgit v1.2.3