From a99c632cb7c8b60a1b85e5c6e00fc98bd55b4fbe Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 3 Feb 2018 17:20:07 +0900 Subject: [PATCH] graphics: Add TestImageSize1 --- image_test.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/image_test.go b/image_test.go index 9dae7fe68..c232135d3 100644 --- a/image_test.go +++ b/image_test.go @@ -693,7 +693,19 @@ func TestImageOutsideUpperLeft(t *testing.T) { } } -func TestImage4096(t *testing.T) { +func TestImageSize1(t *testing.T) { + src, _ := NewImage(1, 1, FilterNearest) + dst, _ := NewImage(1, 1, FilterNearest) + src.Fill(color.White) + dst.DrawImage(src, nil) + got := color.RGBAModel.Convert(src.At(0, 0)).(color.RGBA) + want := color.RGBAModel.Convert(color.White).(color.RGBA) + if !sameColors(got, want, 1) { + t.Errorf("got: %#v, want: %#v", got, want) + } +} + +func TestImageSize4096(t *testing.T) { src, _ := NewImage(4096, 4096, FilterNearest) dst, _ := NewImage(4096, 4096, FilterNearest) pix := make([]byte, 4096*4096*4)