So mocking this function
void Button_pollAll(Button * const *, size_t);
Was giving me this
DECLARE_FAKE_VOID_FUNC2(Button_pollAll, const Button* const*, size_t);
I.e. prefixing the argument with an extra const
Looking at FffMockGenerator.write_function_macros, we see this...
# Append each argument type.
function[:args].each do |arg|
output.print ", "
if arg[:const?]
output.print "const "
end
output.print "#{arg[:type]}"
end
That [:const?] member is created by the CMockHeaderParser, and pretty sure it's being misinterpreted by FffMockGenerator (as CMock produces the expected mock prototypes) -- i.e. the const token is still present in the arg body, so think you can safely remove the if.
Works for me anyway -- if you're happy enough with this resolution I can raise a PR
So mocking this function
void Button_pollAll(Button * const *, size_t);
Was giving me this
DECLARE_FAKE_VOID_FUNC2(Button_pollAll, const Button* const*, size_t);
I.e. prefixing the argument with an extra
const
Looking at
FffMockGenerator.write_function_macros
, we see this...That
[:const?]
member is created by the CMockHeaderParser, and pretty sure it's being misinterpreted by FffMockGenerator (as CMock produces the expected mock prototypes) -- i.e. the const token is still present in the arg body, so think you can safely remove theif
.Works for me anyway -- if you're happy enough with this resolution I can raise a PR