Skip to content

Commit

Permalink
BTreeMap: keep an eye out on the size of the main components
Browse files Browse the repository at this point in the history
  • Loading branch information
ssomers committed Sep 26, 2020
1 parent fd15e61 commit 3e485d7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions library/alloc/src/collections/btree/node/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,12 @@ fn test_splitpoint() {
assert!(left_len + right_len == CAPACITY);
}
}

#[test]
#[cfg(target_arch = "x86_64")]
fn test_sizes() {
assert_eq!(core::mem::size_of::<LeafNode<(), ()>>(), 16);
assert_eq!(core::mem::size_of::<LeafNode<i64, i64>>(), 16 + CAPACITY * 8 * 2);
assert_eq!(core::mem::size_of::<InternalNode<(), ()>>(), 112);
assert_eq!(core::mem::size_of::<InternalNode<i64, i64>>(), 112 + CAPACITY * 8 * 2);
}

0 comments on commit 3e485d7

Please sign in to comment.