mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-14 13:46:57 +03:00
test for images wider than block_size
This commit is contained in:
parent
ae104b0d0e
commit
23527774d3
|
@ -132,3 +132,18 @@ class TestCoreMemory(PillowTestCase):
|
||||||
self.assertGreaterEqual(stats['reused_blocks'], 64)
|
self.assertGreaterEqual(stats['reused_blocks'], 64)
|
||||||
self.assertGreaterEqual(stats['freed_blocks'], 64)
|
self.assertGreaterEqual(stats['freed_blocks'], 64)
|
||||||
self.assertEqual(stats['blocks_cached'], 0)
|
self.assertEqual(stats['blocks_cached'], 0)
|
||||||
|
|
||||||
|
def test_large_images(self):
|
||||||
|
Image.core.reset_stats()
|
||||||
|
Image.core.set_blocks_max(0)
|
||||||
|
Image.core.set_block_size(4096)
|
||||||
|
Image.new('RGB', (2048, 16))
|
||||||
|
gc.collect()
|
||||||
|
Image.core.clear_cache()
|
||||||
|
|
||||||
|
stats = Image.core.get_stats()
|
||||||
|
self.assertGreaterEqual(stats['new_count'], 1)
|
||||||
|
self.assertGreaterEqual(stats['allocated_blocks'], 16)
|
||||||
|
self.assertGreaterEqual(stats['reused_blocks'], 0)
|
||||||
|
self.assertGreaterEqual(stats['freed_blocks'], 16)
|
||||||
|
self.assertEqual(stats['blocks_cached'], 0)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user