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/nvs_flash.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/unit/stubs/nvs_flash.h (limited to 'tests/unit/stubs/nvs_flash.h') diff --git a/tests/unit/stubs/nvs_flash.h b/tests/unit/stubs/nvs_flash.h new file mode 100644 index 0000000..4424a9a --- /dev/null +++ b/tests/unit/stubs/nvs_flash.h @@ -0,0 +1,12 @@ +#ifndef STUBS_NVS_FLASH_H +#define STUBS_NVS_FLASH_H + +#include "esp_err.h" + +#define ESP_ERR_NVS_NO_FREE_PAGES 0x1101 +#define ESP_ERR_NVS_NEW_VERSION_FOUND 0x1102 + +static inline esp_err_t nvs_flash_init(void) { return ESP_OK; } +static inline esp_err_t nvs_flash_erase(void) { return ESP_OK; } + +#endif -- cgit v1.2.3