cython

changeset 1945:7975aadd82b7

Test for cpp exception handling
author Robert Bradshaw <robertwb@math.washington.edu>
date Fri Apr 03 15:57:01 2009 -0700 (3 years ago)
parents c51e83a4d577
children 49523eb3abb5
files tests/compile/cpp_exceptions_T265.pyx
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/tests/compile/cpp_exceptions_T265.pyx Fri Apr 03 15:57:01 2009 -0700 1.3 @@ -0,0 +1,12 @@ 1.4 +cdef void raise_py_error(): 1.5 + pass 1.6 + 1.7 +cdef extern from "foo.h": 1.8 + cdef int generic_error() except + 1.9 + cdef int specified_error() except +MemoryError 1.10 + cdef int dynamic_error() except +raise_py_error 1.11 + 1.12 +def test_it(): 1.13 + generic_error() 1.14 + specified_error() 1.15 + dynamic_error()