Skip to content

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

@jayconrod

Description

@jayconrod

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsFixThe path to resolution is known, but the work has not been done.fuzzIssues related to native fuzzing support

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions