aboutsummaryrefslogtreecommitdiff
path: root/tests/rand_fail.rs
blob: d129e4fff8053b5c0578f24031a044621aa2bb04 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#[cfg(test)]

mod common;

fn single_point_failure(sim: &common::PaintingSim) {
    let nticks = sim.get_nticks();
    println!("nticks = {}", nticks);
    for i in 0..nticks {
        print!("fail pos = {}, ", i);
        assert!(sim.test(common::SingleFailGen::new(i)));
    }
}

#[test]
fn test_rand_fail() {
    let sim = common::PaintingSim {
        block_nbit: 8,
        file_nbit: 9,
        file_cache: 1000,
        n: 100,
        m: 10,
        k: 100,
        csize: 1000,
        stroke_max_len: 10,
        stroke_max_col: 256,
        stroke_max_n: 5,
        seed: 0
    };
    single_point_failure(&sim);
}