Skip to content

Commit

Permalink
Add test for allocation failure
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianSchmid committed Jun 25, 2024
1 parent 49af07a commit 4cb8949
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/ft/dlt_ft_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,21 @@ mod test {
// test allocation error
{
// TODO
let mut buf = base.clone();
let err = buf.reinit_from_header_pkg(&DltFtHeaderPkg {
file_serial_number: DltFtUInt::U32(1234),
file_name: "file.txt",
file_size: DltFtUInt::U64(usize::MAX as u64),
creation_date: "2024-06-25",
number_of_packages: DltFtUInt::U64(1),
buffer_size: DltFtUInt::U64(usize::MAX as u64),
}).unwrap_err();
assert_eq!(
err,
FtReassembleError::AllocationFailure {
len: usize::MAX
}
);
}
}

Expand Down

0 comments on commit 4cb8949

Please sign in to comment.