Skip to content

Commit

Permalink
run size tests only on 64bit platforms (#125)
Browse files Browse the repository at this point in the history
We have some size tests in the histogram crate that are sensitive to the platform pointer width. As such, they fail on 32bit systems as reported in #123

This change restricts these tests to only run on platforms with the expected pointer width.
  • Loading branch information
brayniac authored Oct 31, 2024
1 parent d0b010c commit c2fe95f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions histogram/src/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ impl AtomicHistogram {
mod test {
use crate::*;

#[cfg(target_pointer_width = "64")]
#[test]
fn size() {
assert_eq!(std::mem::size_of::<AtomicHistogram>(), 48);
Expand Down
1 change: 1 addition & 0 deletions histogram/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ impl Config {
mod tests {
use super::*;

#[cfg(target_pointer_width = "64")]
#[test]
fn sizes() {
assert_eq!(std::mem::size_of::<Config>(), 32);
Expand Down
1 change: 1 addition & 0 deletions histogram/src/standard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ mod tests {
use super::*;
use rand::Rng;

#[cfg(target_pointer_width = "64")]
#[test]
fn size() {
assert_eq!(std::mem::size_of::<Histogram>(), 48);
Expand Down

0 comments on commit c2fe95f

Please sign in to comment.