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

bindgen tests are broken on BigEndian platforms #1412

Closed
ignatenkobrain opened this issue Oct 7, 2018 · 4 comments
Closed

bindgen tests are broken on BigEndian platforms #1412

ignatenkobrain opened this issue Oct 7, 2018 · 4 comments

Comments

@ignatenkobrain
Copy link

failures:
---- codegen::bitfield_unit_tests::bitfield_unit_get stdout ----
expected = 0000000000000000000000000000000000000000000000000000000000000000
actual   = 0000000000000000000000000000000000000000000000000000000000000001
thread 'codegen::bitfield_unit_tests::bitfield_unit_get' panicked at 'assertion failed: `(left == right)`
  left: `0`,
 right: `1`', src/codegen/bitfield_unit_tests.rs:124:1
note: Run with `RUST_BACKTRACE=1` for a backtrace.
---- codegen::bitfield_unit_tests::bitfield_unit_set stdout ----
set(0, 1, 00000000000000000000000011111111
expected = 0000000000000000000000000000000000000000000000000000000000000001
actual   = 0000000000000000000000000000000010000000000000000000000000000000
thread 'codegen::bitfield_unit_tests::bitfield_unit_set' panicked at 'assertion failed: `(left == right)`
  left: `1`,
 right: `2147483648`', src/codegen/bitfield_unit_tests.rs:226:1
---- codegen::bitfield_unit_tests::bitfield_unit_get_bit stdout ----
bits = [true, false, false, true, true, true, false, true, false, false, false, true, true, true, false, true]
thread 'codegen::bitfield_unit_tests::bitfield_unit_get_bit' panicked at 'assertion failed: `(left == right)`
  left: `[true, false, false, true, true, true, false, true, false, false, false, true, true, true, false, true]`,
 right: `[true, false, true, true, true, false, false, true, true, false, true, true, true, false, false, false]`', src/codegen/bitfield_unit_tests.rs:38:5
@auscompgeek
Copy link
Contributor

What arguments are you passing to clang?

@ignatenkobrain
Copy link
Author

how can I find out this? I just ran cargo test --release

@auscompgeek
Copy link
Contributor

Oh, I thought you were talking about tests that bindgen generates, not the tests in the repo.

@emilio
Copy link
Contributor

emilio commented Oct 7, 2018

@ignatenkobrain I think those tests as written are little-endian-specific. We have integration tests in bindgen-integration which should work in big-endian platforms. Will patch bindgen so the tests aren't run on big-endian platforms.

emilio added a commit to emilio/rust-bindgen that referenced this issue Oct 7, 2018
bors-servo pushed a commit that referenced this issue Oct 7, 2018
Skip bitfield unit tests on big-endian platforms.

Fixes #1412.
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

3 participants