From a4d38b39a8e23244bea7a53e9d7a759474f85dae Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 4 May 2020 08:58:32 +0200 Subject: prog: support disabled attribute Update #477 Update #502 --- prog/minimization_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'prog/minimization_test.go') diff --git a/prog/minimization_test.go b/prog/minimization_test.go index 3fde47c77..36b65763d 100644 --- a/prog/minimization_test.go +++ b/prog/minimization_test.go @@ -176,10 +176,11 @@ func TestMinimize(t *testing.T) { func TestMinimizeRandom(t *testing.T) { target, rs, iters := initTest(t) iters /= 10 // Long test. + ct := target.DefaultChoiceTable() r := rand.New(rs) for i := 0; i < iters; i++ { for _, crash := range []bool{false, true} { - p := target.Generate(rs, 5, nil) + p := target.Generate(rs, 5, ct) copyP := p.Clone() minP, _ := Minimize(p, len(p.Calls)-1, crash, func(p1 *Prog, callIndex int) bool { if r.Intn(2) == 0 { @@ -199,9 +200,10 @@ func TestMinimizeRandom(t *testing.T) { func TestMinimizeCallIndex(t *testing.T) { target, rs, iters := initTest(t) + ct := target.DefaultChoiceTable() r := rand.New(rs) for i := 0; i < iters; i++ { - p := target.Generate(rs, 5, nil) + p := target.Generate(rs, 5, ct) ci := r.Intn(len(p.Calls)) p1, ci1 := Minimize(p, ci, r.Intn(2) == 0, func(p1 *Prog, callIndex int) bool { return r.Intn(2) == 0 -- cgit mrf-deployment