From 3d927557dc2e81bf218bcd60ae271c6e718e2ce2 Mon Sep 17 00:00:00 2001
From: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
Date: Tue, 28 Jan 2025 20:44:20 +0530
Subject: [PATCH] Add tests to cover xQueueCreateSetStatic (#1323)

Add tests to cover xQueueCreateSetStatic

This API was recently added in the following PR:
https://github.com/FreeRTOS/FreeRTOS-Kernel/pull/1228

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
---
 FreeRTOS/Test/CMock/queue/sets/queue_set_utest.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/FreeRTOS/Test/CMock/queue/sets/queue_set_utest.c b/FreeRTOS/Test/CMock/queue/sets/queue_set_utest.c
index 4432faaaad..eed7d34eae 100644
--- a/FreeRTOS/Test/CMock/queue/sets/queue_set_utest.c
+++ b/FreeRTOS/Test/CMock/queue/sets/queue_set_utest.c
@@ -39,6 +39,7 @@
 #include "mock_fake_port.h"
 
 /* ============================  GLOBAL VARIABLES =========================== */
+#define EVENT_QUEUE_LENGTH    5
 
 /* ==========================  CALLBACK FUNCTIONS =========================== */
 
@@ -124,6 +125,19 @@ void test_xQueueCreateSet_oneLength( void )
     vQueueDelete( xQueueSet );
 }
 
+void test_xQueueCreateSetStatic_HappyPath( void )
+{
+    StaticQueue_t xQueueSetBuffer;
+    QueueHandle_t xQueueSetStorage[ EVENT_QUEUE_LENGTH ];
+    QueueSetHandle_t xQueueSet = NULL;
+
+    xQueueSet = xQueueCreateSetStatic( EVENT_QUEUE_LENGTH,
+                                       ( uint8_t * ) &( xQueueSetStorage[ 0 ] ),
+                                       &( xQueueSetBuffer ) );
+
+    TEST_ASSERT_NOT_NULL( xQueueSet );
+}
+
 /**
  * @brief Test xQueueAddToSet with the same queue twice
  * @coverage xQueueAddToSet