diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2022-11-22 12:03:55 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2022-11-23 09:09:39 +0100 |
| commit | caddc6cbcef9933a4539a06714df006e0c5ac7b2 (patch) | |
| tree | a1c058c702d31527eb9a183f8115f73d6945776b /pkg/csource | |
| parent | 75740b3f90c81d4c226b0e30eec947df4fbd6832 (diff) | |
pkg/testutil: add RandSource helper
The code to send rand source is dublicated in several packages.
Move it to testutil package.
Diffstat (limited to 'pkg/csource')
| -rw-r--r-- | pkg/csource/csource_test.go | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/pkg/csource/csource_test.go b/pkg/csource/csource_test.go index bfeb8f6a7..2d047cc10 100644 --- a/pkg/csource/csource_test.go +++ b/pkg/csource/csource_test.go @@ -12,7 +12,6 @@ import ( "strings" "sync/atomic" "testing" - "time" "github.com/google/syzkaller/pkg/testutil" "github.com/google/syzkaller/prog" @@ -59,12 +58,7 @@ func TestGenerate(t *testing.T) { } func testTarget(t *testing.T, target *prog.Target, full bool) { - seed := time.Now().UnixNano() - if os.Getenv("CI") != "" { - seed = 0 // required for deterministic coverage reports - } - rs := rand.NewSource(seed) - t.Logf("seed=%v", seed) + rs := testutil.RandSource(t) p := target.Generate(rs, 10, target.DefaultChoiceTable()) // Turns out that fully minimized program can trigger new interesting warnings, // e.g. about NULL arguments for functions that require non-NULL arguments in syz_ functions. |
