Skip to content
Permalink
Browse files

prog/test: rename prog/fuzz to prog/test

gometalinter complained about fuzz.FuzzFoo names,
but go-fuzz now requires all fuzz functions to start with Fuzz.
So move the package to prog/test.
  • Loading branch information...
dvyukov committed Apr 1, 2019
1 parent 36b433b commit 44fe9159be031342cb956bde7dc3f3fa0340d9af
Showing with 12 additions and 12 deletions.
  1. +6 −6 fuzz.yaml
  2. +3 −3 prog/{fuzz → test}/fuzz.go
  3. +3 −3 prog/{fuzz → test}/fuzz_test.go
@@ -18,13 +18,13 @@ targets:
function: Fuzz
package: github.com/google/syzkaller/tools/syz-trace2syz/proggen
build_tags: syz_target syz_os_linux syz_arch_amd64
- name: prog.Deserialize
- name: prog-Deserialize
harness:
function: Deserialize
package: github.com/google/syzkaller/prog/fuzz
function: FuzzDeserialize
package: github.com/google/syzkaller/prog/test
build_tags: syz_target,syz_os_test,syz_arch_64
- name: prog.ParseLog
- name: prog-ParseLog
harness:
function: ParseLog
package: github.com/google/syzkaller/prog/fuzz
function: FuzzParseLog
package: github.com/google/syzkaller/prog/test
build_tags: syz_target,syz_os_test,syz_arch_64
@@ -1,7 +1,7 @@
// Copyright 2019 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 fuzz
package test

import (
"bytes"
@@ -12,7 +12,7 @@ import (
_ "github.com/google/syzkaller/sys/test/gen" // import the target we use for fuzzing
)

func Deserialize(data []byte) int {
func FuzzDeserialize(data []byte) int {
p0, err0 := fuzzTarget.Deserialize(data, prog.NonStrict)
p1, err1 := fuzzTarget.Deserialize(data, prog.Strict)
if p0 == nil {
@@ -56,7 +56,7 @@ func Deserialize(data []byte) int {
return 0
}

func ParseLog(data []byte) int {
func FuzzParseLog(data []byte) int {
if len(fuzzTarget.ParseLog(data)) != 0 {
return 1
}
@@ -1,7 +1,7 @@
// Copyright 2019 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 fuzz
package test

import (
"testing"
@@ -24,7 +24,7 @@ mutate8()
`,
} {
t.Logf("test #%v: %q", i, string(data))
Deserialize([]byte(data))
ParseLog([]byte(data))
FuzzDeserialize([]byte(data))
FuzzParseLog([]byte(data))
}
}

0 comments on commit 44fe915

Please sign in to comment.
You can’t perform that action at this time.