Skip to content

Commit

Permalink
Add tests to cover xQueueCreateSetStatic (FreeRTOS#1323)
Browse files Browse the repository at this point in the history
Add tests to cover xQueueCreateSetStatic

This API was recently added in the following PR:
FreeRTOS/FreeRTOS-Kernel#1228

Signed-off-by: Gaurav Aggarwal <[email protected]>
  • Loading branch information
aggarg authored Jan 28, 2025
1 parent 6d364f0 commit 3d92755
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions FreeRTOS/Test/CMock/queue/sets/queue_set_utest.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "mock_fake_port.h"

/* ============================ GLOBAL VARIABLES =========================== */
#define EVENT_QUEUE_LENGTH 5

/* ========================== CALLBACK FUNCTIONS =========================== */

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3d92755

Please sign in to comment.