common: Implement Storage::erase() in Mx25l.
[gps-watch.git] / test / logger_test.rs
index a0308218e85d576a96fc665be73a8d48c39a49ab..a254f505db960e7c35959de6a215185503d69aef 100644 (file)
@@ -68,6 +68,19 @@ impl Storage for FakeStorage {
         Ok(())
     }
 
+    fn erase(&mut self, address: usize) -> Result<(), Error> {
+        if (address & 4095) != 0 {
+            return Err(Error::UnalignedAddress);
+        }
+
+        for i in 0..4096 {
+            self.actual[address + i] = 0xff;
+        }
+
+        Ok(())
+
+    }
+
     fn clear(&mut self) {
         self.actual = vec![0xff; MEMORY_SIZE].into_boxed_slice();
     }