Skip to content

Commit 1fcd46d

Browse files
author
Hiro
committed
fuzz: remove unnecessary parallel
Signed-off-by: Hiro <[email protected]>
1 parent 925c50f commit 1fcd46d

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

imageslicer_test.go

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,36 +91,28 @@ func testSlice(t *testing.T, img image.Image, grid [2]uint, short bool) {
9191
func FuzzSlice(f *testing.F) {
9292

9393
func() { //generate corpus
94-
9594
seed := time.Now().UnixNano()
9695
rand.Seed(seed)
9796

9897
f.Logf("[seed] %v", seed)
9998

100-
for i := 0; i < 10; i++ { //TODO add more
99+
for i := 0; i < 20; i++ { //TODO add more
101100
//imgID := rand.Intn(len(images))
102101
//randNo := uint(rand.Intn(500)) + 5 //TODO consider using non squara grids to test the strength
103-
104102
//f.Add(uint(imgID), randNo, randNo)
105103
fuzzer := fuzz.New()
106104
var fuzzInt uint16
107105
fuzzer.Fuzz(&fuzzInt)
108106
f.Add(uint(fuzzInt), uint(fuzzInt), uint(fuzzInt))
109-
110-
if !testing.Short() {
111-
break //short circuiting
112-
}
113107
}
114108
}()
115109

116-
f.Fuzz(func(t *testing.T, imgID uint, rows uint, column uint) {
110+
f.Fuzz(func(t *testing.T, imgID, rows, column uint) {
117111

118112
t.Run(fmt.Sprintf("[%d,%d] %d", rows, column, imgID), func(t *testing.T) {
119113

120114
imgID, rows, column := imgID, rows, column
121115

122-
t.Parallel()
123-
124116
t.Logf("[%d,%d] %d", rows, column, imgID)
125117

126118
if int(imgID) >= len(images) {
@@ -352,7 +344,7 @@ func validateSlices(t *testing.T, srcImg image.Image, tiles []image.Image, grid
352344
shapeI := srcImg.Bounds()
353345
shapeJ := joinedImg.Bounds()
354346

355-
if shapeI != shapeJ {
347+
if !shapeI.Eq(shapeJ) {
356348
t.Log("[SHAPE] pixels lost after split")
357349
}
358350

0 commit comments

Comments
 (0)