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

Test binding::test::size_of_event fails on i686 / 32 bits arches #740

Closed
eclipseo opened this issue Oct 22, 2023 · 4 comments · Fixed by #742
Closed

Test binding::test::size_of_event fails on i686 / 32 bits arches #740

eclipseo opened this issue Oct 22, 2023 · 4 comments · Fixed by #742

Comments

@eclipseo
Copy link

Hello Team,

The following test fails on arch i686:

failures:
---- binding::test::size_of_event stdout ----
thread 'binding::test::size_of_event' panicked at src/binding.rs:255:9:
assertion `left == right` failed
  left: 16
 right: 32
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
    binding::test::size_of_event
test result: FAILED. 176 passed; 1 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.01s
error: test failed, to rerun pass `--lib`

Environment:

Rustyline 12.0.0
Rust 1.73
Fedora Linux 40 (Rawhide)

@blinxen
Copy link

blinxen commented Oct 22, 2023

This test fails because the size of Event is assumed to be 32, which is only valid for 64bit systems. For 32bit systems the size would be smaller, probably 16bit (maybe more).

@gwenn
Copy link
Collaborator

gwenn commented Oct 23, 2023

#614

This has the effect of reducing the size of the Event enum.

So I guess we can check that the size is smaller than or equals to 32.

@gwenn
Copy link
Collaborator

gwenn commented Oct 23, 2023

we can also use this:
https://doc.rust-lang.org/reference/conditional-compilation.html#target_arch

  #[cfg(target_arch = "x86_64")]
  #[test]
  fn size_of_event() {
    assert_eq!(size_of::<Event>(), 32);
  }

@gwenn
Copy link
Collaborator

gwenn commented Dec 5, 2023

Version 13.0.0 released.

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 a pull request may close this issue.

3 participants