diff options
| author | Your Name <you@example.com> | 2026-05-17 01:31:49 +0530 |
|---|---|---|
| committer | Your Name <you@example.com> | 2026-05-17 01:31:49 +0530 |
| commit | 347d29658959c7e4b368a15134c183f4ce7a25bc (patch) | |
| tree | 362b3e40273e3c1435bdd0745de61006041bb803 /tests/unit/stubs/esp_tls.h | |
| parent | 4c47ae188b288e7d24bd9566ab3e6a6805d9484f (diff) | |
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)
Diffstat (limited to 'tests/unit/stubs/esp_tls.h')
| -rw-r--r-- | tests/unit/stubs/esp_tls.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/unit/stubs/esp_tls.h b/tests/unit/stubs/esp_tls.h new file mode 100644 index 0000000..7ded63a --- /dev/null +++ b/tests/unit/stubs/esp_tls.h | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | #ifndef STUBS_ESP_TLS_H | ||
| 2 | #define STUBS_ESP_TLS_H | ||
| 3 | |||
| 4 | #include "esp_err.h" | ||
| 5 | |||
| 6 | typedef struct esp_tls esp_tls_t; | ||
| 7 | |||
| 8 | typedef struct { | ||
| 9 | void *crt_bundle_attach; | ||
| 10 | int use_global_ca_store; | ||
| 11 | } esp_tls_cfg_t; | ||
| 12 | |||
| 13 | static inline esp_tls_t *esp_tls_init(void) { return (esp_tls_t*)1; } | ||
| 14 | static inline int esp_tls_conn_new_sync(const char *h, int hl, int port, const esp_tls_cfg_t *cfg, esp_tls_t *tls) { | ||
| 15 | (void)h; (void)hl; (void)port; (void)cfg; (void)tls; return -1; | ||
| 16 | } | ||
| 17 | static inline int esp_tls_conn_write(esp_tls_t *tls, const void *data, size_t len) { | ||
| 18 | (void)tls; (void)data; (void)len; return len; | ||
| 19 | } | ||
| 20 | static inline int esp_tls_conn_read(esp_tls_t *tls, void *data, size_t len) { | ||
| 21 | (void)tls; (void)data; (void)len; return 0; | ||
| 22 | } | ||
| 23 | static inline void esp_tls_conn_destroy(esp_tls_t *tls) { (void)tls; } | ||
| 24 | |||
| 25 | #endif | ||