graphics: Add TestImageSize

This commit is contained in:
Hajime Hoshi 2018-03-02 02:56:53 +09:00
parent d0592d30e0
commit ecf4757809

View File

@ -693,6 +693,21 @@ func TestImageOutsideUpperLeft(t *testing.T) {
} }
} }
func TestImageSize(t *testing.T) {
const (
w = 17
h = 31
)
img, _ := NewImage(w, h, FilterDefault)
gotW, gotH := img.Size()
if gotW != w {
t.Errorf("got: %d, want: %d", gotW, w)
}
if gotH != h {
t.Errorf("got: %d, want: %d", gotH, h)
}
}
func TestImageSize1(t *testing.T) { func TestImageSize1(t *testing.T) {
src, _ := NewImage(1, 1, FilterNearest) src, _ := NewImage(1, 1, FilterNearest)
dst, _ := NewImage(1, 1, FilterNearest) dst, _ := NewImage(1, 1, FilterNearest)