Skip to content

Commit 32db4f5

Browse files
committed
TEST: Fix size check test again
1 parent b17ea58 commit 32db4f5

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tests/tests.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,21 +273,20 @@ fn test_is_send_sync() {
273273

274274
#[test]
275275
fn test_compact_size() {
276-
// Future rust will kill these drop flags!
277-
// 4 elements size + 1 len + 1 enum tag + [1 drop flag]
276+
// 4 bytes + padding + length
278277
type ByteArray = ArrayVec<u8, 4>;
279278
println!("{}", mem::size_of::<ByteArray>());
280-
assert!(mem::size_of::<ByteArray>() <= 8);
279+
assert!(mem::size_of::<ByteArray>() <= 2 * mem::size_of::<usize>());
281280

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

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

293292
#[test]

0 commit comments

Comments
 (0)