internal/atlas: add TestMaxImageSizeJust

This commit is contained in:
Hajime Hoshi 2022-06-10 14:30:18 +09:00
parent 03567f74f9
commit 37369a2f4b

View File

@ -561,6 +561,15 @@ func Disable_TestMinImageSize(t *testing.T) {
img.ReplacePixels(make([]byte, 4*s*s), nil)
}
func TestMaxImageSizeJust(t *testing.T) {
s := maxImageSizeForTesting
// An unmanged image never belongs to an atlas and doesn't have its paddings.
// TODO: Should we allow such this size for ImageTypeRegular?
img := atlas.NewImage(s, s, atlas.ImageTypeUnmanaged)
defer img.MarkDisposed()
img.ReplacePixels(make([]byte, 4*s*s), nil)
}
func TestMaxImageSizeExceeded(t *testing.T) {
// This tests that a too-big image is allocated correctly.
s := maxImageSizeForTesting