summaryrefslogtreecommitdiffstats
path: root/libimagstore
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2016-10-07 18:46:50 +0200
committerMatthias Beyer <mail@beyermatthias.de>2016-10-07 21:18:49 +0200
commitcf50ddae3380c1736b17f3e31c529d1e8d3361b8 (patch)
tree928ecbf614da08df8ee05073cddffef4d43cdf0c /libimagstore
parent485d2802367338892ae4f774b7a39038ec0068b7 (diff)
[CHERRY-PICK] Add testing implementation for Drop for FileLockEntry
Diffstat (limited to 'libimagstore')
-rw-r--r--libimagstore/src/store.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs
index 242fe10a..5ce2bc6c 100644
--- a/libimagstore/src/store.rs
+++ b/libimagstore/src/store.rs
@@ -924,6 +924,7 @@ impl<'a> DerefMut for FileLockEntry<'a> {
}
}
+#[cfg(not(test))]
impl<'a> Drop for FileLockEntry<'a> {
/// This will silently ignore errors, use `Store::update` if you want to catch the errors
fn drop(&mut self) {
@@ -931,6 +932,15 @@ impl<'a> Drop for FileLockEntry<'a> {
}
}
+#[cfg(test)]
+impl<'a> Drop for FileLockEntry<'a> {
+ /// This will not silently ignore errors but prints the result of the _update() call for testing
+ fn drop(&mut self) {
+ println!("Drop Result: {:?}", self.store._update(self));
+ }
+}
+
+
/// `EntryContent` type
pub type EntryContent = String;