Skip to content

Fix unit tests on big endian systems - #156

Open
mgorse wants to merge 1 commit into
sekrit-twc:masterfrom
mgorse:master
Open

Fix unit tests on big endian systems#156
mgorse wants to merge 1 commit into
sekrit-twc:masterfrom
mgorse:master

Conversation

@mgorse

@mgorse mgorse commented Sep 22, 2021

Copy link
Copy Markdown

No description provided.

#if (__BYTE_ORDER == __LITTLE_ENDIAN)
SHA1Update(&sha_ctx, ptr, width * sizeof(T));
#else
for (unsigned j = 0; j < width; j++)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Make an endian-reversed copy of the scanline instead.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@sekrit-twc Hi, I am interested in reviving this PR as it seems to be the only thing standing in the way on big-endian. I see this code has been reorganized into https://github.com/sekrit-twc/graphengine. In this comment, do you mean that a copy should be made here, at hashing time, or do you mean that it should be done earlier, during actual buffer manipulations?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I don't know. There aren't any semantics for big-endian unit tests at the moment.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Github supports running on s390x natively: https://github.com/marketplace/actions/run-on-architecture#supported-platforms

It would probably be nice to have a runner for all these architectures, it would help catch issues like #175

I'll post a PR that does byte-swapping during the checksum generation. I don't think there's an easier way.

@sekrit-twc sekrit-twc changed the title FIx unit tests on big endian systems Fix unit tests on big endian systems Sep 23, 2021
@sekrit-twc

Copy link
Copy Markdown
Owner

You must accept the terms of WTFPL or transfer ownership of this commit to the Z.lib Steering Committee.

@sekrit-twc

Copy link
Copy Markdown
Owner

Also, how does one run a big-endian unit test?

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.

3 participants