Skip to content

Commit

Permalink
add repro case
Browse files Browse the repository at this point in the history
  • Loading branch information
james-rms committed Dec 19, 2024
1 parent c99a5f1 commit 3503d2e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
21 changes: 21 additions & 0 deletions rust/src/sans_io/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1101,4 +1101,25 @@ mod tests {
}
Ok(())
}

#[test]
fn test_decompression_does_not_fail() {
let mut f = std::fs::File::open("tests/data/break_zstd_decompression.mcap")
.expect("failed to open file");
let blocksize: usize = 1024;
let mut reader = LinearReader::new();
while let Some(action) = reader.next_action() {
match action.expect("failed to get next action") {
ReadAction::GetRecord { data: _, opcode } => {
print!("{},", opcode);
}
ReadAction::NeedMore(_) => {
let read = f
.read(reader.insert(blocksize))
.expect("failed to read from file");
reader.set_written(read);
}
}
}
}
}
3 changes: 3 additions & 0 deletions rust/tests/data/break_zstd_decompression.mcap
Git LFS file not shown

0 comments on commit 3503d2e

Please sign in to comment.