Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xavier Thompson
cython
Commits
3d2eaa78
Commit
3d2eaa78
authored
Nov 09, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapt unit test for cypclass lock errors
parent
84ea02c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
22 deletions
+5
-22
tests/errors/cypclass_lock_error.pyx
tests/errors/cypclass_lock_error.pyx
+5
-22
No files found.
tests/errors/cypclass_lock_error.pyx
View file @
3d2eaa78
...
@@ -9,35 +9,18 @@ cdef cypclass A checklock:
...
@@ -9,35 +9,18 @@ cdef cypclass A checklock:
void
setter
(
self
,
int
a
):
void
setter
(
self
,
int
a
):
self
.
a
=
a
self
.
a
=
a
cdef
void
take_write_locked
(
A
obj
):
pass
cdef
int
take_read_locked
(
const
A
obj
):
return
3
def
incorrect_locks
():
def
incorrect_locks
():
obj
=
A
()
obj
=
A
()
obj
.
a
=
3
obj
.
a
=
3
obj
.
getter
()
obj
.
getter
()
with
rlocked
obj
:
with
rlocked
obj
:
obj
.
setter
(
42
)
obj
.
setter
(
42
)
take_write_locked
(
obj
)
return
obj
.
a
obj
.
a
take_read_locked
(
obj
)
cdef
A
global_cyobject
cdef
void
global_lock_taking
():
with
wlocked
global_cyobject
:
global_cyobject
.
setter
(
global_cyobject
.
getter
()
+
1
)
_ERRORS
=
u"""
_ERRORS
=
u"""
20:4: Reference 'obj' is not correctly locked in this expression (write lock required)
8:15: Reference 'self' is not correctly locked in this expression (read lock required)
21:4: Reference 'obj' is not correctly locked in this expression (read lock required)
10:8: Reference 'self' is not correctly locked in this expression (write lock required)
23:8: Reference 'obj' is not correctly locked in this expression (write lock required)
14:4: Reference 'obj' is not correctly locked in this expression (write lock required)
24:26: Reference 'obj' is not correctly locked in this expression (write lock required)
18:11: Reference 'obj' is not correctly locked in this expression (read lock required)
25:4: Reference 'obj' is not correctly locked in this expression (read lock required)
26:21: Reference 'obj' is not correctly locked in this expression (read lock required)
32:17: Can only lock local variables or arguments
"""
"""
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment