some more serde tests
Some checks failed
Rust/spacepackets/pipeline/head There was a failure building this commit

This commit is contained in:
2023-12-06 15:17:03 +01:00
parent bf13a432b8
commit 3650507715
8 changed files with 106 additions and 21 deletions

View File

@ -201,7 +201,7 @@ mod tests {
use super::*;
#[cfg(feature = "serde")]
use postcard::{from_bytes, to_allocvec};
use crate::tests::generic_serde_test;
fn verify_state(ack_pdu: &AckPdu, expected_crc_flag: CrcFlag, expected_dir: Direction) {
assert_eq!(ack_pdu.condition_code(), ConditionCode::NoError);
@ -320,7 +320,7 @@ mod tests {
}
#[test]
#[cfg(feature="serde")]
#[cfg(feature = "serde")]
fn test_ack_pdu_serialization() {
let pdu_conf = common_pdu_conf(CrcFlag::WithCrc, LargeFileFlag::Normal);
let pdu_header = PduHeader::new_no_file_data(pdu_conf, 0);
@ -329,7 +329,6 @@ mod tests {
ConditionCode::NoError,
TransactionStatus::Active,
);
let output = to_allocvec(&ack_pdu).unwrap();
assert_eq!(from_bytes::<AckPdu>(&output).unwrap(), ack_pdu);
generic_serde_test(ack_pdu);
}
}