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

tests added in v1.2.0 fail on big-endian architectures #43

Open
decathorpe opened this issue May 28, 2024 · 1 comment
Open

tests added in v1.2.0 fail on big-endian architectures #43

decathorpe opened this issue May 28, 2024 · 1 comment

Comments

@decathorpe
Copy link

The tests added in #28 appear to assume little-endian byte order, and fail on big-endian architectures (the "cargo test" output below is from a s390x-unknown-linux-gnu machine).

I'm not sure if this is an indication of an issue with the actual implementation of rustc-hash on big-endian architectures, or if the hashes that are expected in tests are just hard-coded in little-endian byte-order but the actual results would be correct.

     Running `/builddir/build/BUILD/rustc-hash-1.2.0/target/rpm/deps/rustc_hash-3feb94ba4fd04739`
running 5 tests
test tests::signed ... FAILED
test seeded_state::tests::different_states_are_different ... ok
test tests::bytes ... FAILED
test tests::unsigned ... FAILED
test tests::with_seed_actually_different ... ok
failures:
---- tests::signed stdout ----
thread 'tests::signed' panicked at src/lib.rs:218:9:
assertion `left == right` failed
  left: 1714775736476281168
 right: 9223372036854775808
---- tests::bytes stdout ----
thread 'tests::bytes' panicked at src/lib.rs:267:9:
assertion `left == right` failed
  left: 4324798280752006973
 right: 16622306935539548858
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
---- tests::unsigned stdout ----
thread 'tests::unsigned' panicked at src/lib.rs:183:9:
assertion `left == right` failed
  left: 5871781006564002453
 right: 956286968014291186
failures:
    tests::bytes
    tests::signed
    tests::unsigned
test result: FAILED. 2 passed; 3 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
error: test failed, to rerun pass `--lib`
@Noratrieb
Copy link
Member

that's definitely a test issue, just throw .to_le() into the test function to fix it, PRs welcome

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

No branches or pull requests

2 participants