From 7013cb0d7d7b78bb0160c45d13a8d7d472835513 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 7 Aug 2024 15:16:35 +0200 Subject: prog: replace MinimizeParams with MinimizeMode All callers shouldn't control lots of internal details of minimization (if we have more params, that's just more variations to test, and we don't have more, params is just a more convoluted way to say if we minimize for corpus or a crash). 2 bools also allow to express 4 options, but only 3 make sense. Also when I see MinimizeParams{} in the code, it's unclear what it means. Replace params with mode. And potentially "crash" minimization is not "light", it's just different. E.g. we can simplify int arguments for reproducers (esp in snapshot mode), but we don't need that for corpus. --- prog/rand_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'prog/rand_test.go') diff --git a/prog/rand_test.go b/prog/rand_test.go index d1e963595..b165bd410 100644 --- a/prog/rand_test.go +++ b/prog/rand_test.go @@ -72,8 +72,8 @@ func generateProg(t *testing.T, target *Target, rs rand.Source, ct *ChoiceTable, return limit > 0 }) } - for _, crash := range []bool{false, true} { - p, _ = Minimize(p, -1, MinimizeParams{Light: crash}, func(*Prog, int) bool { + for _, mode := range []MinimizeMode{MinimizeCorpus, MinimizeCrash} { + p, _ = Minimize(p, -1, mode, func(*Prog, int) bool { return rs.Int63()%10 == 0 }) } -- cgit mrf-deployment