From d891276203f23fcec100815290388ada8e20b719 Mon Sep 17 00:00:00 2001 From: Guido Jansen Date: Sat, 31 Oct 2026 14:14:37 +0100 Subject: [PATCH] Fix host mocks for C++ headers and filesystem persistence --- test_host/mocks/freertos/FreeRTOS.h | 6 +++--- test_host/mocks/sys/stat.h | 21 +++------------------ 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/test_host/mocks/freertos/FreeRTOS.h b/test_host/mocks/freertos/FreeRTOS.h index ddff0dc2..7ac205c7 100644 --- a/test_host/mocks/freertos/FreeRTOS.h +++ b/test_host/mocks/freertos/FreeRTOS.h @@ -2,13 +2,13 @@ // Minimal FreeRTOS type definitions for host testing +#include +#include + #ifdef __cplusplus extern "C" { #endif -#include -#include - typedef void* TaskHandle_t; typedef void* QueueHandle_t; typedef void* SemaphoreHandle_t; diff --git a/test_host/mocks/sys/stat.h b/test_host/mocks/sys/stat.h index a5447d66..1e974a6d 100644 --- a/test_host/mocks/sys/stat.h +++ b/test_host/mocks/sys/stat.h @@ -1,20 +1,5 @@ #pragma once -#ifdef __cplusplus -extern "C" { -#endif - -#include - -struct stat { - uint64_t st_size; - uint32_t st_mode; - uint32_t st_mtime; -}; - -inline int stat(const char* path, struct stat* buf) { return -1; } -inline int remove(const char* path) { return -1; } - -#ifdef __cplusplus -} -#endif +// Host persistence tests write real files. Use the host ABI and errno rather +// than a fake stat() that always fails and leaves errno from an earlier call. +#include_next