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
Gwenaël Samain
cython
Commits
c2101ebc
Commit
c2101ebc
authored
May 19, 2012
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
buffer access and nogil tests
parent
5330ab1e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
2 deletions
+25
-2
tests/run/pyarray.pyx
tests/run/pyarray.pyx
+25
-2
No files found.
tests/run/pyarray.pyx
View file @
c2101ebc
...
...
@@ -39,14 +39,37 @@ def test_fast_access(a):
"""
cdef
array
.
array
ca
=
a
assert
ca
.
_f
[
1
]
==
2.0
,
ca
.
_f
[
1
]
cdef
float
value
with
nogil
:
value
=
ca
.
_f
[
1
]
assert
value
==
2.0
,
value
assert
ca
.
_c
[:
5
]
==
b'
\
x00
\
x00
\
x80
?
\
x00
'
,
ca
.
_c
[:
5
]
with
nogil
:
ca
.
_f
[
1
]
+=
2.0
assert
ca
.
_f
[
1
]
==
4.0
def
test_fast_buffer_access
(
a
):
"""
>>> a = array.array('f', [1.0, 2.0, 3.0])
>>> test_fast_buffer_access(a)
"""
cdef
array
.
array
[
float
]
ca
=
a
cdef
float
value
with
nogil
:
value
=
ca
[
1
]
assert
value
==
2.0
,
value
with
nogil
:
ca
[
1
]
+=
2.0
assert
ca
[
1
]
==
4.0
def
test_new_zero
(
a
):
"""
>>> a = array.array('f', [1.0, 2.0, 3.0])
...
...
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