added small defmt test
Rust/spacepackets/pipeline/head This commit looks good Details

This commit is contained in:
Robin Müller 2024-04-04 16:35:22 +02:00
parent 9e02e00d1a
commit 50c56f6504
Signed by: muellerr
GPG Key ID: A649FB78196E3849
1 changed files with 14 additions and 0 deletions

View File

@ -893,6 +893,8 @@ pub mod zc {
pub(crate) mod tests {
use std::collections::HashSet;
#[allow(unused_imports)]
use crate::ByteConversionError;
#[cfg(feature = "serde")]
use crate::CcsdsPrimaryHeader;
use crate::{
@ -1266,4 +1268,16 @@ pub(crate) mod tests {
let sp_header = SpHeader::new_from_apid_checked(0x03).unwrap();
assert_eq!(sp_header.apid(), 0x03);
}
#[cfg(feature = "defmt")]
fn is_defmt_format<T: defmt::Format>(_t: T) {}
#[test]
#[cfg(feature = "defmt")]
fn test_defmt_format() {
is_defmt_format(ByteConversionError::ToSliceTooSmall {
found: 1,
expected: 2,
});
}
}