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
Kirill Smelkov
cython
Commits
95553775
Commit
95553775
authored
Apr 04, 2013
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extend test case
parent
7245fb12
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
85 additions
and
0 deletions
+85
-0
tests/run/exttype_freelist.pyx
tests/run/exttype_freelist.pyx
+85
-0
No files found.
tests/run/exttype_freelist.pyx
View file @
95553775
...
...
@@ -156,6 +156,91 @@ def test_cmethods(ExtTypeWithCMethods obj not None):
return
x
,
obj
.
get_cattr
()
cdef
class
ExtSubTypeWithCMethods
(
ExtTypeWithCMethods
):
"""
>>> obj = ExtSubTypeWithCMethods()
>>> test_cmethods(obj)
(1, 2)
>>> obj = ExtSubTypeWithCMethods()
>>> test_cmethods(obj)
(1, 2)
>>> obj = ExtSubTypeWithCMethods()
>>> test_cmethods(obj)
(1, 2)
>>> obj = ExtSubTypeWithCMethods()
>>> test_cmethods(obj)
(1, 2)
>>> obj = ExtSubTypeWithCMethods()
>>> test_cmethods(obj)
(1, 2)
>>> obj = ExtSubTypeWithCMethods()
>>> test_cmethods(obj)
(1, 2)
"""
cdef
class
ExtSubTypeWithMoreCMethods
(
ExtSubTypeWithCMethods
):
"""
>>> obj = ExtSubTypeWithMoreCMethods()
>>> test_more_cmethods(obj)
(2, 3, 3)
>>> obj = ExtSubTypeWithCMethods()
>>> test_cmethods(obj)
(1, 2)
>>> obj = ExtTypeWithCMethods()
>>> test_cmethods(obj)
(1, 2)
>>> obj = ExtSubTypeWithMoreCMethods()
>>> test_more_cmethods(obj)
(2, 3, 3)
>>> obj2 = ExtSubTypeWithMoreCMethods()
>>> test_more_cmethods(obj2)
(2, 3, 3)
>>> obj2 = ExtSubTypeWithCMethods()
>>> test_cmethods(obj2)
(1, 2)
>>> obj = ExtSubTypeWithMoreCMethods()
>>> test_more_cmethods(obj)
(2, 3, 3)
>>> obj2 = ExtTypeWithCMethods()
>>> test_cmethods(obj2)
(1, 2)
>>> obj = ExtSubTypeWithMoreCMethods()
>>> test_more_cmethods(obj)
(2, 3, 3)
>>> obj2 = ExtSubTypeWithCMethods()
>>> test_cmethods(obj2)
(1, 2)
>>> obj = ExtSubTypeWithMoreCMethods()
>>> test_more_cmethods(obj)
(2, 3, 3)
>>> obj2 = ExtSubTypeWithCMethods()
>>> test_cmethods(obj2)
(1, 2)
>>> obj = ExtTypeWithCMethods()
>>> test_cmethods(obj)
(1, 2)
"""
def
__cinit__
(
self
):
assert
self
.
cattr
==
1
self
.
cattr
=
2
cdef
int
get_cattr2
(
self
):
return
self
.
cattr
cdef
set_cattr2
(
self
,
int
value
):
self
.
cattr
=
value
def
test_more_cmethods
(
ExtSubTypeWithMoreCMethods
obj
not
None
):
x
=
obj
.
get_cattr
()
assert
obj
.
get_cattr2
()
==
x
obj
.
set_cattr2
(
2
)
assert
obj
.
get_cattr2
()
==
2
obj
.
set_cattr
(
3
)
return
x
,
obj
.
get_cattr
(),
obj
.
get_cattr2
()
@
cython
.
freelist
(
4
)
cdef
class
ExtTypeWithRefCycle
:
"""
...
...
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