summaryrefslogtreecommitdiff
path: root/numpy/core/tests
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2019-09-04 15:26:44 -0600
committerGitHub <noreply@github.com>2019-09-04 15:26:44 -0600
commit6bdbc1e2fd20df7272802df88f3790e5dd7ed057 (patch)
tree637481cee95993eb1a53ceef5c55cb082aca9fa0 /numpy/core/tests
parentaf76d3b761c4047d314a4bc9a9793577fadcb46e (diff)
parent5f4f7837941f14aa6388d889518be3dfd3872747 (diff)
downloadnumpy-6bdbc1e2fd20df7272802df88f3790e5dd7ed057.tar.gz
Merge pull request #14387 from mattip/dtype-overflow
BUG: test, fix regression in converting to ctypes
Diffstat (limited to 'numpy/core/tests')
-rw-r--r--numpy/core/tests/test_regression.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py
index c5289f6ac..cbd4ceafc 100644
--- a/numpy/core/tests/test_regression.py
+++ b/numpy/core/tests/test_regression.py
@@ -2500,3 +2500,13 @@ class TestRegression(object):
t = T()
#gh-13659, would raise in broadcasting [x=t for x in result]
np.array([t])
+
+ @pytest.mark.skipif(sys.maxsize < 2 ** 31 + 1, reason='overflows 32-bit python')
+ @pytest.mark.skipif(sys.platform == 'win32' and sys.version_info[:2] < (3, 8),
+ reason='overflows on windows, fixed in bpo-16865')
+ def test_to_ctypes(self):
+ #gh-14214
+ arr = np.zeros((2 ** 31 + 1,), 'b')
+ assert arr.size * arr.itemsize > 2 ** 31
+ c_arr = np.ctypeslib.as_ctypes(arr)
+ assert_equal(c_arr._length_, arr.size)