From 71ce352c82344e56e7fdc1301e06d12631bfe981 Mon Sep 17 00:00:00 2001 From: David Chisnall Date: Wed, 5 Jun 2024 13:14:06 +0100 Subject: [PATCH] Add missing test file. We have had the build infrastructure for testing that the FreeRTOS headers compile in C mode for a while, but I forgot to add the .c file for the test. --- tests/ccompile-freertos-test.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/ccompile-freertos-test.c diff --git a/tests/ccompile-freertos-test.c b/tests/ccompile-freertos-test.c new file mode 100644 index 00000000..8930b0b0 --- /dev/null +++ b/tests/ccompile-freertos-test.c @@ -0,0 +1,12 @@ +#include + +#if (CHERIOT_FREERTOS_SEMAPHORE + CHERIOT_FREERTOS_MUTEX + \ + CHERIOT_FREERTOS_RECURSIVE_MUTEX) == 1 +#if CHERIOT_FREERTOS_SEMAPHORE == 1 +_Static_assert(sizeof(StaticSemaphore_t) == sizeof(struct CountingSemaphoreState); +#elif CHERIOT_FREERTOS_MUTEX == 1 +_Static_assert(sizeof(StaticSemaphore_t) == sizeof(struct FlagLockState)); +#else +_Static_assert(sizeof(StaticSemaphore_t) == sizeof(struct RecursiveMutexState)); +#endif +#endif