ThrowTheSwitch / CMock

CMock - Mock/stub generator for C
http://throwtheswitch.org
MIT License
686 stars 276 forks source link

IgnoreArg not available in CMock 2.5.4 used with ceedling 0.31.1 #426

Closed Daimonion1980 closed 1 year ago

Daimonion1980 commented 1 year ago

I'm using CMock together with ceedling latest version installed through gem and are in need of the documented function Ignore Arg

https://github.com/ThrowTheSwitch/CMock/blob/master/docs/CMock_Summary.md#ignore-arg

But I cannot use this function because CMock doesn't provides it and it even doesn't compile the tests:

test/test_flashEmulatedOTW_storage.c:412:5: warning: implicit declaration of function 'flash_write_IgnoreArg_writeBuffer' [-Wimplicit-function-declaration]
     flash_write_IgnoreArg_writeBuffer( void );
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test/test_flashEmulatedOTW_storage.c:412:40: error: expected expression before 'void'
     flash_write_IgnoreArg_writeBuffer( void );
                                        ^~~~
ERROR: Shell command failed.
> Shell executed command:

flash_write gets mocked perfect with functions like ExpectAndReturn or Ignore and all the obvious CMock functions. But CMock does not generate "more complex" Mocks like returnThruPtr or the IgnoreArg function.

the Header of flash_write is defined as follows:

extern int32_t flash_write(const uint32_t address,const uint8_t writeBuffer[],const uint32_t sizeWriteBuffer);

Do i have to configure CMock in ceedling project file to generate these mocks?

Daimonion1980 commented 1 year ago

Closed because forgot to enable the plugin in ceedling project settings

Letme commented 1 year ago

Can you link the issue? I assume you just need to enable the ignore-arg plugin for CMock part of the project.yml

Daimonion1980 commented 1 year ago

Yep, exactly this was the issue.