Quellcode durchsuchen

chore(wire/ipv6routing): test vectors initial 0xff

Using 0xff filled buffers as test vectors to ensure that the reserved
fields are cleared to 0.
Thibaut Vandervelden vor 1 Jahr
Ursprung
Commit
6eccf51643
1 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen
  1. 3 3
      src/wire/ipv6routing.rs

+ 3 - 3
src/wire/ipv6routing.rs

@@ -581,17 +581,17 @@ mod test {
 
     #[test]
     fn test_repr_emit() {
-        let mut bytes = [0u8; 22];
+        let mut bytes = [0xFFu8; 22];
         let mut header = Header::new_unchecked(&mut bytes[..]);
         REPR_TYPE2.emit(&mut header);
         assert_eq!(header.into_inner(), &BYTES_TYPE2[..]);
 
-        let mut bytes = [0u8; 38];
+        let mut bytes = [0xFFu8; 38];
         let mut header = Header::new_unchecked(&mut bytes[..]);
         REPR_SRH_FULL.emit(&mut header);
         assert_eq!(header.into_inner(), &BYTES_SRH_FULL[..]);
 
-        let mut bytes = [0u8; 14];
+        let mut bytes = [0xFFu8; 14];
         let mut header = Header::new_unchecked(&mut bytes[..]);
         REPR_SRH_ELIDED.emit(&mut header);
         assert_eq!(header.into_inner(), &BYTES_SRH_ELIDED[..]);