mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 01:07:51 -04:00
tests: add more thorough unit test for SparseArray::clear_range
This commit is contained in:
parent
83723d38a5
commit
6464327e6f
@ -35,7 +35,22 @@ def test_sparse_array_clear():
|
|||||||
|
|
||||||
|
|
||||||
def test_sparse_array_clear_range():
|
def test_sparse_array_clear_range():
|
||||||
"""Tests SparseArray behavior for clear_range()."""
|
# Not using parametrize because there are too many values for that.
|
||||||
|
for mask in range(0x7f):
|
||||||
|
for begin in range(8):
|
||||||
|
for size in range(8):
|
||||||
|
b = core.BitArray(mask)
|
||||||
|
s = core.SparseArray(b)
|
||||||
|
|
||||||
|
s.clear_range(begin, size)
|
||||||
|
b.clear_range(begin, size)
|
||||||
|
|
||||||
|
assert core.BitArray(s) == b
|
||||||
|
assert s == core.SparseArray(b)
|
||||||
|
|
||||||
|
|
||||||
|
def test_sparse_array_set_clear_ranges():
|
||||||
|
"""Tests SparseArray behavior for setting and clearing ranges."""
|
||||||
|
|
||||||
# test clear_range with single overlapping on-range
|
# test clear_range with single overlapping on-range
|
||||||
# (clear_range extends beyond highest on-bit)
|
# (clear_range extends beyond highest on-bit)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user