graphics: But fix TestImageSelf: DrawImage must panic

This commit is contained in:
Hajime Hoshi 2017-03-04 02:20:13 +09:00
parent b567a07d5f
commit 6a4bb0513b

View File

@ -197,14 +197,17 @@ func TestImageComposition(t *testing.T) {
} }
func TestImageSelf(t *testing.T) { func TestImageSelf(t *testing.T) {
defer func() {
if r := recover(); r == nil {
t.Errorf("DrawImage must panic but not")
}
}()
img, _, err := openEbitenImage("testdata/ebiten.png") img, _, err := openEbitenImage("testdata/ebiten.png")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
return return
} }
if err := img.DrawImage(img, nil); err == nil { img.DrawImage(img, nil)
t.Fatalf("img.DrawImage(img, nil) doesn't return error; an error should be returned")
}
} }
func TestImageScale(t *testing.T) { func TestImageScale(t *testing.T) {