syzkaller/prog/checksum_test.go
Dmitry Vyukov 3645389673 pkg/csource: fix handling of proc types
Generated program always uses pid=0 even when there are multiple processes.
Make each process use own pid.

Unfortunately required to do quite significant changes to prog,
because the current format only supported fixed pid.

Fixes #490
2017-12-22 11:59:46 +01:00

28 lines
632 B
Go

// Copyright 2016 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
package prog_test
import (
"testing"
. "github.com/google/syzkaller/prog"
_ "github.com/google/syzkaller/sys"
)
func TestChecksumCalcRandom(t *testing.T) {
target, rs, iters := InitTest(t)
for i := 0; i < iters; i++ {
p := target.Generate(rs, 10, nil)
for _, call := range p.Calls {
CalcChecksumsCall(call)
}
for try := 0; try <= 10; try++ {
p.Mutate(rs, 10, nil, nil)
for _, call := range p.Calls {
CalcChecksumsCall(call)
}
}
}
}