-
Notifications
You must be signed in to change notification settings - Fork 22
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
Added new endianness test #102
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. @markcmiller86, I wonder if we should add a testfiles directory to house all the HDF5 files used in the tests?
FYI...I am working on this. I don't have easy access to a big endian system so I've found a Docker s390x container that is working. I am trying to duplicate the bad behavior that is triggering this code change and so far haven't been able to in spite of having a big endian system. For a minute, I was worried the two test files |
Ok, well, I guess I should have read the initial comment here. First, thanks for adding this test! That is exactly what I was looking for. Ok, let me just confirm its behaving as I expect for me too. |
@brtnfld I just want to check...how does HDF5 library handle endianness of |
From Jordan:
|
Well, in looking at the definition of that macro in
That is writing the least significant byte to the lowest memory location and the most significant byte to the highest memory location...little endian. So, its storing little endian to the file. But, it basically reverses this process when returning using this logic...
So, my read is that its always storing little endian to the file but also effectively properly byte-swapping the result when consumer or producer are NOT little endian. |
@markcmiller86 Ah yes, thanks for the correction. Doing too many things at once.. I agree, it appears we're writing the filter's |
This is probably of interest, although a bit late: I did try to verify that cd_values are preserved correctly across machines of different endianness, by creating a mock filter plugin that sets cd_values and leaves data unchanged. Here it is: |
thanks so much @spanezz for the added test. Just what we needed. Cool way to generate the big-endian data too. Much easier than what I was doing. I actually installed development tools and HDF5 on a s390x Docker image and then built and ran the filter and its tests there. |
I added to tests/ a
bigendian.h5
file generated on a s390x big endian machine using:And then added a
test-endian1
test that check if h5dump on that file contains12345
values.This test fails on little-endian machines without #101 and succeeds with the patch in #101