summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_packbits.py
diff options
context:
space:
mode:
authorJulian Taylor <jtaylor.debian@googlemail.com>2017-02-19 01:28:41 +0100
committerJulian Taylor <jtaylor.debian@googlemail.com>2017-02-19 01:56:06 +0100
commit05f3430ca595e316117d6808051750f4b8c7e233 (patch)
tree546bd4a27f9612975e5f64325aecfebdf1cec77f /numpy/lib/tests/test_packbits.py
parent7a66807ea791c5e2571f09e59ff6dc3fd72c243f (diff)
downloadnumpy-05f3430ca595e316117d6808051750f4b8c7e233.tar.gz
BUG: fix wrong odd determination in packbits
closes gh-8637
Diffstat (limited to 'numpy/lib/tests/test_packbits.py')
-rw-r--r--numpy/lib/tests/test_packbits.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_packbits.py b/numpy/lib/tests/test_packbits.py
index 4bf505f56..965cbf67c 100644
--- a/numpy/lib/tests/test_packbits.py
+++ b/numpy/lib/tests/test_packbits.py
@@ -213,6 +213,15 @@ def test_packbits_large():
assert_raises(TypeError, np.packbits, np.array(a, dtype=float))
+def test_packbits_very_large():
+ # test some with a larger arrays gh-8637
+ # code is covered earlier but larger array makes crash on bug more likely
+ for s in range(950, 1050):
+ for dt in '?bBhHiIlLqQ':
+ x = np.ones((200, s), dtype=bool)
+ np.packbits(x, axis=1)
+
+
def test_unpackbits():
# Copied from the docstring.
a = np.array([[2], [7], [23]], dtype=np.uint8)