Skip to content

Commit

Permalink
Add unit tests for GetStaticBuffer functions (FreeRTOS#964)
Browse files Browse the repository at this point in the history
Add unit tests for the various ...GetStaticBuffer() functions added in
FreeRTOS/FreeRTOS-Kernel#641.
---------

Co-authored-by: Paul Bartell <[email protected]>
  • Loading branch information
2 people authored and moninom1 committed Apr 27, 2023
1 parent 33356c1 commit 60870d6
Show file tree
Hide file tree
Showing 14 changed files with 967 additions and 55 deletions.
32 changes: 12 additions & 20 deletions FreeRTOS/Test/CMock/config/portmacro.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,38 +123,30 @@ typedef unsigned long UBaseType_t;
/*-----------------------------------------------------------*/

#define portSAVE_CONTEXT()
#define portYIELD() vFakePortYield()
#define portYIELD_WITHIN_API() vFakePortYieldWithinAPI()
#define portYIELD_FROM_ISR() vFakePortYieldFromISR()
#define portYIELD() vFakePortYield()
#define portYIELD_WITHIN_API() vFakePortYieldWithinAPI()
#define portYIELD_FROM_ISR() vFakePortYieldFromISR()

/* Critical section handling. */
#define portDISABLE_INTERRUPTS() vFakePortDisableInterrupts()
#define portENABLE_INTERRUPTS() vFakePortEnableInterrupts()
#define portDISABLE_INTERRUPTS() vFakePortDisableInterrupts()
#define portENABLE_INTERRUPTS() vFakePortEnableInterrupts()
#define portCLEAR_INTERRUPT_MASK_FROM_ISR( x ) \
vFakePortClearInterruptMaskFromISR( x )
#define portSET_INTERRUPT_MASK_FROM_ISR() \
ulFakePortSetInterruptMaskFromISR()
#define portSET_INTERRUPT_MASK() ulFakePortSetInterruptMask()
#define portCLEAR_INTERRUPT_MASK( x ) vFakePortClearInterruptMask( x )
#define portSET_INTERRUPT_MASK() ulFakePortSetInterruptMask()
#define portCLEAR_INTERRUPT_MASK( x ) vFakePortClearInterruptMask( x )
#define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() \
vFakePortAssertIfInterruptPriorityInvalid()
#define portENTER_CRITICAL() vFakePortEnterCriticalSection()
#define portEXIT_CRITICAL() vFakePortExitCriticalSection()
#define portENTER_CRITICAL() vFakePortEnterCriticalSection()
#define portEXIT_CRITICAL() vFakePortExitCriticalSection()

#define portPRE_TASK_DELETE_HOOK( pvTaskToDelete, pxPendYield ) \
vPortCurrentTaskDying( ( pvTaskToDelete ), ( pxPendYield ) )
#define portSETUP_TCB( pxTCB ) portSetupTCB_CB( pxTCB );
#define portASSERT_IF_IN_ISR() vFakePortAssertIfISR();


static uint8_t ucPortCountLeadingZeros( uint32_t ulBitmap )
{
uint8_t ucReturn;

ucReturn = __builtin_clz( ulBitmap );
return ucReturn;
}
#define portSETUP_TCB( pxTCB ) portSetupTCB_CB( pxTCB );
#define portASSERT_IF_IN_ISR() vFakePortAssertIfISR();

#define ucPortCountLeadingZeros( ulBitmap ) ( ( uint8_t ) __builtin_clz( ulBitmap ) )

#define portRECORD_READY_PRIORITY( uxPriority, uxReadyPriorities ) \
( uxReadyPriorities ) |= ( 1UL << ( uxPriority ) )
Expand Down
Loading

0 comments on commit 60870d6

Please sign in to comment.