diff options
author | alfred gedeon <28123637+alfred2g@users.noreply.github.com> | 2021-05-27 16:26:31 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-27 16:26:31 -0700 |
commit | 5136a30399a79087cb980387e489c6c3db1c1ac2 (patch) | |
tree | ec63f02f3360a5cabee949ebafa4cee9847eb356 /FreeRTOS/Test | |
parent | 459a6cbb4c7df85848dea98fbb09b2943b604ab7 (diff) | |
download | freertos-git-5136a30399a79087cb980387e489c6c3db1c1ac2.tar.gz |
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
Diffstat (limited to 'FreeRTOS/Test')
-rw-r--r-- | FreeRTOS/Test/CMock/event_groups/Makefile | 3 | ||||
-rw-r--r-- | FreeRTOS/Test/CMock/queue/queue_utest_common.c | 11 | ||||
-rw-r--r-- | FreeRTOS/Test/CMock/queue/queue_utest_common.h | 6 | ||||
-rw-r--r-- | FreeRTOS/Test/CMock/queue/tracing/queue_registry_utest.c | 2 | ||||
-rw-r--r-- | FreeRTOS/Test/CMock/testdir.mk | 2 |
5 files changed, 18 insertions, 6 deletions
diff --git a/FreeRTOS/Test/CMock/event_groups/Makefile b/FreeRTOS/Test/CMock/event_groups/Makefile index d220ed760..da0c1886d 100644 --- a/FreeRTOS/Test/CMock/event_groups/Makefile +++ b/FreeRTOS/Test/CMock/event_groups/Makefile @@ -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. diff --git a/FreeRTOS/Test/CMock/queue/queue_utest_common.c b/FreeRTOS/Test/CMock/queue/queue_utest_common.c index e6a1371d7..eed1b000b 100644 --- a/FreeRTOS/Test/CMock/queue/queue_utest_common.c +++ b/FreeRTOS/Test/CMock/queue/queue_utest_common.c @@ -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 ) { diff --git a/FreeRTOS/Test/CMock/queue/queue_utest_common.h b/FreeRTOS/Test/CMock/queue/queue_utest_common.h index a722365e1..bca0e16b7 100644 --- a/FreeRTOS/Test/CMock/queue/queue_utest_common.h +++ b/FreeRTOS/Test/CMock/queue/queue_utest_common.h @@ -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 \ { \ diff --git a/FreeRTOS/Test/CMock/queue/tracing/queue_registry_utest.c b/FreeRTOS/Test/CMock/queue/tracing/queue_registry_utest.c index 3a6d74563..8569e5b98 100644 --- a/FreeRTOS/Test/CMock/queue/tracing/queue_registry_utest.c +++ b/FreeRTOS/Test/CMock/queue/tracing/queue_registry_utest.c @@ -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 ) ); diff --git a/FreeRTOS/Test/CMock/testdir.mk b/FreeRTOS/Test/CMock/testdir.mk index 5ebc8fdcb..139cae80a 100644 --- a/FreeRTOS/Test/CMock/testdir.mk +++ b/FreeRTOS/Test/CMock/testdir.mk @@ -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 |