Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cast_to_largest_integral_type truncate a 64bit value to 32bit #51

Open
CoolVenkee opened this issue Feb 10, 2019 · 1 comment
Open

cast_to_largest_integral_type truncate a 64bit value to 32bit #51

CoolVenkee opened this issue Feb 10, 2019 · 1 comment

Comments

@CoolVenkee
Copy link

When I try to call will_return with a pointer paremeter on a 64bit linux platform. mock fucntion return another value which losses the high 32bit of the origin value.
int customer_ids = 543; will_return(mock_query_database, &customer_ids);
*results = (void**)mock();
&customer_ids = 0x7ffe38d150cc
but mock() = 0x38d150cc

finally, I modify the source code in cmockery.h, remove ‘unsiged’ in
#define cast_to_largest_integral_type(value) \ ((LargestIntegralType)((unsigned)value))
it works.

@chengfen1987
Copy link

Yes, I have the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants