Skip to content

Commit 60870d6

Browse files
Dazza0paulbartell
authored andcommitted
Add unit tests for GetStaticBuffer functions (FreeRTOS#964)
Add unit tests for the various ...GetStaticBuffer() functions added in FreeRTOS/FreeRTOS-Kernel#641. --------- Co-authored-by: Paul Bartell <[email protected]>
1 parent 33356c1 commit 60870d6

File tree

14 files changed

+967
-55
lines changed

14 files changed

+967
-55
lines changed

FreeRTOS/Test/CMock/config/portmacro.h

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -123,38 +123,30 @@ typedef unsigned long UBaseType_t;
123123
/*-----------------------------------------------------------*/
124124

125125
#define portSAVE_CONTEXT()
126-
#define portYIELD() vFakePortYield()
127-
#define portYIELD_WITHIN_API() vFakePortYieldWithinAPI()
128-
#define portYIELD_FROM_ISR() vFakePortYieldFromISR()
126+
#define portYIELD() vFakePortYield()
127+
#define portYIELD_WITHIN_API() vFakePortYieldWithinAPI()
128+
#define portYIELD_FROM_ISR() vFakePortYieldFromISR()
129129

130130
/* Critical section handling. */
131-
#define portDISABLE_INTERRUPTS() vFakePortDisableInterrupts()
132-
#define portENABLE_INTERRUPTS() vFakePortEnableInterrupts()
131+
#define portDISABLE_INTERRUPTS() vFakePortDisableInterrupts()
132+
#define portENABLE_INTERRUPTS() vFakePortEnableInterrupts()
133133
#define portCLEAR_INTERRUPT_MASK_FROM_ISR( x ) \
134134
vFakePortClearInterruptMaskFromISR( x )
135135
#define portSET_INTERRUPT_MASK_FROM_ISR() \
136136
ulFakePortSetInterruptMaskFromISR()
137-
#define portSET_INTERRUPT_MASK() ulFakePortSetInterruptMask()
138-
#define portCLEAR_INTERRUPT_MASK( x ) vFakePortClearInterruptMask( x )
137+
#define portSET_INTERRUPT_MASK() ulFakePortSetInterruptMask()
138+
#define portCLEAR_INTERRUPT_MASK( x ) vFakePortClearInterruptMask( x )
139139
#define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() \
140140
vFakePortAssertIfInterruptPriorityInvalid()
141-
#define portENTER_CRITICAL() vFakePortEnterCriticalSection()
142-
#define portEXIT_CRITICAL() vFakePortExitCriticalSection()
141+
#define portENTER_CRITICAL() vFakePortEnterCriticalSection()
142+
#define portEXIT_CRITICAL() vFakePortExitCriticalSection()
143143

144144
#define portPRE_TASK_DELETE_HOOK( pvTaskToDelete, pxPendYield ) \
145145
vPortCurrentTaskDying( ( pvTaskToDelete ), ( pxPendYield ) )
146-
#define portSETUP_TCB( pxTCB ) portSetupTCB_CB( pxTCB );
147-
#define portASSERT_IF_IN_ISR() vFakePortAssertIfISR();
148-
149-
150-
static uint8_t ucPortCountLeadingZeros( uint32_t ulBitmap )
151-
{
152-
uint8_t ucReturn;
153-
154-
ucReturn = __builtin_clz( ulBitmap );
155-
return ucReturn;
156-
}
146+
#define portSETUP_TCB( pxTCB ) portSetupTCB_CB( pxTCB );
147+
#define portASSERT_IF_IN_ISR() vFakePortAssertIfISR();
157148

149+
#define ucPortCountLeadingZeros( ulBitmap ) ( ( uint8_t ) __builtin_clz( ulBitmap ) )
158150

159151
#define portRECORD_READY_PRIORITY( uxPriority, uxReadyPriorities ) \
160152
( uxReadyPriorities ) |= ( 1UL << ( uxPriority ) )

0 commit comments

Comments
 (0)