Closed Flockstud closed 5 years ago
@Flockstud, this example works for me without a hitch:
#include "fff.h"
DEFINE_FFF_GLOBALS;
FAKE_VALUE_FUNC(unsigned int, SelfLib_Write, void*, void*, char);
unsigned int custom_SelfLib_Write(void* a, void* b, char c)
{
return 0x1;
}
int main(void)
{
SelfLib_Write_fake.custom_fake = custom_SelfLib_Write;
return 0;
}
Are you still having a problem?
If so, please provide more context for the below:
It seems to be calculating the size of the argument to save to array, but this would probably cause an issue.
... I guess we'd have to use a different function than memcpy()?
Hi wulfgarpro!
Thanks for your reply, sorry for long wait, a lot has happened. It looks like that would work! Thanks and i hope to get it back working!
Best Regards,
Joel
Hi,
I'm having issues trying to mock a function that has void pointers. It seems to be calculating the size of the argument to save to array, but this would probably cause an issue. Is it possible to mock this kind of function? I guess we'd have to use a different function than memcpy()?
This is an example: unsigned int SelfLib_Write(void var_1, void var_2, unsigned char b);
Typical error with gcc:
Is this library still maintained?
Thanks