aboutsummaryrefslogtreecommitdiff
path: root/tests/rand_fail.rs
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2020-06-10 22:50:38 -0400
committerDeterminant <[email protected]>2020-06-10 22:50:38 -0400
commit350f2638cb3e15df231381b8fd286595058b7a54 (patch)
tree0109ab503043e7e325bc18cd03288b19f7ba28ef /tests/rand_fail.rs
parent557392fe0672bc6b83ef2e0fec2c8ff7a6f22a54 (diff)
add closure to WALStoreEmul
Diffstat (limited to 'tests/rand_fail.rs')
-rw-r--r--tests/rand_fail.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/rand_fail.rs b/tests/rand_fail.rs
index 0cd519c..6c2c3c1 100644
--- a/tests/rand_fail.rs
+++ b/tests/rand_fail.rs
@@ -41,21 +41,22 @@ fn run<F: WALStore, R: rand::Rng>(n: usize, m: usize, k: usize,
Ok(())
}
-fn check<F: WALStore>(canvas: &mut Canvas, wal: &mut WALLoader<F>, trace: &Vec<u8>) -> bool {
+fn check<F: WALStore>(canvas: &mut Canvas, wal: &mut WALLoader<F>, trace: &Vec<u32>) -> bool {
true
}
#[test]
fn test_rand_fail() {
- let fgen = SingleFailGen::new(100000);
+ let fgen = SingleFailGen::new(100);
let n = 100;
let m = 10;
let k = 100;
let mut rng = rand::thread_rng();
let mut state = WALStoreEmulState::new();
- let mut wal = WALLoader::new(WALStoreEmul::new(&mut state, fgen), 9, 8, 1000).recover().unwrap();
+ let mut wal = WALLoader::new(WALStoreEmul::new(&mut state, fgen, |_, _|{}), 9, 8, 1000).recover().unwrap();
let mut trace: Vec<u32> = Vec::new();
let mut canvas = Canvas::new(1000);
- run(n, m, k, &mut canvas, &mut wal, &mut trace, &mut rng).unwrap();
- WALLoader::new(common::WALStoreEmul::new(&mut state, common::ZeroFailGen), 9, 8, 1000).recover().unwrap();
+ run(n, m, k, &mut canvas, &mut wal, &mut trace, &mut rng); //.unwrap();
+ let mut wal = WALLoader::new(WALStoreEmul::new(&mut state, common::ZeroFailGen, |payload, wal_off|{}), 9, 8, 1000);
+ assert!(check(&mut canvas, &mut wal, &trace));
}