You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi !
If you have a function with "long long" parameters/return value, like this
one :
int myFunction(long long id, char *name);
If I try to do a mockup with this function :
int myFunction(long long id, char *name) {
check_expected(id);
check_expected(name);
return *(int *)mock();
}
First, the computer will warn me "warning: cast to pointer from integer of
different size". The line "check_expected(id);" seems to trig the problem.
In fact the macro cast its parameter to a "void *", but a "void *" is a 32
bits wide and the "id" parameter is 64 bits wide.
I can ignore the warning and continue with it, but the checked value will
be truncated, the test will be a success, if I do someting like :
...
expect_value(myFunction, id, 0x34FFFFFFFF);
...
myFunction(0x89FFFFFFFF, "hello");
...
What is your opinion on it ?
Would it be easy to cast the "value" parameter to the biggest type
available on the current host (long long ?) ?
Or will it break something ?
Thanks for your help and for this amazing tool : mockup in c is a really
cool feature !
Original issue reported on code.google.com by meurant....@gmail.com on 7 Oct 2008 at 9:02
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
meurant....@gmail.com
on 7 Oct 2008 at 9:02The text was updated successfully, but these errors were encountered: