Coverage Update #47

Merged
muellerr merged 35 commits from coverage-update into main 2023-12-06 18:05:57 +01:00
24 changed files with 2151 additions and 640 deletions
Showing only changes of commit 3818dcd46f - Show all commits

View File

@@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## Changed ## Changed
- Renamed `SerializablePusPacket` to `WritablePusPacket`. - Renamed `SerializablePusPacket` to `WritablePusPacket`.
- Renamed `UnsignedPfc` to `PfcUnsigned` and `RealPfc` to `PfcReal`.
- Renamed `WritablePduPacket.written_len` and `SerializablePusPacket.len_packed` to `len_written`. - Renamed `WritablePduPacket.written_len` and `SerializablePusPacket.len_packed` to `len_written`.
- Introduce custom implementation of `PartialEq` for `CommonPduConfig` which only compares the - Introduce custom implementation of `PartialEq` for `CommonPduConfig` which only compares the
values for the source entity ID, destination entity ID and transaction sequence number field to values for the source entity ID, destination entity ID and transaction sequence number field to

View File

@@ -120,7 +120,7 @@ pub type Ptc = PacketTypeCodes;
#[derive(Debug, Copy, Clone, Eq, PartialEq, IntoPrimitive, TryFromPrimitive)] #[derive(Debug, Copy, Clone, Eq, PartialEq, IntoPrimitive, TryFromPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[repr(u8)] #[repr(u8)]
pub enum UnsignedPfc { pub enum PfcUnsigned {
OneByte = 4, OneByte = 4,
TwelveBits = 8, TwelveBits = 8,
TwoBytes = 12, TwoBytes = 12,
@@ -137,7 +137,7 @@ pub enum UnsignedPfc {
#[derive(Debug, Copy, Clone, Eq, PartialEq, IntoPrimitive, TryFromPrimitive)] #[derive(Debug, Copy, Clone, Eq, PartialEq, IntoPrimitive, TryFromPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[repr(u8)] #[repr(u8)]
pub enum RealPfc { pub enum PfcReal {
/// 4 octets simple precision format (IEEE) /// 4 octets simple precision format (IEEE)
Float = 1, Float = 1,
/// 8 octets simple precision format (IEEE) /// 8 octets simple precision format (IEEE)
@@ -483,16 +483,16 @@ mod tests {
#[test] #[test]
fn test_unsigned_pfc_from_u8() { fn test_unsigned_pfc_from_u8() {
let pfc_raw = UnsignedPfc::OneByte as u8; let pfc_raw = PfcUnsigned::OneByte as u8;
let pfc = UnsignedPfc::try_from(pfc_raw).unwrap(); let pfc = PfcUnsigned::try_from(pfc_raw).unwrap();
assert_eq!(pfc, UnsignedPfc::OneByte); assert_eq!(pfc, PfcUnsigned::OneByte);
} }
#[test] #[test]
fn test_real_pfc_from_u8() { fn test_real_pfc_from_u8() {
let pfc_raw = RealPfc::Double as u8; let pfc_raw = PfcReal::Double as u8;
let pfc = RealPfc::try_from(pfc_raw).unwrap(); let pfc = PfcReal::try_from(pfc_raw).unwrap();
assert_eq!(pfc, RealPfc::Double); assert_eq!(pfc, PfcReal::Double);
} }
#[test] #[test]