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
Fuzzing: add more fuzzers #1215
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1215 +/- ##
==========================================
- Coverage 64.22% 64.19% -0.03%
==========================================
Files 82 82
Lines 7628 7628
==========================================
- Hits 4899 4897 -2
- Misses 2100 2102 +2
Partials 629 629
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Signed-off-by: AdamKorcz <adam@adalogics.com>
} | ||
defer func() { | ||
keyPath.Close() | ||
os.Remove(keyPath.Name()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to call os.Remove
as the directory (and it's contents) created by t.TempDir()
is removed automatically when the test is finished.
|
||
func FuzzNewFile(f *testing.F) { | ||
f.Fuzz(func(t *testing.T, keyData []byte, keyPass string) { | ||
keyPath, err := os.CreateTemp(t.TempDir(), "keyfile") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rename keyPath
to keyFile
as CreateTemp
returns a *File
, not a path.
Signed-off-by: AdamKorcz adam@adalogics.com
Summary
Adds three more fuzzers.
Release Note
Documentation