mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-10-26 23:36:32 -04:00
Test: Mask unit test warning (#592)
* Test: Mask unit test warning * Fix Unit Test Bug * Unit Test: Add setters and getters for xMaskAssertAndAbort * Fix Warning * Update Makefile
This commit is contained in:
parent
459a6cbb4c
commit
5136a30399
5 changed files with 18 additions and 6 deletions
|
|
@ -35,7 +35,8 @@ MOCK_FILES_FP += $(PROJECT_DIR)/list_macros.h
|
||||||
CPPFLAGS += -DportUSING_MPU_WRAPPERS=0
|
CPPFLAGS += -DportUSING_MPU_WRAPPERS=0
|
||||||
|
|
||||||
# List any addiitonal flags needed by the compiler
|
# List any addiitonal flags needed by the compiler
|
||||||
CFLAGS += -include list_macros.h
|
CFLAGS += -include list_macros.h
|
||||||
|
CFLAGS += -Wno-incompatible-pointer-types
|
||||||
|
|
||||||
# Try not to edit beyond this line unless necessary.
|
# Try not to edit beyond this line unless necessary.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,16 @@ static size_t uxLastMallocSize = 0;
|
||||||
static void * pLastFreedAddress = 0;
|
static void * pLastFreedAddress = 0;
|
||||||
static uint32_t ulNumMallocCalls = 0;
|
static uint32_t ulNumMallocCalls = 0;
|
||||||
|
|
||||||
/* ========================== CALLBACK FUNCTIONS =========================== */
|
/* =========================== HELPER FUNCTIONS =========================== */
|
||||||
|
void setxMaskAssertAndAbort( bool mask )
|
||||||
|
{
|
||||||
|
xMaskAssertAndAbort = mask;
|
||||||
|
}
|
||||||
|
bool getxMaskAssertAndAbort( )
|
||||||
|
{
|
||||||
|
return xMaskAssertAndAbort;
|
||||||
|
}
|
||||||
|
/* ========================== CALLBACK FUNCTIONS ========================== */
|
||||||
|
|
||||||
void * pvPortMalloc( size_t xSize )
|
void * pvPortMalloc( size_t xSize )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -68,8 +68,10 @@
|
||||||
#define TICKS_TO_WAIT 10
|
#define TICKS_TO_WAIT 10
|
||||||
#define NUM_CALLS_TO_INTERCEPT TICKS_TO_WAIT / 2
|
#define NUM_CALLS_TO_INTERCEPT TICKS_TO_WAIT / 2
|
||||||
|
|
||||||
|
/* =========================== FUNCTION PROTOTYPES ======================== */
|
||||||
|
void setxMaskAssertAndAbort( bool mask );
|
||||||
|
bool getxMaskAssertAndAbort( );
|
||||||
/* ============================ GLOBAL VARIABLES =========================== */
|
/* ============================ GLOBAL VARIABLES =========================== */
|
||||||
bool xMaskAssertAndAbort;
|
|
||||||
|
|
||||||
/* ================================= MACROS ================================ */
|
/* ================================= MACROS ================================ */
|
||||||
|
|
||||||
|
|
@ -82,7 +84,7 @@ bool xMaskAssertAndAbort;
|
||||||
#define EXPECT_ASSERT_BREAK( call ) \
|
#define EXPECT_ASSERT_BREAK( call ) \
|
||||||
do \
|
do \
|
||||||
{ \
|
{ \
|
||||||
xMaskAssertAndAbort = true; \
|
setxMaskAssertAndAbort( true ); \
|
||||||
CEXCEPTION_T e = CEXCEPTION_NONE; \
|
CEXCEPTION_T e = CEXCEPTION_NONE; \
|
||||||
Try \
|
Try \
|
||||||
{ \
|
{ \
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,7 @@ void test_vQueueAddToRegistry_twice( void )
|
||||||
const char * pcFakeString1 = ( char * ) ( BaseType_t ) getNextMonotonicTestValue();
|
const char * pcFakeString1 = ( char * ) ( BaseType_t ) getNextMonotonicTestValue();
|
||||||
const char * pcFakeString2 = ( char * ) ( BaseType_t ) getNextMonotonicTestValue();
|
const char * pcFakeString2 = ( char * ) ( BaseType_t ) getNextMonotonicTestValue();
|
||||||
|
|
||||||
/* Add an item to the registry **/
|
/* Add an item to the registry */
|
||||||
vQueueAddToRegistry( xFakeHandle, pcFakeString1 );
|
vQueueAddToRegistry( xFakeHandle, pcFakeString1 );
|
||||||
|
|
||||||
TEST_ASSERT_TRUE( helper_find_in_queue_registry( xFakeHandle, pcFakeString1 ) );
|
TEST_ASSERT_TRUE( helper_find_in_queue_registry( xFakeHandle, pcFakeString1 ) );
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,7 @@ $(PROJ_DIR)/%.i : $(KERNEL_DIR)/%.c
|
||||||
|
|
||||||
# compile the project objects with coverage instrumented
|
# compile the project objects with coverage instrumented
|
||||||
$(PROJ_DIR)/%.o : $(PROJ_DIR)/%.i
|
$(PROJ_DIR)/%.o : $(PROJ_DIR)/%.i
|
||||||
$(CC) -c $< $(CPPFLAGS) $(INCLUDE_DIR) $(GCC_COV_OPTS) -o $@
|
$(CC) -c $< $(CPPFLAGS) $(CFLAGS) $(INCLUDE_DIR) $(GCC_COV_OPTS) -o $@
|
||||||
|
|
||||||
# Build mock objects
|
# Build mock objects
|
||||||
$(SCRATCH_DIR)/mock_%.o : $(MOCKS_DIR)/mock_%.c
|
$(SCRATCH_DIR)/mock_%.o : $(MOCKS_DIR)/mock_%.c
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue