Commit 9953b984 authored by Joseph Weston's avatar Joseph Weston
Browse files

correct tests for different integer sizes

'sys.maxsize' refers to the size of a 'Py_size_t', whereas
ndarray_int's internally store a 'long'. We now correctly test
for hash equality within the relevant integer limits.
parent 20c0f64a
......@@ -276,8 +276,10 @@ def test_as_dict_key():
def test_hash_equality():
random.seed(123)
maxint = sys.maxsize + 1 # will be typically 2**31 or 2**63
int_bits = 63 if maxint > 2**32 else 31
# These refer to the width of integers stored in a tinyarray.ndarray_int.
int_bits = (8 * ta.dtype_size[int]) - 1 # 8 bits per byte, minus 1 sign bit
maxint = 2**(int_bits)
special = [float('nan'), float('inf'), float('-inf'),
0, -1, -1.0, -1 + 0j,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment