From 1ac5035ef55d2f97d1b98a309d83a09a84395e07 Mon Sep 17 00:00:00 2001 From: Nick White Date: Mon, 13 May 2019 17:29:00 +0100 Subject: Improve error handling in sauvola tests --- binarize/sauvola_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'binarize/sauvola_test.go') 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) -- cgit v1.2.1-24-ge1ad