summaryrefslogtreecommitdiff
path: root/tests/errors/const_decl_errors.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'tests/errors/const_decl_errors.pyx')
-rw-r--r--tests/errors/const_decl_errors.pyx17
1 files changed, 14 insertions, 3 deletions
diff --git a/tests/errors/const_decl_errors.pyx b/tests/errors/const_decl_errors.pyx
index 459480adb..29c9896ea 100644
--- a/tests/errors/const_decl_errors.pyx
+++ b/tests/errors/const_decl_errors.pyx
@@ -10,23 +10,34 @@ cdef const int x = 10
cdef struct S:
int member
-cdef func(const int a, const int* b, const (int*) c, const S s, int *const d,
+cdef func(const int a, const int* b, const (int*) c, const S s, int *const d, int **const e, int *const *f,
const S *const t):
a = 10
c = NULL
b[0] = 100
s.member = 1000
d = NULL
+ e[0][0] = 1 # ok
+ e[0] = NULL # ok
+ e = NULL # nok
+ f[0][0] = 1 # ok
+ f[0] = NULL # nok
+ f = NULL # ok
t = &s
+cdef volatile object v
+
_ERRORS = """
-3:5: Const base type cannot be a Python object
+3:5: Const/volatile base type cannot be a Python object
8:5: Assignment to const 'x'
15:4: Assignment to const 'a'
16:4: Assignment to const 'c'
17:5: Assignment to const dereference
18:5: Assignment to const attribute 'member'
19:4: Assignment to const 'd'
-20:4: Assignment to const 't'
+22:4: Assignment to const 'e'
+24:5: Assignment to const dereference
+26:4: Assignment to const 't'
+28:5: Const/volatile base type cannot be a Python object
"""