projects
/
gps-watch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
common: Implement Storage::erase() in Mx25l.
[gps-watch.git]
/
test
/
logger_test.rs
diff --git
a/test/logger_test.rs
b/test/logger_test.rs
index a0308218e85d576a96fc665be73a8d48c39a49ab..a254f505db960e7c35959de6a215185503d69aef 100644
(file)
--- a/
test/logger_test.rs
+++ b/
test/logger_test.rs
@@
-68,6
+68,19
@@
impl Storage for FakeStorage {
Ok(())
}
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();
}
fn clear(&mut self) {
self.actual = vec![0xff; MEMORY_SIZE].into_boxed_slice();
}