We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
I am trying to mock "task.h" using CMock (in a ceedling environment).
There is one problem I encountered wich is the following:
An internal FreeRTOS symbol is defined as :
#define portDONT_DISCARD __attribute__( ( used ) )
And a function is declared as follows in "task.h" header file:
portDONT_DISCARD void vTaskSwitchContext(void) PRIVILEGED_FUNCTION;
When mocking in my unit test the header file with 'mock_' prefix:
//-- mocking necessary file for compilation #include "mock_em_core.h" #include "mock_sid_pal_log_ifc.h" #include "mock_sid_pal_assert_ifc.h" #include "mock_queue.h" #include "mock_task.h". <----- HERE
The generated Mock is looking like this, causing a compilation error:
--> HERE missing argument void vTaskSwitchContext_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, )void cmock_to_return); ``` The message error: ``` In file included from build/test/runners/test_swi_runner.c:11: build/test/mocks/mock_task.h:901:74: error: expected parameter declarator void vTaskSwitchContext_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, )void cmock_to_return); ```
The text was updated successfully, but these errors were encountered:
If you add portDONT_DISCARD to your :strippables list, I believe this problem will go away.
portDONT_DISCARD
:strippables
Sorry, something went wrong.
No branches or pull requests
Hello,
I am trying to mock "task.h" using CMock (in a ceedling environment).
There is one problem I encountered wich is the following:
An internal FreeRTOS symbol is defined as :
And a function is declared as follows in "task.h" header file:
When mocking in my unit test the header file with 'mock_' prefix:
The generated Mock is looking like this, causing a compilation error:
The text was updated successfully, but these errors were encountered: