summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/common/mod.rs19
-rw-r--r--tests/rand_fail.rs6
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,