diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2016-10-07 18:46:50 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2016-10-07 21:59:37 +0200 |
commit | 7b11e7dabbcaa61c1250451e91367ceacecc9ed4 (patch) | |
tree | 146508c0492f0339b1602e3ea7bf372f521a53f1 /libimagstore | |
parent | d375a6d2c6f031e7c5b602975038992687040d85 (diff) |
Add testing implementation for Drop for FileLockEntry
Diffstat (limited to 'libimagstore')
-rw-r--r-- | libimagstore/src/store.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs index 4172b4b2..a423a059 100644 --- a/libimagstore/src/store.rs +++ b/libimagstore/src/store.rs @@ -879,6 +879,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) { @@ -886,6 +887,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; |