summaryrefslogtreecommitdiff
path: root/numpy/f2py/tests/test_callback.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/f2py/tests/test_callback.py')
-rw-r--r--numpy/f2py/tests/test_callback.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/numpy/f2py/tests/test_callback.py b/numpy/f2py/tests/test_callback.py
index 98a90a28c..16464140f 100644
--- a/numpy/f2py/tests/test_callback.py
+++ b/numpy/f2py/tests/test_callback.py
@@ -34,6 +34,17 @@ cf2py intent(out) a
external fun
call fun(a)
end
+
+ subroutine string_callback(callback, a)
+ external callback
+ double precision callback
+ double precision a
+ character*1 r
+cf2py intent(out) a
+ r = 'r'
+ a = callback(r)
+ end
+
"""
@dec.slow
@@ -103,6 +114,19 @@ cf2py intent(out) a
r = t(a.mth)
assert_( r==9, repr(r))
+ def test_string_callback(self):
+
+ def callback(code):
+ if code == 'r':
+ return 0
+ else:
+ return 1
+
+ f = getattr(self.module, 'string_callback')
+ r = f(callback)
+ assert_(r == 0, repr(r))
+
+
if __name__ == "__main__":
import nose
nose.runmodule()