summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndřej Čertík <ondrej.certik@gmail.com>2012-08-31 15:27:13 -0700
committerOndřej Čertík <ondrej.certik@gmail.com>2012-08-31 15:27:13 -0700
commit103988055053f7a30083fd28c0887a5f2922a67c (patch)
treeaac7166a9a711c5da173c1f8b0a695af8fdd958c
parent8b2e6bed904415006d59344b27a0b23b35fab9ca (diff)
downloadnumpy-103988055053f7a30083fd28c0887a5f2922a67c.tar.gz
BUG: Add a test for Ticket #1588
The bug was fixed by the previous patch.
-rw-r--r--numpy/core/tests/test_regression.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py
index 31a99909b..08431c6f0 100644
--- a/numpy/core/tests/test_regression.py
+++ b/numpy/core/tests/test_regression.py
@@ -1728,5 +1728,14 @@ class TestRegression(TestCase):
a = np.array(['abc'], dtype=np.unicode)[0]
del a
+ def test_refcount_error_in_clip(self):
+ # Ticket #1588
+ a = np.zeros((2,), dtype='>i2').clip(min=0)
+ x = a + a
+ # This used to segfault:
+ y = str(x)
+ # Check the final string:
+ assert_(y == "[0 0]")
+
if __name__ == "__main__":
run_module_suite()