Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing: report line number for F.Add call with mismatched type #48302

Open
jayconrod opened this issue Sep 9, 2021 · 1 comment
Open

testing: report line number for F.Add call with mismatched type #48302

jayconrod opened this issue Sep 9, 2021 · 1 comment
Labels
fuzz Issues related to native fuzzing support NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@jayconrod
Copy link
Contributor

If F.Add is called with values with types that don't match the fuzz function's parameter types, f.Fuzz reports a fatal error and exits.

func Fuzz(f *testing.F) {
  f.Add("string not bytes")
  f.Fuzz(func(t *testing.T, b []byte) { ... })
}

The error message should point to the location where F.Add was called to make the error easy to correct.

A vet check (#46218) should report errors for these calls at build time.

@jayconrod jayconrod added NeedsFix The path to resolution is known, but the work has not been done. fuzz Issues related to native fuzzing support labels Sep 9, 2021
@jayconrod jayconrod added this to the Backlog milestone Sep 9, 2021
@rsc rsc changed the title [dev.fuzz] testing: report line number for F.Add call with mismatched type testing: report line number for F.Add call with mismatched type Sep 21, 2021
@gopherbot
Copy link

Change https://go.dev/cl/395374 mentions this issue: testing: report line number for F.Add call with mismatched type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fuzz Issues related to native fuzzing support NeedsFix The path to resolution is known, but the work has not been done.
Projects
Status: No status
Development

No branches or pull requests

2 participants