From 4cb749899583463237cc05e78980dda218bca88c Mon Sep 17 00:00:00 2001 From: "Anthony N. Simon" Date: Thu, 25 Aug 2016 18:24:48 +0200 Subject: [PATCH] Remove duplicate functionality --- segmentation_test.go | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/segmentation_test.go b/segmentation_test.go index 75b27c3..42631d7 100644 --- a/segmentation_test.go +++ b/segmentation_test.go @@ -1,7 +1,6 @@ package bild import ( - "fmt" "image" "testing" ) @@ -93,20 +92,7 @@ func TestThreshold(t *testing.T) { for _, c := range cases { actual := Threshold(c.img, c.level) if !grayscaleImageEqual(actual, c.expected) { - t.Error(testFailMessage("Threshold", formatGrayImageString(c.expected), formatGrayImageString(actual))) + t.Error(testFailMessage("Threshold", formatImageGrayString(c.expected), formatImageGrayString(actual))) } } } - -func formatGrayImageString(img *image.Gray) string { - var result string - for y := 0; y < img.Bounds().Dy(); y++ { - result += "\n" - for x := 0; x < img.Bounds().Dx(); x++ { - pos := y*img.Stride + x - result += fmt.Sprintf("%#X, ", img.Pix[pos]) - } - } - result += "\n" - return result -}