From a24f46984d51d8533c5ce85d18566394883fcf4b Mon Sep 17 00:00:00 2001 From: Determinant Date: Thu, 11 Jun 2020 16:27:56 -0400 Subject: ... --- tests/common/mod.rs | 19 +++++++++++++------ tests/rand_fail.rs | 6 +++--- 2 files changed, 16 insertions(+), 9 deletions(-) (limited to 'tests') 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, -- cgit v1.2.3-70-g09d2