Skip to content

Commit 930ce09

Browse files
iandmvdan
authored andcommitted
image/png: minor cleanup of a few tests
Removes a redundant err check and replaces some returns in a testing loop with continue to prevent skipping unrelated test cases when a failure is encountered. Change-Id: Ic1a560751b95bb0ef8dfa957e057e0fa0c2b281d Reviewed-on: https://go-review.googlesource.com/134236 Run-TryBot: Daniel Martí <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Daniel Martí <[email protected]>
1 parent adcecbe commit 930ce09

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/image/png/reader_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -364,10 +364,6 @@ func TestReader(t *testing.T) {
364364
}
365365
defer sf.Close()
366366
sb := bufio.NewScanner(sf)
367-
if err != nil {
368-
t.Error(fn, err)
369-
continue
370-
}
371367

372368
// Compare the two, in SNG format, line by line.
373369
for {

src/image/png/writer_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ func TestWriter(t *testing.T) {
6161
m1, err := readPNG(qfn)
6262
if err != nil {
6363
t.Error(fn, err)
64-
return
64+
continue
6565
}
6666
m2, err := encodeDecode(m1)
6767
if err != nil {
6868
t.Error(fn, err)
69-
return
69+
continue
7070
}
7171
// Compare the two.
7272
err = diff(m0, m2)

0 commit comments

Comments
 (0)