Skip to content

Commit

Permalink
Ensure padding a frozen view buffer won't resize, and have to move the
Browse files Browse the repository at this point in the history
vec
  • Loading branch information
Dr-Emann committed Feb 3, 2023
1 parent 76db525 commit 68f13e0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions croaring/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ fn test_portable_view() {
#[test]
fn test_frozen_view() {
let mut buffer = fs::read("tests/data/frozen_bitmap.bin").unwrap();
// Ensure inserting zeros won't move the data
buffer.reserve(32);
let offset = 32 - (buffer.as_ptr() as usize) % 32;
buffer.splice(..0, iter::repeat(0).take(offset));

Expand Down

0 comments on commit 68f13e0

Please sign in to comment.