temp directory refactoring in many cases

This commit is contained in:
Nikolay Volf
2016-01-31 13:52:07 +04:00
parent 0402887cbf
commit 4ae26aed42
10 changed files with 254 additions and 165 deletions

View File

@@ -19,7 +19,7 @@ pub struct JournalDB {
forward: OverlayDB,
backing: Arc<DB>,
inserts: Vec<H256>,
removes: Vec<H256>,
removes: Vec<H256>
}
impl JournalDB {
@@ -45,6 +45,7 @@ impl JournalDB {
}
/// Create a new instance with an anonymous temporary database.
#[cfg(test)]
pub fn new_temp() -> JournalDB {
let mut dir = env::temp_dir();
dir.push(H32::random().hex());
@@ -137,6 +138,7 @@ mod tests {
use common::*;
use super::*;
use hashdb::*;
use tests::helpers::*;
#[test]
fn long_history() {
@@ -221,4 +223,11 @@ mod tests {
assert!(!jdb.exists(&baz));
assert!(!jdb.exists(&bar));
}
#[test]
fn old_commits_applied() {
let mut dir = env::temp_dir();
dir.push(H32::random().hex());
}
}