ps_ecc/long/header/methods/
full_length.rs1use crate::long::LongEccHeader;
2
3impl LongEccHeader {
4 #[inline]
6 #[must_use]
7 pub const fn full_length(&self) -> u32 {
8 self.full_length
9 }
10}
11
12#[cfg(test)]
13mod tests {
14 use crate::long::{LongEccHeader, OverlapFactor};
15
16 type TestError = Box<dyn std::error::Error>;
17
18 #[test]
19 fn test_full_length_returns_constructor_value() -> Result<(), TestError> {
20 let header = LongEccHeader::new(2, OverlapFactor::Simple, 86, 50, 0)?;
21
22 assert_eq!(header.full_length(), 86);
23
24 Ok(())
25 }
26
27 #[test]
28 fn test_full_length_maximum_value() -> Result<(), TestError> {
29 let header = LongEccHeader::new(0, OverlapFactor::Simple, u32::MAX, u32::MAX - 32, 0)?;
32
33 assert_eq!(header.full_length(), u32::MAX);
34
35 Ok(())
36 }
37}