Skip to content

tests/c_lib: Skip double sqrt test when double is not 64 bits #89790

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

Merged
merged 1 commit into from
May 26, 2025

Conversation

keith-packard
Copy link
Collaborator

This test only works for 64-bit values. On targets which use 32 bits for double, skip this version. The float test will check the 32-bit math for that.

@@ -147,6 +149,9 @@ int32_t *p_root_squared = (int32_t *)&root_squared;

ZTEST(libc_common, test_sqrt)
{
#if __SIZEOF_DOUBLE__ != 8
TC_PRINT("test_sqrt skipped, double not 64 bits\n");
Copy link
Member

@aescolar aescolar May 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this call ztest_test_skip?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, thanks.

aescolar
aescolar previously approved these changes May 12, 2025
cfriedt
cfriedt previously approved these changes May 12, 2025
Copy link
Member

@cfriedt cfriedt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The evolution of this change was great. Good feedback from reviewers. LGTM

@aescolar
Copy link
Member

@keith-packard note the compliance check failure

nashif
nashif previously approved these changes May 12, 2025
cfriedt
cfriedt previously approved these changes May 12, 2025
aescolar
aescolar previously approved these changes May 13, 2025
@aescolar
Copy link
Member

@keith-packard an older version of this commit got in thru #90398.
I think it would still be nice to get have this PR replace the changes from that old commit with this.

@nashif nashif assigned nashif and unassigned stephanosio May 26, 2025
@keith-packard
Copy link
Collaborator Author

@keith-packard an older version of this commit got in thru #90398. I think it would still be nice to get have this PR replace the changes from that old commit with this.

oops. yeah, this one is probably nicer.

This test only works for 64-bit values. On targets which use 32 bits for
double, skip this version. The float test will check the 32-bit math for
that.

This is the 'nicer' version of this fix which uses sizeof rather than
relying on __SIZEOF_DOUBLE__.

Signed-off-by: Keith Packard <keithp@keithp.com>
@keith-packard keith-packard dismissed stale reviews from aescolar, cfriedt, and nashif via e03fcc8 May 26, 2025 14:47
Copy link

@nashif nashif merged commit 3231269 into zephyrproject-rtos:main May 26, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: C Library C Standard Library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants