kornelski/xml-rs

test for exact size of SyntaxError in memory fails depending on architecture

decathorpe opened this issue · 2 comments

We're running this crate's test suite as part of our package builds in Fedora Linux, and I've noticed that one of the recently added tests (reader::error::err_size, seems to have been added between v0.8.9 and v0.8.10) fails depending on the host architecture:
https://github.com/kornelski/xml-rs/blob/0.8.11/src/reader/error.rs#L247-L250

For example, on i686 (32-bit x86) the size of the enum is not 24 bytes but 16:

---- reader::error::err_size stdout ----
thread 'reader::error::err_size' panicked at 'assertion failed: `(left == right)`
  left: `24`,
 right: `16`', src/reader/error.rs:249:5

The exact size in memory of the SyntaxError enum might be different on additional architectures that are not available in our infrastructure (i.e. not any of x86_64, i686, aarch64, powerpc64le, or s390x).

I've manually filtered out this test for now, but it might make sense to adapt the test or wrap it with something like #[cfg(target_pointer_width = 64)]?

Thanks. Fixed.

Thanks!