summaryrefslogtreecommitdiff
path: root/binarize
diff options
context:
space:
mode:
authorNick White <git@njw.name>2019-05-13 17:29:00 +0100
committerNick White <git@njw.name>2019-05-13 17:29:00 +0100
commit1ac5035ef55d2f97d1b98a309d83a09a84395e07 (patch)
tree0fb61dff0638fa5b4468797f547707201919aaac /binarize
parent6b7cc0cd671db9c8ff89eea1686099c48dba412a (diff)
Improve error handling in sauvola tests
Diffstat (limited to 'binarize')
-rw-r--r--binarize/sauvola_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/binarize/sauvola_test.go b/binarize/sauvola_test.go
index a95b6be..5faeb61 100644
--- a/binarize/sauvola_test.go
+++ b/binarize/sauvola_test.go
@@ -75,7 +75,7 @@ func TestBinarization(t *testing.T) {
var actual *image.Gray
orig, err := decode(c.orig)
if err != nil {
- t.Errorf("Could not open file %s: %v\n", c.orig, err)
+ t.Fatalf("Could not open file %s: %v\n", c.orig, err)
}
switch c.name {
case "integralsauvola":
@@ -89,16 +89,16 @@ func TestBinarization(t *testing.T) {
f, err := os.Create(c.golden)
defer f.Close()
if err != nil {
- t.Errorf("Could not open file %s to update: %v\n", c.golden, err)
+ t.Fatalf("Could not open file %s to update: %v\n", c.golden, err)
}
err = png.Encode(f, actual)
if err != nil {
- t.Errorf("Could not encode update of %s: %v\n", c.golden, err)
+ t.Fatalf("Could not encode update of %s: %v\n", c.golden, err)
}
}
golden, err := decode(c.golden)
if err != nil {
- t.Errorf("Could not open file %s: %v\n", c.golden, err)
+ t.Fatalf("Could not open file %s: %v\n", c.golden, err)
}
if ! imgsequal(golden, actual) {
t.Errorf("Binarized %s differs to %s\n", c.orig, c.golden)