aboutsummaryrefslogtreecommitdiffstats
path: root/prog/hints_test.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-10-20 12:23:21 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-10-23 09:59:39 +0200
commit8fa0c867d4e4bbd97321b19ac11115fa7020570a (patch)
tree12d25a05dc84fa5ad849acecc78b8cf073ed3998 /prog/hints_test.go
parent5044885ca2e3e8fd8a368cb497946d994d1bb1ad (diff)
syz-fuzzer: generates hints only for the call that gave new coverage
During smashing we know what call gave new coverage, so we can concentrate just on it. This helps to reduce amount of hints generated (we have too many of them).
Diffstat (limited to 'prog/hints_test.go')
-rw-r--r--prog/hints_test.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/prog/hints_test.go b/prog/hints_test.go
index 31cc13889..9e5c88343 100644
--- a/prog/hints_test.go
+++ b/prog/hints_test.go
@@ -343,18 +343,17 @@ func TestHintsRandom(t *testing.T) {
r := newRand(target, rs)
for i := 0; i < iters; i++ {
p := target.Generate(rs, 5, nil)
- comps := make([]CompMap, len(p.Calls))
for i, c := range p.Calls {
vals := extractValues(c)
for j := 0; j < 5; j++ {
vals[r.randInt()] = true
}
- comps[i] = make(CompMap)
+ comps := make(CompMap)
for v := range vals {
- comps[i].AddComp(v, r.randInt())
+ comps.AddComp(v, r.randInt())
}
+ p.MutateWithHints(i, comps, func(p1 *Prog) {})
}
- p.MutateWithHints(comps, func(p1 *Prog) {})
}
}