(f *testing.F)
| 30 | ) |
| 31 | |
| 32 | func FuzzDiffApply(f *testing.F) { |
| 33 | f.Fuzz(func(t *testing.T, data []byte) { |
| 34 | f := fuzz.NewConsumer(data) |
| 35 | mountsQty, err := f.GetInt() |
| 36 | if err != nil { |
| 37 | return |
| 38 | } |
| 39 | mounts := make([]mount.Mount, 0) |
| 40 | for i := 0; i < mountsQty%30; i++ { |
| 41 | m := mount.Mount{} |
| 42 | err = f.GenerateStruct(&m) |
| 43 | if err != nil { |
| 44 | return |
| 45 | } |
| 46 | mounts = append(mounts, m) |
| 47 | } |
| 48 | desc := ocispec.Descriptor{} |
| 49 | err = f.GenerateStruct(&desc) |
| 50 | if err != nil { |
| 51 | return |
| 52 | } |
| 53 | tmpDir := t.TempDir() |
| 54 | cs, err := local.NewStore(tmpDir) |
| 55 | if err != nil { |
| 56 | return |
| 57 | } |
| 58 | fsa := apply.NewFileSystemApplier(cs) |
| 59 | _, _ = fsa.Apply(context.Background(), desc, mounts) |
| 60 | }) |
| 61 | } |
| 62 | |
| 63 | func FuzzDiffCompare(f *testing.F) { |
| 64 | f.Fuzz(func(t *testing.T, data []byte) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…