Coverage Update #47

Merged
muellerr merged 35 commits from coverage-update into main 2023-12-06 18:05:57 +01:00
2 changed files with 19 additions and 0 deletions
Showing only changes of commit 4945ea804d - Show all commits

View File

@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
`PusError::ByteConversionError` variant.
- Ranamed `TlvLvError::ByteConversionError` to `TlvLvError::ByteConversion`.
- Renamed `PusError::IncorrectCrc` to `PusError::ChecksumFailure`.
- Some more struct variant changes for error enumerations.
## Removed

View File

@ -1233,4 +1233,22 @@ mod tests {
panic!("unexpected error {error}")
}
}
#[test]
fn test_reader_input_too_small() {
let buf: [u8; 5] = [0; 5];
let error = PusTcReader::new(&buf);
assert!(error.is_err());
let error = error.unwrap_err();
if let PusError::ByteConversion(ByteConversionError::FromSliceTooSmall {
found,
expected,
}) = error
{
assert_eq!(found, 5);
assert_eq!(expected, PUS_TC_MIN_LEN_WITHOUT_APP_DATA);
} else {
panic!("unexpected error {error}")
}
}
}