meekrosoft / fff

A testing micro framework for creating function test doubles
Other
749 stars 163 forks source link

Argument history storing derefenced pointers #104

Closed AVGitUser closed 2 years ago

AVGitUser commented 2 years ago

Hi,

FFF is great. Would anyone else see benefit for storing the value/struct that was provided to a fake function through a pointer, rather than just the pointer?

Example:

code_to_test.c

for(i=0; i<NUM; i++) { GpioDefStructure gpio_defs; gpio_defs.pin = i; HAL_GPIO_Init(&gpio_defs); }

In this example I have to use HAL_GPIO_Init and cannot change it.

I want to test that it is executed the expected number of times and I would want to make sure that it did not initialise the same pin twice. The expected number of times can be checked using the existing call_count. The history of arg0 however, is the same for every call as the pointer is the same value - I cannot check what is in it.

Does anyone more knowledgeable know if this would even be possible?

Thanks

AVGitUser commented 2 years ago

Duplicates https://github.com/meekrosoft/fff/issues/33