added eof creation
All checks were successful
Rust/sat-rs/pipeline/pr-main This commit looks good

This commit is contained in:
Robin Müller 2023-09-02 23:52:50 +02:00
parent 1a38de760a
commit 40c8c36af3
Signed by: muellerr
GPG Key ID: FCE0B2BD2195142F

View File

@ -733,6 +733,14 @@ mod tests {
panic!("destination handler packet insertion error: {e}");
}
// TODO: Send EOF PDU and verify completion of transaction
let mut digest = CRC_32.digest();
digest.update(file_data);
let crc32 = digest.finalize();
let eof_pdu = EofPdu::new_no_error(pdu_header, crc32, file_data.len() as u64);
let result = eof_pdu.write_to_bytes(&mut buf);
assert!(result.is_ok());
let packet_info = PacketInfo::new(&buf).expect("generating packet info failed");
let result = dest_handler.insert_packet(&packet_info);
assert!(result.is_ok());
}
}