Closed lafalexis closed 1 year ago
Turns out there is a builtin plugin that serves exactly this purpose. I write this for those who are looking for the same thing I did.
The plugin is ignore_arg and can be added to CMock configuration in the following manner :
:cmock:
:plugins:
- :ignore_arg
This feature is detailed here : https://github.com/ThrowTheSwitch/CMock/blob/master/docs/CMock_Summary.md#ignore-arg
Hi! I am currently trying to integrate unit testing with Ceedling to the legacy code we have where I work. I have been researching quite a bit for issues ressembling mine, but it has not been quite fruitful... I want to use the ExpectAndReturn mock, but only to check the non-pointer variables. The reason for this is that the value pointed is to be set inside the mocked function. Therefore, the value pointed by the pointer is not set prior entering the said function.
Here is a little example of what I was trying to illustrate above :
I know of the plugin ExpectAnyArgsAndReturn, but the thing is, I still want to check reg_add... Is there a way to do this or should I try and build myself a CMock plugin to generate the ExpectValueArgsAndReturn or something like that? Let me know if any of this was unclear and thanks ahead for the help :)
-Alexis