mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
graphics: Improve TestImageTooManyFill
This commit is contained in:
parent
a99c632cb7
commit
331e46a6ce
@ -561,7 +561,7 @@ func TestImageEdge(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func indexToColor(index int) uint8 {
|
func indexToColor(index int) uint8 {
|
||||||
return uint8((17 * index) % 256)
|
return uint8((17 * index + 0x40) % 256)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Issue #419
|
// Issue #419
|
||||||
@ -580,10 +580,10 @@ func TestImageTooManyFill(t *testing.T) {
|
|||||||
|
|
||||||
for i := 0; i < width; i++ {
|
for i := 0; i < width; i++ {
|
||||||
c := indexToColor(i)
|
c := indexToColor(i)
|
||||||
got := color.RGBAModel.Convert(dst.At(i, 0))
|
got := color.RGBAModel.Convert(dst.At(i, 0)).(color.RGBA)
|
||||||
want := color.RGBA{c, c, c, 0xff}
|
want := color.RGBA{c, c, c, 0xff}
|
||||||
if got != want {
|
if !sameColors(got, want, 1) {
|
||||||
t.Errorf("src At(%d, %d): got %#v, want: %#v", i, 0, got, want)
|
t.Errorf("dst.At(%d, %d): got %#v, want: %#v", i, 0, got, want)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user