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:28:00 -0700
commit00d7499212f26385fc8732ebc7828cdcf0cef514 (patch)
tree5e1e5c0e061b8978e6095a98e284542792e4e482
parentadbd6db171c4cb5864abeee078b8c62d0684a6ad (diff)
downloadnumpy-00d7499212f26385fc8732ebc7828cdcf0cef514.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()