mirror of
https://github.com/golang/go
synced 2024-11-23 04:50:06 -07:00
image/jpeg, image/png: replace Fatal with Error in tests
Replaced t.Fatalf with t.Errorf for non-critical errors to footprint more failing testcases for better analysis of the error. Change-Id: Ib4a0ce602b658834684f7266394d84741ace6508 Took 15 minutes
This commit is contained in:
parent
be0e0b06ac
commit
d56aa49bce
@ -49,16 +49,18 @@ func FuzzDecode(f *testing.F) {
|
||||
var w bytes.Buffer
|
||||
err := Encode(&w, img, &Options{Quality: q})
|
||||
if err != nil {
|
||||
t.Fatalf("failed to encode valid image: %s", err)
|
||||
t.Errorf("failed to encode valid image: %s", err)
|
||||
continue
|
||||
}
|
||||
img1, err := Decode(&w)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to decode roundtripped image: %s", err)
|
||||
t.Errorf("failed to decode roundtripped image: %s", err)
|
||||
continue
|
||||
}
|
||||
got := img1.Bounds()
|
||||
want := img.Bounds()
|
||||
if !got.Eq(want) {
|
||||
t.Fatalf("roundtripped image bounds have changed, got: %s, want: %s", got, want)
|
||||
t.Errorf("roundtripped image bounds have changed, got: %s, want: %s", got, want)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -56,16 +56,18 @@ func FuzzDecode(f *testing.F) {
|
||||
e := &Encoder{CompressionLevel: l}
|
||||
err = e.Encode(&w, img)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to encode valid image: %s", err)
|
||||
t.Errorf("failed to encode valid image: %s", err)
|
||||
continue
|
||||
}
|
||||
img1, err := Decode(&w)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to decode roundtripped image: %s", err)
|
||||
t.Errorf("failed to decode roundtripped image: %s", err)
|
||||
continue
|
||||
}
|
||||
got := img1.Bounds()
|
||||
want := img.Bounds()
|
||||
if !got.Eq(want) {
|
||||
t.Fatalf("roundtripped image bounds have changed, got: %s, want: %s", got, want)
|
||||
t.Errorf("roundtripped image bounds have changed, got: %s, want: %s", got, want)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user