Commit 39746182 authored by Stefan Behnel's avatar Stefan Behnel

new test cases from Pyrex

parent 725b6f96
cdef char *spam() except -1:
pass
_ERRORS = u"""
1:26: Exception value incompatible with function return type
"""
cdef struct Spam
cdef extern int spam(void) # function argument cannot be void
cdef extern int grail(int i, void v) # function argument cannot be void
cdef int tomato(Spam s): # incomplete type
pass
_ERRORS = u"""
3:21: Use spam() rather than spam(void) to declare a function with no arguments.
4:29: Use spam() rather than spam(void) to declare a function with no arguments.
5:16: Argument type 'Spam' is incomplete
"""
cdef struct Foo
def f(Foo *p):
pass
_ERRORS = u"""
/Local/Projects/D/Pyrex/Source/Tests/Errors2/e_badpyparam.pyx:3:6: Cannot convert Python object argument to type 'Foo *'
"""
cdef struct Grail
cdef extern object xobj # Python object cannot be extern
cdef object aobj[42] # array element cannot be Python object
cdef object *pobj # pointer base type cannot be Python object
cdef int spam[] # incomplete variable type
cdef Grail g # incomplete variable type
cdef void nada # incomplete variable type
cdef int a_spam[17][] # incomplete element type
cdef Grail a_g[42] # incomplete element type
cdef void a_nada[88] # incomplete element type
cdef struct Eggs:
int spam[]
cdef f(Grail g, # incomplete argument type
void v, # incomplete argument type
int a[]):
pass
_ERRORS = u"""
3:19: Python object cannot be declared extern
4:16: Array element cannot be a Python object
5:12: Pointer base type cannot be a Python object
7:13: Variable type 'int []' is incomplete
8:11: Variable type 'Grail' is incomplete
9:10: Variable type 'void' is incomplete
11:15: Array element type 'int []' is incomplete
12:14: Array element type 'Grail' is incomplete
13:16: Array element type 'void' is incomplete
16:9: Variable type 'int []' is incomplete
#19:1: Function argument cannot be void
19:1: Use spam() rather than spam(void) to declare a function with no arguments.
18:7: Argument type 'Grail' is incomplete
19:1: Invalid use of 'void'
"""
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment