diff options
author | Determinant <[email protected]> | 2020-06-11 16:27:56 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2020-06-11 16:27:56 -0400 |
commit | a24f46984d51d8533c5ce85d18566394883fcf4b (patch) | |
tree | 8cbdf7e429b9b6eafec273761d1b879f934fce52 /tests | |
parent | 014ad2e58b647d367621a4324503725eee60e71d (diff) |
...
Diffstat (limited to 'tests')
-rw-r--r-- | tests/common/mod.rs | 19 | ||||
-rw-r--r-- | tests/rand_fail.rs | 6 |
2 files changed, 16 insertions, 9 deletions
diff --git a/tests/common/mod.rs b/tests/common/mod.rs index ce49ec5..def85fb 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -600,7 +600,8 @@ impl PaintingSim { fgen.get_count() } - pub fn check(&self, + pub fn check( + &self, state: &mut WALStoreEmulState, canvas: &mut Canvas, wal: WALLoader, @@ -634,19 +635,25 @@ impl PaintingSim { } } else { let canvas0 = canvas.new_reference(&[]); - if canvas.is_same(&canvas0) { None } - else { - let i0 = ops.len() - self.m - 1; + if canvas.is_same(&canvas0) { + None + } else { + let i0 = ops.len() - self.m; let mut canvas0 = canvas0.new_reference(&ops[..i0]); let mut res = None; 'outer: loop { + if canvas.is_same(&canvas0) { + break; + } for i in i0..ops.len() { canvas0.prepaint(&ops[i], &WALRingId::empty_id()); canvas0.paint_all(); - if canvas.is_same(&canvas0) { break 'outer } + if canvas.is_same(&canvas0) { + break 'outer; + } } res = Some(canvas0); - break + break; } res } diff --git a/tests/rand_fail.rs b/tests/rand_fail.rs index e32ba23..da583b2 100644 --- a/tests/rand_fail.rs +++ b/tests/rand_fail.rs @@ -36,10 +36,10 @@ fn single_point_failure(sim: &common::PaintingSim) { } #[test] -fn test_rand_fail() { +fn single_point_failure1() { let sim = common::PaintingSim { - block_nbit: 8, - file_nbit: 9, + block_nbit: 5, + file_nbit: 6, file_cache: 1000, n: 100, m: 10, |