Fix one typical misusage of CMock. (#1112)

* Fix one typical misusage of CMock.

CMock has three policies when dealing with pointer:
1. compare_ptr : compare the pointer itself;
2. compare_data : compare the data which is pointed by pointer;
3. smart : compare the pointer itself, or compare the data;
By default, CMock use compare_data policy.

Most test cases in FreeRTOS need to compare the pointer itself,
and we haven't use CMock properly.
For example, one test case of vTaskResume is wrong, because current
CMock compares the data pointed by pointer, so the error didn't exposed.

There are so many misusage need to fix, it will take a lot of work.
I'm here to fix one typical misusage first.

* Try to fix formatting syntax.
This commit is contained in:
Moral-Hao 2023-11-14 07:44:59 +08:00 committed by GitHub
parent 55d07daf0a
commit ae39f8e245
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -1,6 +1,7 @@
:cmock:
:mock_prefix: mock_
:when_no_prototypes: :warn
:when_ptr: :smart
:treat_externs: :include
:treat_inlines: :include
:enforce_strict_ordering: TRUE

View file

@ -2626,8 +2626,8 @@ void test_vTaskResume_success_task_event_list_orphan( void )
/* back */
uxListRemove_ExpectAndReturn( &ptcb->xStateListItem, pdTRUE );
/* prvAddTaskToReadyList*/
listINSERT_END_Expect( &pxReadyTasksLists[ create_task_priority ],
&ptcb->xStateListItem );
listINSERT_END_ExpectWithArray( &pxReadyTasksLists[ 3 ], 0,
&ptcb->xStateListItem, 0 );
/* API Call */
vTaskResume( task_handle ); /* not current tcb */
/* Validations */