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

long double tests has problems setting precision with offset #4102

Merged
merged 2 commits into from
Mar 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions test/dsets.c
Original file line number Diff line number Diff line change
Expand Up @@ -5877,6 +5877,7 @@ test_floattypes(hid_t file)
if (H5Dclose(dataset) < 0)
goto error;
}
#if 0
#if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE
/* long double */
{
Expand All @@ -5898,9 +5899,9 @@ test_floattypes(hid_t file)
precision = 128;
if (H5Tset_precision(datatype, precision) < 0)
goto error;
if (H5Tset_fields(datatype, (size_t)127, (size_t)112, (size_t)15, (size_t)5, (size_t)107) < 0)
if (H5Tset_fields(datatype, (size_t)127, (size_t)112, (size_t)15, (size_t)0, (size_t)112) < 0)
goto error;
offset = 5;
offset = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Have you tried setting the precision to 123 instead of changing the offset? Setting the precision to 128 with an offset of 5 is lying to the library.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would not compile with 123 - complaint about sign position.

if (H5Tset_offset(datatype, offset) < 0)
goto error;
if (H5Tset_size(datatype, (size_t)16) < 0)
Expand Down Expand Up @@ -5966,6 +5967,7 @@ test_floattypes(hid_t file)
if (H5Dclose(dataset) < 0)
goto error;
}
#endif
#endif

return SUCCEED;
Expand Down
Loading