Skip to content

Commit

Permalink
image/png: minor cleanup of a few tests
Browse files Browse the repository at this point in the history
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í <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
  • Loading branch information
iand authored and mvdan committed Sep 16, 2018
1 parent adcecbe commit 930ce09
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions src/image/png/reader_test.go
Expand Up @@ -364,10 +364,6 @@ func TestReader(t *testing.T) {
}
defer sf.Close()
sb := bufio.NewScanner(sf)
if err != nil {
t.Error(fn, err)
continue
}

// Compare the two, in SNG format, line by line.
for {
Expand Down
4 changes: 2 additions & 2 deletions src/image/png/writer_test.go
Expand Up @@ -61,12 +61,12 @@ func TestWriter(t *testing.T) {
m1, err := readPNG(qfn)
if err != nil {
t.Error(fn, err)
return
continue
}
m2, err := encodeDecode(m1)
if err != nil {
t.Error(fn, err)
return
continue
}
// Compare the two.
err = diff(m0, m2)
Expand Down

0 comments on commit 930ce09

Please sign in to comment.