summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2016-01-02 14:12:00 -0700
committerCharles Harris <charlesr.harris@gmail.com>2016-01-02 16:01:17 -0700
commitfe46c47a96e191b028823280fe3451a48d0fc18e (patch)
treeedcff227fe2d46518d3732c00e9a1a41ba20e1c6
parentbba8647dbf7098ffcf6df70b959b6079b5682e0c (diff)
downloadnumpy-fe46c47a96e191b028823280fe3451a48d0fc18e.tar.gz
TST: Add regression test for gh-6922.
Sorting and unaligned void type should not segfault.
-rw-r--r--numpy/core/tests/test_regression.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py
index ac34cfa53..a61e64d8d 100644
--- a/numpy/core/tests/test_regression.py
+++ b/numpy/core/tests/test_regression.py
@@ -2177,5 +2177,11 @@ class TestRegression(TestCase):
# gh-6530 / gh-6553
assert_array_equal(np.percentile(np.arange(10), []), np.array([]))
+ def test_void_compare_segfault(self):
+ # gh-6922. The following should not segfault
+ a = np.ones(3, dtype=[('object', 'O'), ('int', '<i2')])
+ a.sort()
+
+
if __name__ == "__main__":
run_module_suite()