From c135ec2f6a34116f63ebbdfde25001b21d560f24 Mon Sep 17 00:00:00 2001 From: Arjun Singh Date: Sun, 1 Oct 2023 14:53:58 +0530 Subject: fuzzing : fuzz testing support for oss-fuzz integration Signed-off-by: Arjun Singh --- plumbing/format/packfile/delta_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'plumbing/format/packfile') diff --git a/plumbing/format/packfile/delta_test.go b/plumbing/format/packfile/delta_test.go index e8f5ea6..9417e55 100644 --- a/plumbing/format/packfile/delta_test.go +++ b/plumbing/format/packfile/delta_test.go @@ -4,6 +4,7 @@ import ( "bytes" "io" "math/rand" + "testing" "github.com/go-git/go-git/v5/plumbing" . "gopkg.in/check.v1" @@ -176,3 +177,14 @@ func (s *DeltaSuite) TestMaxCopySizeDeltaReader(c *C) { c.Assert(err, IsNil) c.Assert(result, DeepEquals, targetBuf) } + +func FuzzPatchDelta(f *testing.F) { + + f.Fuzz(func(t *testing.T, input []byte) { + + input_0 := input[:len(input)/2] + input_1 := input[len(input)/2:] + + PatchDelta(input_0, input_1) + }) +} -- cgit