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
7bec7671
Commit
7bec7671
authored
Sep 01, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add unit test for cypclass list iterators increasing list refcount
parent
aa4bbb61
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
1 deletion
+35
-1
tests/run/cypclass_builtin_list.pyx
tests/run/cypclass_builtin_list.pyx
+35
-1
No files found.
tests/run/cypclass_builtin_list.pyx
View file @
7bec7671
...
@@ -103,7 +103,6 @@ def test_contains():
...
@@ -103,7 +103,6 @@ def test_contains():
return
0
return
0
return
1
return
1
def
test_getitem_out_of_range
():
def
test_getitem_out_of_range
():
"""
"""
>>> test_getitem_out_of_range()
>>> test_getitem_out_of_range()
...
@@ -303,3 +302,38 @@ def test_values_refcount():
...
@@ -303,3 +302,38 @@ def test_values_refcount():
if
Cy_GETREF
(
value
)
!=
2
:
if
Cy_GETREF
(
value
)
!=
2
:
return
0
return
0
return
1
return
1
def
test_iterator_refcount
():
"""
>>> test_iterator_refcount()
1
"""
l
=
cyplist
[
Value
]()
if
Cy_GETREF
(
l
)
!=
2
:
return
0
def
begin_iterator
():
it
=
l
.
begin
()
if
Cy_GETREF
(
l
)
!=
3
:
return
0
return
1
if
not
begin_iterator
():
return
0
if
Cy_GETREF
(
l
)
!=
2
:
return
0
def
end_iterator
():
it
=
l
.
end
()
if
Cy_GETREF
(
l
)
!=
2
:
return
0
return
1
if
not
end_iterator
():
return
0
if
Cy_GETREF
(
l
)
!=
2
:
return
0
return
1
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