Skip to content

Commit

Permalink
TEST: Fix size check test again
Browse files Browse the repository at this point in the history
  • Loading branch information
bluss committed Mar 23, 2021
1 parent b17ea58 commit 27f7f58
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,17 +277,17 @@ fn test_compact_size() {
// 4 elements size + 1 len + 1 enum tag + [1 drop flag]
type ByteArray = ArrayVec<u8, 4>;
println!("{}", mem::size_of::<ByteArray>());
assert!(mem::size_of::<ByteArray>() <= 8);
assert!(mem::size_of::<ByteArray>() <= 4 + mem::size_of::<usize>());

// just length
type EmptyArray = ArrayVec<u8, 0>;
println!("{}", mem::size_of::<EmptyArray>());
assert!(mem::size_of::<EmptyArray>() <= mem::size_of::<usize>());

// 12 element size + 1 enum tag + 3 padding + 1 len + 1 drop flag + 2 padding
// 3 elements + padding + length
type QuadArray = ArrayVec<u32, 3>;
println!("{}", mem::size_of::<QuadArray>());
assert!(mem::size_of::<QuadArray>() <= 24);
assert!(mem::size_of::<QuadArray>() <= 4 * 4 + mem::size_of::<usize>());
}

#[test]
Expand Down

0 comments on commit 27f7f58

Please sign in to comment.