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
pull/613/head^2
alfred gedeon 4 years ago committed by GitHub
parent 459a6cbb4c
commit 5136a30399
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -35,7 +35,8 @@ MOCK_FILES_FP += $(PROJECT_DIR)/list_macros.h
CPPFLAGS += -DportUSING_MPU_WRAPPERS=0
# 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.

@ -54,7 +54,16 @@ static size_t uxLastMallocSize = 0;
static void * pLastFreedAddress = 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 )
{

@ -68,8 +68,10 @@
#define TICKS_TO_WAIT 10
#define NUM_CALLS_TO_INTERCEPT TICKS_TO_WAIT / 2
/* =========================== FUNCTION PROTOTYPES ======================== */
void setxMaskAssertAndAbort( bool mask );
bool getxMaskAssertAndAbort( );
/* ============================ GLOBAL VARIABLES =========================== */
bool xMaskAssertAndAbort;
/* ================================= MACROS ================================ */
@ -82,7 +84,7 @@ bool xMaskAssertAndAbort;
#define EXPECT_ASSERT_BREAK( call ) \
do \
{ \
xMaskAssertAndAbort = true; \
setxMaskAssertAndAbort( true ); \
CEXCEPTION_T e = CEXCEPTION_NONE; \
Try \
{ \

@ -175,7 +175,7 @@ void test_vQueueAddToRegistry_twice( void )
const char * pcFakeString1 = ( 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 );
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
$(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
$(SCRATCH_DIR)/mock_%.o : $(MOCKS_DIR)/mock_%.c

Loading…
Cancel
Save