Explorar el Código

Add `Block::sec_zero()` test.

ticki hace 8 años
padre
commit
fe9037c256
Se han modificado 1 ficheros con 14 adiciones y 0 borrados
  1. 14 0
      src/block.rs

+ 14 - 0
src/block.rs

@@ -381,6 +381,20 @@ mod test {
         assert_eq!(arr, [0, 2, 0, 2, 255, 255]);
     }
 
+    #[test]
+    #[cfg(feature = "security")]
+    fn sec_zero() {
+        let mut arr = [0u8, 2, 0, 0, 255, 255];
+
+        let block = unsafe {
+            Block::from_raw_parts(Pointer::new(&mut arr[0]), Size(6))
+        };
+
+        block.sec_zero();
+
+        assert_eq!(arr, [0, 0, 0, 0, 0, 0]);
+    }
+
     #[test]
     fn empty_lr() {
         let block = Block::sbrk(Size(26));