mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-27 03:02:49 +01:00
restorable: Add restoring case to TestReplacePixels
This commit is contained in:
parent
127f6c09c8
commit
1068156215
@ -407,6 +407,27 @@ func TestReplacePixels(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if err := ResolveStaleImages(); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
if err := Restore(); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
for j := 0; j < h; j++ {
|
||||||
|
for i := 0; i < w; i++ {
|
||||||
|
got, err := img.At(i, j)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
want := color.RGBA{}
|
||||||
|
if 5 <= i && i < 9 && 7 <= j && j < 11 {
|
||||||
|
want = color.RGBA{0xff, 0xff, 0xff, 0xff}
|
||||||
|
}
|
||||||
|
if got != want {
|
||||||
|
t.Errorf("img.At(%d, %d): got: %v, want: %v", i, j, got, want)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: How about volatile/screen images?
|
// TODO: How about volatile/screen images?
|
||||||
|
Loading…
Reference in New Issue
Block a user