test(body): fix Body size of tests on 32-bit architecture

Closes #2158
This commit is contained in:
Sean McArthur
2020-03-24 11:44:35 -07:00
parent 22fcd66241
commit 597cef225e

View File

@@ -565,17 +565,17 @@ mod tests {
fn test_size_of() { fn test_size_of() {
// These are mostly to help catch *accidentally* increasing // These are mostly to help catch *accidentally* increasing
// the size by too much. // the size by too much.
assert_eq!(
mem::size_of::<Body>(), let body_size = mem::size_of::<Body>();
mem::size_of::<usize>() * 5 + mem::size_of::<u64>(), let body_expected_size = mem::size_of::<u64>() * 6;
"Body" assert!(
body_size <= body_expected_size,
"Body size = {} <= {}",
body_size,
body_expected_size,
); );
assert_eq!( assert_eq!(body_size, mem::size_of::<Option<Body>>(), "Option<Body>");
mem::size_of::<Body>(),
mem::size_of::<Option<Body>>(),
"Option<Body>"
);
assert_eq!( assert_eq!(
mem::size_of::<Sender>(), mem::size_of::<Sender>(),