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

fix: fix unit tests on arm64 #1066

Merged
merged 1 commit into from
Jun 22, 2022

Conversation

ntamas
Copy link
Contributor

@ntamas ntamas commented Jun 21, 2022

This PR fixes the unit tests on arm64 CPUs (e.g., Apple Silicon). There are two fixes worth mentioning:

  1. Forcing an uint32_t into a float might result in loss of precision as floats cannot represent all integers above 2^23-1.
  2. On arm64, sizeof(uint32_t) != sizeof(unsigned long) (unsigned longs are 8 byte, at least on Apple Silicon), so calling eprintf with an uint32_t where the corresponding format specifier is %lu is incorrect; the function would take 8 bytes from the stack and print a different number. This is now fixed.

@krichardsson krichardsson merged commit 9e70707 into bitcraze:master Jun 22, 2022
@krichardsson
Copy link
Contributor

Merged. Thanks!

@ntamas ntamas deleted the fix/unit-tests-apple-m1 branch June 22, 2022 08:07
@krichardsson krichardsson added this to the 2022.09 milestone Sep 7, 2022
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

Successfully merging this pull request may close these issues.

2 participants